alexgolec / tda-api

A TD Ameritrade API client for Python. Includes historical data for equities and ETFs, options chains, streaming order book data, complex order construction, and more.
https://tda-api.readthedocs.io
MIT License
1.26k stars 336 forks source link

Request CHART_HISTORY_FUTURES service not possible in application yet #42

Closed sdmiami closed 3 years ago

sdmiami commented 4 years ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like Same like other method via streamer, Only Futures chart history is available via Streamer Server.

Additional context Link to official API page --> https://developer.tdameritrade.com/content/streaming-data#_Toc504640594

githubscum commented 4 years ago

I've dug into this as well. Seems like it's a thing with TD Ameritrade. They do not offer historical futures data through the api. See this thread below. https://www.reddit.com/r/algotrading/comments/be113n/td_ameritrade_api_emini_symbol/

I've also scoured the web myself looking for this info. Best I can do is scrape and store yourself from the streaming dataset.

wouldayajustlookatit commented 4 years ago

You should be able to get chart history for futures try doing this TDStreamingClient.chart_history_futures(symbol=['/ES'],frequency='d1',end_time=end,start_time=start)

also make an edit to the func to make sure the symbol can accept list. this is becasue there is a bug further down where it only accepts position 0 so it will submit "/" instead of the whole string /ES

def chart_history_futures(self, symbol: [str], frequency: str, start_time: str = None, end_time: str = None, period: str = None) -> None:

you can optionally remove the need of it being a list but this bug should be fixed

TheMindfulTrader commented 4 years ago

@wouldayajustlookatit Though you get the data from Streaming, their API does not allow to place order for Futures /ES? am i wrong or is there a way to place orders for /ES through their API ?

alexgolec commented 4 years ago

That’s correct, only options and equities are supported through the API.

On Wed, Jul 8 2020 at 10:28 PM, TheMindfulTrader < notifications@github.com > wrote:

@wouldayajustlookatit ( https://github.com/wouldayajustlookatit ) Though you get the data from Streaming, their API does not allow to place order for Futures /ES? am i wrong or is there a way to place orders for /ES through their API ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub ( https://github.com/alexgolec/tda-api/issues/42#issuecomment-655858633 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AGSYSEO3JOCIKBASRLKJ3YDR2UTLTANCNFSM4OJMFI6Q ).

TheMindfulTrader commented 4 years ago

thanks Alex! if you remember i was following up with TDA team and sent you their email response few months back as well :-) i got greedy incase if they started to support /ES !! thanks Alex!

wouldayajustlookatit commented 4 years ago

@wouldayajustlookatit Though you get the data from Streaming, their API does not allow to place order for Futures /ES? am i wrong or is there a way to place orders for /ES through their API ?

not that am aware of but I have yet to try to make that kind of request

sdmiami commented 4 years ago

@alexgolec Keep in mind that we might need to find work around large size data too.

f"Uncompressed payload length exceeds size limit (? > {max_size} bytes)" websockets.exceptions.PayloadTooBig: Uncompressed payload length exceeds size limit (? > 1048576 bytes)