Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Historical price missing the last hour data

I was doing something simple like this:
min_close = data.history(sid(24), "price", bar_count=19800, frequency="1m")
It returns back a series of prices with timezone UTC. The time stamp of the last price every is 20:00, which I believe is 3pm est. Since market closes at 4pm, why are we missing the price from 3pm to 4pm est?

Thanks

1 response

The US markets currently observe Daylight Saving Time from the second Sunday in March through the first Sunday in November (before 2009 it started later and ended earlier). 20:00 UTC is 4:00 PM EDT (Eastern Daylight Time).

Other times of the year 20:00 UTC is 3:00 PM EST (Easter Standard Time). There isn't any missing data. The markets just open an hour earlier.

This is one of the reasons it's a bit complex to use date and time comparisons within an algorithm. Add to this trying to keep track of holidays and half trading days. The best way to handle dates and times is to use the built in schedule functions (IMHO).