Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to get selected minute volume data

Hi everyone,
I'm new to Quantopian, and still trying to figure out how things work here.

I'm trying to apply one simple strategy I read from a blog, which is to apply one "kind of" high frequency factor to lower frequency trading. The factor here is the ratio
ratio = (Vol_m + Vol_a) / Vol
where Vol_m means the volume from 9:30-10:00 and Vol_a means volume from 15:30-16:00, and Vol is the volume of the day.

Which data set should I use to get this factor for a universe for a five day average, and long the lowest 10%, short the highest 10%?
I know the data.history should work, but I'm having some trouble applying that to the pipeline.

3 responses

Pipeline only supports daily OHLCV bars, so you'll need to construct the ratio outside of pipeline.

So one way I think might work would be: make scheduled function everyday morning at 10:00 and 16:00 to load volume for the past 30 minutes, take the sum, and write to a local csv file.
And read that local file to apply my strategy?

Hello Ximo,

You can't write to a CSV file, however values can be stored in context, where they will persist (so long as your algo keeps running).