boyan-soubachov / tastyworks_api

An unofficial, reverse-engineered Python API for tastyworks.
Apache License 2.0
208 stars 79 forks source link

Futures #19

Open boyan-soubachov opened 6 years ago

boyan-soubachov commented 6 years ago

Is your feature request related to a problem? Please describe. Would be useful and convenient to also support futures as an underlying instrument, and all the derivatives that come along with it.

Describe the solution you'd like Normal, first-class support for futures.

miked63017 commented 5 years ago

Is there any way to get the options chains for futures?

If not, do you know if its a completely different endpoint to be queried?

Also, can you give me an idea of the best way to reverse engineer these endpoints, like are you sniffing traffic or just literally revere engineering the javascript from the web ui or what?

boyan-soubachov commented 5 years ago

I'm not sure. When I start with this task I'll figure it out. Traffic sniffing is the approach I prefer to take.

miked63017 commented 5 years ago

I've gotten pretty far since yesterday, I can fetch the futures options(different data structure than regular options) and extract the proper DXFEED name for querying prices. It seems like if you dig through the JS from Tasty's web platform they use a function that returns bool to see if a given symbol would be futures options or regular, then use the returned bool as a switch to change the way some functions work. If you want, I can probably take a stab at a PR doing it that way, though the simplest method to implement would probably be to make a separate _get_tasty_option_chain_data and get_option_chain eg _get_tasty_futures_option_chain_data and get_futures_option_chain.

If you want me to make a PR, let me know which direction you think would be better or easier to manage in terms of code upkeep, and I will submit it when I can.

FWIW I also ran into that time bug described in a different issue, I just commented those lines out for now, will try to remember to exclude that from the PR.

boyan-soubachov commented 5 years ago

I'll have a look soon and see what I can gleam. Will give you a pointer in the direction.

jasonnator commented 3 years ago

I am in the process of writing a very similar API in C# and came across this tidbit on the dxfeed knowledgebase. I haven't been able to implement the interaction with the session object and dxfeed yet but I suspect this will help. It appears that the request is built slightly different depending on which type of instrument you are requesting data.

https://kb.dxfeed.com/en/tools/qds-tool.html