-
Notifications
You must be signed in to change notification settings - Fork 197
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
Polygon API hits 500 upon handle_data call #82
Comments
Also note that this only happens with the bar_count arg of the data.history call is too high.. In my case, I have set |
Polygon definitely has a limit on that call - I think it's 50, from my own tests. Anything above that returns a server error. I will pass this along to Polygon and see if maybe they can get a more useful error, or at least document the limit more obviously. I'll also consider adding some validation there to Pylivetrader when trying to request too many, though I'd rather avoid doing so. I'll close the issue if I determine that's not worthwhile after talking to them. |
We're updating pylivetrader to use the v2 Polygon aggregate method, which should not run into these issues. |
Hey there,
This seems to be a problem with the Polygon API as run through pylivetrader. In my handle_data function of my algorithm, I run the following command:
iwv_close = data.history(context.iwv, "price", context.lookback , "1d")
This causes the following 500 HTTP error from Polygon:
Upon hitting the same URL from Polygon's API through a GET request, I get the following 500 error:
But this error only happens on first request if manually requested.
This seems to be a timeout error thrown by Cassandra. As such, I believe a solution may be to increase Cassandra's tombstone failure threshold, or to handle via pylivetrader by catching this exception and trying a second time (seems like it may work after hitting twice in a row, at least this happens in manual requesting).
The text was updated successfully, but these errors were encountered: