Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Last minute bars are not avalable in data.history

If timestamp of the minute bar is the time of the bar close then we should have 20:00 bars, but they are missing.

2016-04-29 PRINT 2016-04-29 19:57:00+00:00 206.365
2016-04-29 19:58:00+00:00 206.290
2016-04-29 19:59:00+00:00 206.290
Name: Equity(8554 [SPY]), dtype: float64
2016-05-02 PRINT 2016-05-02 19:57:00+00:00 207.945
2016-05-02 19:58:00+00:00 207.970
2016-05-02 19:59:00+00:00 207.980
Name: Equity(8554 [SPY]), dtype: float64
2016-05-03 PRINT 2016-05-03 19:57:00+00:00 206.17
2016-05-03 19:58:00+00:00 206.16
2016-05-03 19:59:00+00:00 206.07
Name: Equity(8554 [SPY]), dtype: float64
2016-05-04 PRINT 2016-05-04 19:57:00+00:00 205.02
2016-05-04 19:58:00+00:00 204.99
2016-05-04 19:59:00+00:00 204.95
Name: Equity(8554 [SPY]), dtype: float64
2016-05-05 PRINT 2016-05-05 19:57:00+00:00 204.760
2016-05-05 19:58:00+00:00 204.835
2016-05-05 19:59:00+00:00 204.830
Name: Equity(8554 [SPY]), dtype: float64
2016-05-06 PRINT 2016-05-06 19:57:00+00:00 205.61
2016-05-06 19:58:00+00:00 205.60
2016-05-06 19:59:00+00:00 205.57
Name: Equity(8554 [SPY]), dtype: float64
End of logs.

1 response

According to the Help page, if no offset is specified, time_rules.market_close() runs 1 minute before market close, i.e. at 19:59 UTC or 15:59 ET. And you can't use an offset of 0.