Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Panda Dataframe - Convert 1 min pricing data into 3 minute pricing data?

Does anyone have Panda code to convert the available 1 min pricing data into 3 minute pricing data time series? Interpreting candlestick pricing patterns is much more elegant using 3 minute bars versus the 'chatter' associated with 1 minute bars. I need to also create standard CCI, MACD, EMV, and stochastic results from the same 3 min data.

I'm new to the Python world on Q. Are there any 'canned' technical indicators somewhere on the Q site to include in strategy code?

Thanks!

Mark

2 responses

Mark,
The Pandas DataFrame returned by the history function has more bells and whistles than I know about, but the simplest way to get 3 minute data would be to use the .resample method, you can pass '3min' or '3T' as the resample frequency, they should be the same result.

You can use a whole slew of technical indicators via the ta-lib module, I attached an example using the CCI indicator on 3min data for you to check out. You might want to refer to some of examples in the documentation as well. Hope this helps get you going, don't hesitate to post questions if you hit any walls.

David

could you pass 5 min? I tried that and i just get an error that the dataframe is empty or rather filled with NaaN