Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help with timeframe!

Hi all,

1). How to get data of different timeframes? For example, 5 minute, 15 minute or 30 minute data of OHLC of each stock?
It seems to me that we need to code separately to get the data for different timeframe?. Or is there already any nice ways to do it?

2). And also, is it possible to have multiple timeframes in an algo? For example, if a 30-minute bar high goes above previous 30-minute bar high, then we buy at next bar close on 5-minute bar. Can we do this??

Please help.

Thank you.

2 responses

Hello Kyu,

This question came up awhile back, and as I recall, there is no built-in way (yet) to generate, say, 5-minute OHLCV bars from the 1-minute bars provided natively.

It is possible to have multiple timeframes in the sense you describe. You could accumulate 60 minutes of data, compute the high in the first half and compare it to the high in the second half, and then wait 5 minutes before making a trading decision.

Hope this helps.

Grant

Thank you, Grant.