You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_historical_data() on an option asset early in market will request a Polygon "from" time before MarketOpen.
First timestamp returned by Polygon will be at MarketOpen
Lumibot code says "returned start date is later than my requested start date ... something bad happened so try again". Then even more bad things happen, but really this should have been expected behavior
Solution
So, I want to kill two birds with one stone. I want to:
pad all Polygon queries with +/- 1day and cache that.
will only pass in Dates, not Datetimes
This solves:
expected start will always be >= cached start
There can no longer possibly be any intra-day gaps in cached data because we always pad out and the data can then always be found.
Trust Polygon ... just query it once, never have to loop through and query it again.
Can throw an exception if something unexpected happened, but "requery" won't help so don't bother.
Cons:
We will cache extra data than what was strictly requested. But this should be fine because:
1 day worth of data is pretty small. 1min candles = 390 rows / day
Agreed in chat that extra data isn't much of a Con.
The text was updated successfully, but these errors were encountered:
Problems Seen
Solution
So, I want to kill two birds with one stone. I want to:
This solves:
Cons:
Agreed in chat that extra data isn't much of a Con.
The text was updated successfully, but these errors were encountered: