boyan-soubachov / tastyworks_api

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

running example.py error after a successful login #48

Open fritol opened 3 years ago

fritol commented 3 years ago

I commented out the order lines 41 to 59 then I run it and get the error below which does not occur if I debug break on line 65 and step into it chain = await option_chain.get_option_chain(session, undl) then i receive the chain so there is perhaps some timing issue ?? (am not familiar with the async stuff)

... client_session: <aiohttp.client.ClientSession object at 0x0000025CC8E77608> 2020-07-30 17:37:15,832 Exception in main loop Traceback (most recent call last): File "C:\Users\XXX\AppData\Roaming\Python\Python37\site-packages\tastyworks\models\option_chain.py", line 84, in _get_tasty_option_chain_data raise Exception(f'Could not find option chain for symbol {underlying.ticker}') TypeError: exceptions must derive from BaseException

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\XXX\tastyworksexample.py", line 95, in main loop.run_until_complete(main_loop(tasty_client, streamer)) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\asyncio\base_events.py", line 579, in run_until_complete return future.result() File "c:\Users\XXX\tastyworksexample.py", line 65, in main_loop chain = await option_chain.get_option_chain(session, undl) File "C:\Users\XXX\AppData\Roaming\Python\Python37\site-packages\tastyworks\models\option_chain.py", line 54, in get_option_chain data = await _get_tasty_option_chain_data(session, underlying) File "C:\Users\XXX\AppData\Roaming\Python\Python37\site-packages\tastyworks\models\option_chain.py", line 85, in _get_tasty_option_chain_data resp = await response.json() TypeError: 'TypeError' object is not callable

bandwiches commented 3 years ago

Raising exception due to a bad response code (anything that's not 200). This could be a few things, but ultimately you are not receiving a 200 HTTP response back from the API endpoint. Could be that the endpoint is down, invalid endpoint, invalid session. I haven't done any aggressive testing, just what I see at a quick glance.

https://github.com/boyan-soubachov/tastyworks_api/blob/0b4f604f5c0cf51e1c2bbb3e9da029b02c70405a/tastyworks/models/option_chain.py#L84

fritol commented 3 years ago

official API should come out sometimes in august 2020 said Tom Sosnoff

bandwiches commented 3 years ago

I'm pretty excited! Though I'll admit, I'm feeling a little defeated too haha

boyan-soubachov commented 3 years ago

official API should come out sometimes in august 2020 said Tom Sosnoff

Thank you for the update. As soon as that's out, I'll archive this repo and call it a closed chapter :)

webventurer commented 3 years ago

No sign of the Tastyworks API and this project looks very useful. Any chance you can merge the latest changes in the issues, fix the example.py and upgrade to Python 3?

spot92 commented 3 years ago

I emailed them today about the API and they said there is no longer a release date, but it is planned for the future at some time.

perigvennetier commented 3 years ago

would love to find a way to keep this project going, it's a great base for adding some good simple strategies

ScientiaCapital commented 3 years ago

it's a great project. would love to use the base to create a trading bot for both their exotic options and now crypto. could start with some simple SMA, RSI and MACD signals to trigger buy or sell.

On Thu, Feb 4, 2021 at 6:14 PM perigvennetier notifications@github.com wrote:

would love to find a way to keep this project going, it's a great base for adding some good simple strategies

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773712338, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65GAVYLMLULLTKMDMQTS5NBARANCNFSM4POBBKGA .

perigvennetier commented 3 years ago

I'm not a super coder and this is a bit difficult for me to follow how to add new functionalities and how to use the code to get the data I need like greeks, etc. documentation would be awesome :D

ScientiaCapital commented 3 years ago

I'm not a super code like boyan or even the person who just fixed things. that was pretty awesome. just started a fintech bootcamp myself and trying to learn how to take awesome things like this and then translate my trading background into buys/seels in TastyTrade. They have such an awesome platform for options.

TK

On Thu, Feb 4, 2021 at 6:19 PM perigvennetier notifications@github.com wrote:

I'm not a super coder and this is a bit difficult for me to follow how to add new functionalities and how to use the code to get the data I need like greeks, etc. documentation would be awesome :D

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773714092, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65BQXAIXDZVDXOQGT4DS5NBRXANCNFSM4POBBKGA .

boyan-soubachov commented 3 years ago

I unfortunately am short on time to maintain this. As rewarding as the project is, there hasn’t been much incentive to dedicate more time to it.

I am happy to assist or if something can be worked out

On 5 Feb 2021, at 12:27, ScientiaCapital notifications@github.com wrote:

 I'm not a super code like boyan or even the person who just fixed things. that was pretty awesome. just started a fintech bootcamp myself and trying to learn how to take awesome things like this and then translate my trading background into buys/seels in TastyTrade. They have such an awesome platform for options.

TK

On Thu, Feb 4, 2021 at 6:19 PM perigvennetier notifications@github.com wrote:

I'm not a super coder and this is a bit difficult for me to follow how to add new functionalities and how to use the code to get the data I need like greeks, etc. documentation would be awesome :D

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773714092, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65BQXAIXDZVDXOQGT4DS5NBRXANCNFSM4POBBKGA .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

bandwiches commented 3 years ago

This repo got a lot more popular recently, I've followed for a while. I'd like to help out, time limiting of course.

perigvennetier commented 3 years ago

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

ScientiaCapital commented 3 years ago

i would be happy to play w/ it. have four or five more weeks for the berkeley fintech challenges to be over before i can spend time on trying to use this to execute trades, then possibly use this as a background to create a crypto trading bot. what i loved about tasty is they really have great exotic options that would be fun to trade. i can dedicate more time and actually would love the oversight of boyan when we do start up. . https://medium.com/swlh/a-full-crypto-trading-bot-in-python-aafba122bc4e

On Thu, Feb 4, 2021 at 7:38 PM perigvennetier notifications@github.com wrote:

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773742682, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65B72BW5JF6WYW6KPFTS5NKZPANCNFSM4POBBKGA .

bandwiches commented 3 years ago

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

One thing that works in another repo I follow is a discussion board. People ask for help there at all levels and the community helps. It also helps separate actual repo issues from unrelated issues.

ScientiaCapital commented 3 years ago

Is that or would that be setup when we fork it to use it for the crypto bot? BTW bandwiches you are a badass and boyan too. loved watched how you fixed things and just wish i could fly in like that on code see problems and then fix them on the fly. Tasty woudl be a fun platform to play around with and thank you to you both we can now think about doing that.

On Thu, Feb 4, 2021 at 7:49 PM bandwiches notifications@github.com wrote:

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

One thing that works in another repo I follow is a discussion board. People ask for help there at all levels and the community helps. It also helps separate actual repo issues from unrelated issues.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773746709, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65DOEVRWXA347LMFUQDS5NMDZANCNFSM4POBBKGA .

perigvennetier commented 3 years ago

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

One thing that works in another repo I follow is a discussion board. People ask for help there at all levels and the community helps. It also helps separate actual repo issues from unrelated issues.

Could this be set up here on this repo?

ScientiaCapital commented 3 years ago

that would be cool then you can manage and help w/ documentation going forward. boyan and bandwiches can watch us flail around trying to figure out a Crypto trading bot using Tasty. Perfect timing with their announcement two days ago adding Crypto..

On Thu, Feb 4, 2021 at 7:56 PM perigvennetier notifications@github.com wrote:

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

One thing that works in another repo I follow is a discussion board. People ask for help there at all levels and the community helps. It also helps separate actual repo issues from unrelated issues.

Could this be set up here on this repo?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773749207, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65H2TW4YJ5T7QOAARRTS5NM5JANCNFSM4POBBKGA .

perigvennetier commented 3 years ago

I am really interested in getting something super simple like getting equities quotes, option chains, option Greeks, specific options bid/ask based on the Greeks. And eventually the trading actions. That’s pretty much it. If I can help anyway after learning, a discussion board would be great.

ScientiaCapital commented 3 years ago

That sounds like a great plan and start.

On Thu, Feb 4, 2021 at 8:13 PM perigvennetier notifications@github.com wrote:

I am really interested in getting something super simple like getting equities quotes, option chains, option Greeks, specific options bid/ask based on the Greeks. And eventually the trading actions. That’s pretty much it. If I can help anyway after learning, a discussion board would be great.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-773755468, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65EY6BNWTJTXG5DT32DS5NO6XANCNFSM4POBBKGA .

bandwiches commented 3 years ago

I'd really love to help out with my (very) limited knowledge, maybe just even write documentation, I just can't seem to find out how to do simple things like simply retrieve all the information about an underlying, so if someone if willing to help out via email or somewhere else that'd be awesome.

One thing that works in another repo I follow is a discussion board. People ask for help there at all levels and the community helps. It also helps separate actual repo issues from unrelated issues.

Could this be set up here on this repo?

I believe it can be added at any time on a public repo - though I could be wrong here.

Is that or would that be setup when we fork it to use it for the crypto bot? BTW bandwiches you are a badass and boyan too. loved watched how you fixed things and just wish i could fly in like that on code see problems and then fix them on the fly. Tasty woudl be a fun platform to play around with and thank you to you both we can now think about doing that.

I appreciate this comment! I'm just a DevOps guy, at the end of the day I rely on more stable programmers to improve my coding skills too! :)

I am really interested in getting something super simple like getting equities quotes, option chains, option Greeks, specific options bid/ask based on the Greeks. And eventually the trading actions. That’s pretty much it. If I can help anyway after learning, a discussion board would be great.

A lot of this is available in market-metrics, I have this module written but I haven't submitted it for a merge yet (currently waiting on watchlists/symbol-search merges to go in first since they're mostly just updates).

bandwiches commented 3 years ago

@boyan-soubachov is this something you can enable for this repo?
image

ScientiaCapital commented 3 years ago

If you need watchlists i have plenty. my themes last year were crypto miners, now I am focusing my efforts/research/investing into the Precious Metals Miners Palladium, Platinum, Uranium, Silver, Gold, Copper. I am a trader and learning all the FinTech tools and programming brand new. Would love if you push my skills to improve on the things I don't know. I'm ready to jump in since my goal is to be a Quant Trader using my HFT platform that I create for myself/trading.

On Fri, Feb 5, 2021 at 8:56 AM bandwiches notifications@github.com wrote:

@boyan-soubachov https://github.com/boyan-soubachov is this something you can enable for this repo? [image: image] https://user-images.githubusercontent.com/16140382/107056683-33ff6e80-6798-11eb-9863-a77f6c7a0c10.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-774119416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65HB343ISJH5JRBA233S5QII7ANCNFSM4POBBKGA .

ScientiaCapital commented 3 years ago

i sue tradingview and alpaca paper trading. trying to get this setup and could be fun to do the same with tastyworks api and use the same tradingview webhooks. I have signals also set up on indicators that could be used as buy/sell signals that execute trades by pushing a webhook in JSON to the website. https://www.youtube.com/watch?v=TKAo_Z-hzQs

On Fri, Feb 5, 2021 at 9:28 AM Tim Kipper tkipper@gmail.com wrote:

If you need watchlists i have plenty. my themes last year were crypto miners, now I am focusing my efforts/research/investing into the Precious Metals Miners Palladium, Platinum, Uranium, Silver, Gold, Copper. I am a trader and learning all the FinTech tools and programming brand new. Would love if you push my skills to improve on the things I don't know. I'm ready to jump in since my goal is to be a Quant Trader using my HFT platform that I create for myself/trading.

On Fri, Feb 5, 2021 at 8:56 AM bandwiches notifications@github.com wrote:

@boyan-soubachov https://github.com/boyan-soubachov is this something you can enable for this repo? [image: image] https://user-images.githubusercontent.com/16140382/107056683-33ff6e80-6798-11eb-9863-a77f6c7a0c10.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boyan-soubachov/tastyworks_api/issues/48#issuecomment-774119416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAV65HB343ISJH5JRBA233S5QII7ANCNFSM4POBBKGA .

bandwiches commented 3 years ago

I'm not sure what's happening with this repo, but I wanted to extend whatever help I can. I manage a discord community that's particularly small, but robust. If you guys are interested, maybe I could extend that invite and it could kind of be a place to come and go for scripting help? Just throwing out ideas.

My current problem is that I cannot update this particular repo with anything new, I have to rely on maintainers to want to pull these updates and if that doesn't happen, then this repo becomes stale. Which means you guys have to follow my fork or risk never seeing the update.

I'm kind of at a loss here @boyan-soubachov, I'm not sure what options we as followers/forkers have to help keep this repo afloat with respect to this being the original repo.

boyan-soubachov commented 3 years ago

Hey. I will try and find some time to help out the community 🙂. Would also be cool to join the Discord and get direct feedback from the users

On 11 Feb 2021, at 01:25, bandwiches notifications@github.com wrote:

 I'm not sure what's happening with this repo, but I wanted to extend whatever help I can. I manage a discord community that's particularly small, but robust. If you guys are interested, maybe I could extend that invite and it could kind of be a place to come and go for scripting help? Just throwing out ideas.

My current problem is that I cannot update this particular repo with anything new, I have to rely on maintainers to want to pull these updates and if that doesn't happen, then this repo becomes stale. Which means you guys have to follow my fork or risk never seeing the update.

I'm kind of at a loss here @boyan-soubachov, I'm not sure what options we as followers/forkers have to help keep this repo afloat with respect to this being the original repo.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

perigvennetier commented 3 years ago

Hey. I will try and find some time to help out the community 🙂. Would also be cool to join the Discord and get direct feedback from the users

That’s awesome. Setting up the discussion board here would be great too!

bandwiches commented 3 years ago

It's a little limited for those who don't care for gaming, but there are a couple of us who hang out in the social area and trade/talk Tasty while we work (and some who game). Everyone is welcome, the bot is mine (I build and maintain it almost every day) and there is a special section setup for Tasty people, all you have to do is subscribe via the bot and it will open it up for you.

People come and go, comes with the work unfortunately.

Discord Invite

You can subscribe to Tasty by chatting: @Sheep sub tasty once you accept the ToS (@Sheep help for more). Works in any channel.

I could talk all day about all this stuff so I'll just shut up and leave this here. Feel free to message me on Discord as well if you don't want to join the community, just have questions, want some introductions, or whatever: BANDWICHES#9999

Edit: Fair warning, work is peaking right now so I'm a bit busier than normal.

Edit: Created a channel related to this package to make it easier for everyone, it should show up after you sub.

boyan-soubachov commented 3 years ago

@boyan-soubachov is this something you can enable for this repo? image

Discussions is now live :)