Loving the wrapper, sir! Thanks for all the hard work. You've got a small bug in client.py. Line 761. You're casting 'period_type' to int(), but that index is a string in fields.py. I think you meant: if int(period) in VALID_CHART_VALUES[frequency_type][period_type]: Cheers!
Thanks for your work on this. A question I have is it doesn't appear that you can pull hour, 2 hour, or 4 hour data is that correct or I just missed how this is done? I have done searches but all the examples seem to be for a minute or the defaults.
thks for your great content. - FYI at, 10'15 this didnt't work (maybe it used to, but not anymore as of today) ```option_chains = td_client.get_options_chain(args_dictionary = opt_chain)``` this worked ``` option_chains = td_client.get_options_chain(opt_chain)```
Any videos for the streaming data API section? I successfully run the streaming data test code and get responses already. But how could I process and save these streaming data? Thanks! Great videos and API!
Just started using the API which is awesome BTW!. I did a manual install (vs PIP) to review the code and become familiar with it one function at a time. login() worked fine (verified the json/tokens). I'm using get_accounts() now to get info on 'all' accounts. Wierd thing is it returns the account numbers/list correctly (accountId = 'xxxxx') but there is no actual data in the return dictionaries (everything returned is 0.0). For example 'cashBalance = 0.0' is not correct. What did I miss?
I figured out a work around. I was using fields['positions', 'orders'] parameter to get_accounts() when it did above. If I omit the fields parameter it works properly. Why would that be?
You can use the chart_history_futures endpoint in the streaming API, and that will give you historical futures data. It will also go down to Minute level data.
To enable Real-Time data: 1.Login to your TDA profile www.tdameritrade.com/home.page 2.Click "My Profile" on the top row of the page 3.In My Profile, go to the "Subscriptions" tab 4.You should see something about enabled RT-Quotes - you're a non-professional (you would know if you're "professional") just click through the docs and accept
Hey Sigma - Great vid as always. I know you're uploading the orders video next so I may be jumping the gun a bit but have you ran into any problems submitting "TRAILING_STOP_LIMIT" orders through the API? I was checking out your GitHub documentation and saw that you include one in the order samples. Not sure if you've been able to run it successfully but whenever I place those orders via API I receive the following error: ===> "error": "orderType [Trailing Stop Limit] must be one of [Market,Limit,Stop,Stop Limit,Trailing Stop,Exercise]. I have advanced features disabled and can successfully place other order types but wanted to let you know this error might occur before your next video in case it could be of value to your other viewers. If you have either a working solution or any idea what might be causing this issue please let me know. It'd be a life saver! Anyway thanks again for the useful content. Can't wait to see more. Cheers!
Hello, I been following your videos, they're exceptional. Great work . For the TD Ameritrade API get_price_history it only shows previous days market data, not current/today's data. correct? That is what I am experiencing
My goal is to get the "today's market data" / "current day " market data. ... 5 minute candles data for the past 30 minutes of the current date, when the market is open/active.
I've been using your library but i'm having some issues with data not updating every time I run my program. my values stay the same, how can I fix this?
Hi Alireza. Thks for your great content I get this error when trying to pass opt_chain dic as an argument to get_options_chain - Any idea? Thks option_chains = td_client.get_options_chain(args_dictionary = opt_chain) TypeError: get_options_chain() got an unexpected keyword argument 'args_dictionary'
Is there a reason why the application does not have methods for the saved orders. They are covered in earlier videos but it seems they are not implemented into the library. i am using td_ameritrade_python_api-0.2.3 - As always, amazing videos! thx!
It's in there, they were originally not but they should be in there now just make sure to update the library. Also, MAKE SURE ADVANCED FEATURES IS OFF on your account. Saved Orders won't work if you have Advanced Features on.
Hey- its a real bummer about the 15 minute delay for historical data. There is a pricey solution in an api like polygon.io ($200/month or $180 with alpha vantage promo) , but have you looked at the TOS DataBridge project on github (github.com/jeog/TOSDataBridge)? It looks like this accesses real - time data through the back-end of the Thinkorswim application on windows. I would be really interested to see if it works. Just thought I'd throw that out there. By the way - thank you so much for these videos, the content is super helpful.
@@swolepatrol7363 Hey, sorry I never ended up getting that far personally. It looks like there is a comment from @AlirezaRezaee below regarding enabling real time data though - maybe it will help you?
Anyone know what the needExtendedHoursData has been changed to? I have tried a couple different variants but they all throw TypeError: get_price_history() got an unexpected keyword argument 'need_extended_hours_data'
Has anyone noticed that negative values from the Instruments API get returned as zero? I wrote a program to pull fundamental data for the stocks I'm following, but noticed that I never see negative values. I compared website values to the API values and found out that the API returns negative values as zero.
Loving the wrapper, sir! Thanks for all the hard work.
You've got a small bug in client.py. Line 761. You're casting 'period_type' to int(), but that index is a string in fields.py. I think you meant:
if int(period) in VALID_CHART_VALUES[frequency_type][period_type]:
Cheers!
Two videos in one day?!
*YAY!*
Thank you man I appreciate your work
My pleasure!
Thanks for your work on this. A question I have is it doesn't appear that you can pull hour, 2 hour, or 4 hour data is that correct or I just missed how this is done? I have done searches but all the examples seem to be for a minute or the defaults.
thks for your great content. - FYI at, 10'15 this didnt't work (maybe it used to, but not anymore as of today)
```option_chains = td_client.get_options_chain(args_dictionary = opt_chain)```
this worked
``` option_chains = td_client.get_options_chain(opt_chain)```
Any videos for the streaming data API section? I successfully run the streaming data test code and get responses already. But how could I process and save these streaming data? Thanks! Great videos and API!
Just started using the API which is awesome BTW!. I did a manual install (vs PIP) to review the code and become familiar with it one function at a time. login() worked fine (verified the json/tokens). I'm using get_accounts() now to get info on 'all' accounts. Wierd thing is it returns the account numbers/list correctly (accountId = 'xxxxx') but there is no actual data in the return dictionaries (everything returned is 0.0). For example 'cashBalance = 0.0' is not correct. What did I miss?
I figured out a work around. I was using fields['positions', 'orders'] parameter to get_accounts() when it did above. If I omit the fields parameter it works properly. Why would that be?
Thank you so much for this!
You're so welcome!
get_price_history() doesn't work with futures? Is there a way to get historical price data for futures, preferably minute data?
You can use the chart_history_futures endpoint in the streaming API, and that will give you historical futures data. It will also go down to Minute level data.
Is it not possible to get the options chain for futures like /ES?
No not for futures unfortunately.
To enable Real-Time data:
1.Login to your TDA profile www.tdameritrade.com/home.page
2.Click "My Profile" on the top row of the page
3.In My Profile, go to the "Subscriptions" tab
4.You should see something about enabled RT-Quotes - you're a non-professional (you would know if you're "professional") just click through the docs and accept
Hey Sigma - Great vid as always.
I know you're uploading the orders video next so I may be jumping the gun a bit but have you ran into any problems submitting "TRAILING_STOP_LIMIT" orders through the API?
I was checking out your GitHub documentation and saw that you include one in the order samples. Not sure if you've been able to run it successfully but whenever I place those orders via API I receive the following error:
===> "error": "orderType [Trailing Stop Limit] must be one of [Market,Limit,Stop,Stop Limit,Trailing Stop,Exercise].
I have advanced features disabled and can successfully place other order types but wanted to let you know this error might occur before your next video in case it could be of value to your other viewers. If you have either a working solution or any idea what might be causing this issue please let me know. It'd be a life saver!
Anyway thanks again for the useful content. Can't wait to see more. Cheers!
Hello, I been following your videos, they're exceptional. Great work .
For the TD Ameritrade API get_price_history it only shows previous days market data, not current/today's data. correct? That is what I am experiencing
My goal is to get the "today's market data" / "current day " market data. ... 5 minute candles data for the past 30 minutes of the current date, when the market is open/active.
I've been using your library but i'm having some issues with data not updating every time I run my program. my values stay the same, how can I fix this?
Hi Alireza.
Thks for your great content
I get this error when trying to pass opt_chain dic as an argument to get_options_chain - Any idea? Thks
option_chains = td_client.get_options_chain(args_dictionary = opt_chain)
TypeError: get_options_chain() got an unexpected keyword argument 'args_dictionary'
Is there a reason why the application does not have methods for the saved orders. They are covered in earlier videos but it seems they are not implemented into the library. i am using td_ameritrade_python_api-0.2.3 - As always, amazing videos! thx!
It's in there, they were originally not but they should be in there now just make sure to update the library. Also, MAKE SURE ADVANCED FEATURES IS OFF on your account. Saved Orders won't work if you have Advanced Features on.
Hey- its a real bummer about the 15 minute delay for historical data. There is a pricey solution in an api like polygon.io ($200/month or $180 with alpha vantage promo) , but have you looked at the TOS DataBridge project on github (github.com/jeog/TOSDataBridge)?
It looks like this accesses real - time data through the back-end of the Thinkorswim application on windows. I would be really interested to see if it works. Just thought I'd throw that out there.
By the way - thank you so much for these videos, the content is super helpful.
@@swolepatrol7363 Hey, sorry I never ended up getting that far personally. It looks like there is a comment from @AlirezaRezaee below regarding enabling real time data though - maybe it will help you?
Anyone know what the needExtendedHoursData has been changed to? I have tried a couple different variants but they all throw TypeError: get_price_history() got an unexpected keyword argument 'need_extended_hours_data'
extended_hours
Has anyone noticed that negative values from the Instruments API get returned as zero? I wrote a program to pull fundamental data for the stocks I'm following, but noticed that I never see negative values. I compared website values to the API values and found out that the API returns negative values as zero.
it's likely that can't make an one-hour or two-hour or four-hour data tho