Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamer update for the new DXFeed API #83

Merged
merged 22 commits into from
Nov 15, 2023
Merged

Streamer update for the new DXFeed API #83

merged 22 commits into from
Nov 15, 2023

Conversation

Quenos
Copy link
Contributor

@Quenos Quenos commented Aug 1, 2023

Description

DXFeed introduced a new API

  • streamer.py and dxFeed classes updated to work with new API

All contracts stayed the same so code should be working, albeit that at current this new API has only limited capabilities.
No options e.g. Also some symbols are not working

Related issue(s)

No issue submitted

Pre-merge checklist

  • Passing tests:
    - Happy flow and some faults are tested
    * candles are not working, also not working with the example of the DXfeed website.
  • New tests added (if applicable)

@Quenos
Copy link
Contributor Author

Quenos commented Aug 1, 2023

It's a bit beyond me where to put

import requests

in order to pass the lint for the sequence of the imports

tastytrade/metrics.py Outdated Show resolved Hide resolved
@Graeme22
Copy link
Contributor

Graeme22 commented Aug 1, 2023

Hey! This looks interesting, I'm excited to try it out! I noticed the other streamer in the API docs and I am intrigued.

To start off, could you make this in addition to the existing streamer instead of replacing it? I don't think it makes sense to replace the existing streamer yet, especially when the new one has more limited functionality.

Other than that, I think it would be good to get the tests passing. And the Event classes probably don't need to be modified; the event type is implicit in the class definition. Maybe remove that key from the dict before casting it into a class object?

It's a bit beyond me where to put

import requests

in order to pass the lint for the sequence of the imports

You can just run isort tastytrade and the order will be fixed automagically.

@Quenos
Copy link
Contributor Author

Quenos commented Aug 2, 2023

  • old streamer put back. Switchable using use_legacy flag on create
  • Used isort. Is there a way to check this locally before pushing?

@Quenos
Copy link
Contributor Author

Quenos commented Aug 2, 2023

Need some help with these last three issues

Copy link
Contributor

@Graeme22 Graeme22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Can you clean up a few more things?

setup.py Outdated Show resolved Hide resolved
tastytrade/dxfeed/candle.py Outdated Show resolved Hide resolved
tastytrade/streamer.py Outdated Show resolved Hide resolved
@michaelcooke
Copy link
Contributor

@Graeme22 @Quenos is there anything I can do to help push this one along? It looks like all of the remaining items were addressed.

@Graeme22
Copy link
Contributor

Hey! I've been crazy busy the last couple months, but things are calmer now so I should get the chance to tackle this in the next couple days. Thanks for being patient in the meantime!

@Graeme22
Copy link
Contributor

This is more urgent than I thought, it seems like the old streamer has been moved to delayed quotes! In light of this I don't think there's any reason to keep the old streamer.

@michaelcooke
Copy link
Contributor

it seems like the old streamer has been moved to delayed quotes!

It's still possible to get live quotes using dxFeed with the token and url obtained by the /quote-streamer-tokens endpoint. On the platform, you can switch from dxFeed to dxLink by opening settings and triple-clicking the "Currently using..." text in the general tab. Tastytrade hasn't told me how long they -- or dxFeed -- will support this data feed, but enough users are reporting issues with the websocket stream that I anticipate it will be supported for the platform for the time being.

I would bet that your quotes are being delayed arbitrarily by tastytrade; I had the same issue. You should stop any applications you personally have running using dxFeed, contact tastytrade support to complain about delayed quotes and mention you are not using the old data system, and wait for them to switch you back to live data. From there, you should be able to use dxFeed or dxLink for live data.

If it sounds confusing, arbitrary, and opaque, it's because it is.

@michaelcooke
Copy link
Contributor

michaelcooke commented Oct 27, 2023

As a testing note, wss://tasty-openapi-ws.dxfeed.com/realtime supports fewer event types than wss://tasty-live-ws.dxfeed.com/realtime. Tastytrade has told me this is intentional, and were surprised to hear that the extra events listed below were supported by the live platform feed.

Supported events by both feeds:

  • Quote
  • Candle
  • Trade
  • Summary
  • Profile

Undocumented events supported only by live feed for platform:

  • DailyCandle
  • TradeETH
  • Greeks
  • TimeAndSale
  • Underlying
  • AnalyticOrder
  • OptionSale
  • Order
  • Series
  • Configuration
  • Message

@Graeme22
Copy link
Contributor

As a testing note, wss://tasty-openapi-ws.dxfeed.com/realtime supports fewer event types than wss://tasty-live-ws.dxfeed.com/realtime. Tastytrade has told me this is intentional, and were surprised to hear that the extra events listed below were supported by the live platform feed.

Supported events by both feeds:

  • Quote
  • Candle
  • Trade
  • Summary
  • Profile

Undocumented events supported only by live feed for platform:

  • DailyCandle
  • TradeETH
  • Greeks
  • TimeAndSale
  • Underlying
  • AnalyticOrder
  • OptionSale
  • Order
  • Series
  • Configuration
  • Message

This is great stuff, thanks for researching this!

@Graeme22
Copy link
Contributor

It's still possible to get live quotes using dxFeed with the token and url obtained by the /quote-streamer-tokens endpoint. On the platform, you can switch from dxFeed to dxLink by opening settings and triple-clicking the "Currently using..." text in the general tab. Tastytrade hasn't told me how long they -- or dxFeed -- will support this data feed, but enough users are reporting issues with the websocket stream that I anticipate it will be supported for the platform for the time being.

That's good to know, so we have more time to get these changes integrated then. That said, we should probably get this PR moving along.

@Graeme22
Copy link
Contributor

To start, can we name the streamers DXFeedStreamer and DXLinkStreamer? And update the DXLink streamer to only support the events that are currently working?

@Graeme22
Copy link
Contributor

To start, can we name the streamers DXFeedStreamer and DXLinkStreamer? And update the DXLink streamer to only support the events that are currently working?

This will require changes in the documentation as well.

@Quenos
Copy link
Contributor Author

Quenos commented Nov 8, 2023

What is still needed here, lost track due to all the comments.

@Graeme22
Copy link
Contributor

Graeme22 commented Nov 9, 2023

To start, can we name the streamers DXFeedStreamer and DXLinkStreamer? And update the DXLink streamer to only support the events that are currently working?

This to start with

@Graeme22 Graeme22 closed this Nov 15, 2023
@Graeme22 Graeme22 reopened this Nov 15, 2023
@Graeme22 Graeme22 closed this Nov 15, 2023
@Graeme22 Graeme22 reopened this Nov 15, 2023
@Graeme22 Graeme22 merged commit e4af7aa into tastyware:master Nov 15, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants