-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming API #16
Comments
Yes, thanks for the library! I was able to extend it to get the Streaming API to work and forward it to TWS API so I can do some paper trading. However, it seems like TD Ameritrade will not allow you to connect for longer than 1.5 days. It varies. I can sometimes maintain streaming for as long as 2.5 days but no more. I have code there that handles reconnections (e.g., when I kill my network connection) and works, but for some reason after 1.5 days or so, it won't work. My guess is that this is a TD Ameritrade limitation. What is perplexing, however, is that if I stop my app and then restart it, I can start streaming again. My first thought was to make sure OkHttpClient, which HttpTdaClient also uses, clears any cache, cookies, etc. That still doesn't help. Assuming it's OkHttpClient, there must be a way to totally re-initialize it. Has anyone run into this issue? Or have any ideas on totally re-initializing OkHttpClient like maybe reloading any system libraries? |
Hi @ma would you be willing to show me your streaming code or do a pull request? I would like to test it out, and then I can see if I also get kicked off after 1.5 days or so. Maybe it's just a "You" issue and not the rest of us (e.g. you're not as good of a stonk trader as we are, lol - just kidding). Anyway, let me see the code and if we can figure out that it's a OKHttp issue, then there is a possibility we can change the OKHttp lib to use a newer version, because they aren't even really updating any longer the version that is used for this TDA Client. Thanks! |
Sure, but it may be confusing / too much since a lot of it is to adapt the TDA request / response to TWS. If you still want it, I can attach it later. Otherwise, when I have time, I can strip it down to the bare bones. |
Hi,
First of all, thanks for the package. It is simple to use and works great.
Can you add streaming API assuming TD supports streaming?
Streaming API allows
user can decide whether to use queue, messaging, etc. on callback
Thanks for your consideration,
Brian
The text was updated successfully, but these errors were encountered: