How to Use the TD Ameritrade Python API Library | Pt. 2

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 33

  • @stevesmith9746
    @stevesmith9746 4 года назад +4

    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!

  • @FabledNarrative
    @FabledNarrative 4 года назад +1

    Two videos in one day?!
    *YAY!*

  • @Christopher_Tron
    @Christopher_Tron 3 года назад +1

    Thank you man I appreciate your work

  • @pysquaredmgmt1806
    @pysquaredmgmt1806 2 года назад

    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.

  • @patou38000
    @patou38000 3 года назад

    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)```

  • @mxbao1690
    @mxbao1690 4 года назад +1

    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!

  • @cliffordsmith2218
    @cliffordsmith2218 4 года назад +1

    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?

    • @cliffordsmith2218
      @cliffordsmith2218 4 года назад

      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?

  • @charlie3k
    @charlie3k 4 года назад +1

    Thank you so much for this!

  • @parthpatel4917
    @parthpatel4917 4 года назад +1

    get_price_history() doesn't work with futures? Is there a way to get historical price data for futures, preferably minute data?

    • @SigmaCoding
      @SigmaCoding  4 года назад +2

      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.

  • @zemetor
    @zemetor 3 года назад +1

    Is it not possible to get the options chain for futures like /ES?

    • @SigmaCoding
      @SigmaCoding  3 года назад +1

      No not for futures unfortunately.

  • @AlirezaRezaee
    @AlirezaRezaee 3 года назад +1

    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

  • @anonperson8156
    @anonperson8156 4 года назад +1

    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!

  • @codingforslowpeople6721
    @codingforslowpeople6721 3 года назад

    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

    • @codingforslowpeople6721
      @codingforslowpeople6721 3 года назад

      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.

  • @weevedabest
    @weevedabest 3 года назад

    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?

  • @patou38000
    @patou38000 3 года назад

    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'

  • @sebtaciak
    @sebtaciak 4 года назад +1

    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!

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      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.

  • @davidcorson2435
    @davidcorson2435 4 года назад +1

    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.

    • @davidcorson2435
      @davidcorson2435 Год назад

      ​@@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?

  • @liammaxcampbell
    @liammaxcampbell 3 года назад

    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'

  • @chrisselman8078
    @chrisselman8078 3 года назад

    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.

  • @tso8761
    @tso8761 2 года назад

    it's likely that can't make an one-hour or two-hour or four-hour data tho