Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Extend history() to include date/time

In the API it explains history(bar_count, frequency, field, ffill=True). I noted that "date/time" is not one of the available fields to use, but it would be quite useful especially when I want to use minute data. I am not sure whether it's safe to assume that there are 390 minutes in a trading day (6.5hr * 6); presumably not, as there may be days that trading did not last for the whole day.

My question is, how can I extend the history() function?

2 responses

Hello William,

The dataframe returned by history() should have minutely datetime stamps on every row, no? Or are you talking about something else?

Grant

Hi Grant,

Thanks for responding.

I just realised that there is a timestamp associated with each row, as indexes. I understand the data structure a bit better now. Thanks!

William