Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How would one compare today's first half hour volume to average first half hour volume?

As a novice pythonite, I wonder how to code this: Compare first half hour volume today with the first half hour 10-day average volume. Buy, if today's volume is greater.

2 responses

@Easan K., I don't think this works -- mainly due to the apparent inconsistency of the retrieval of exactly the correct number of periods and the pandas resampling into the correct and accurately timestamped buckets. But, it's a place to start. I might try to manually extract the 1/2 hour buckets of volume by examining the timestamps... What a chore though. Without doing that however, I just wouldn't trust python/pandas to reliably return the right volume bars.

Thank you so much, Market Tech. What beautiful, clean, sensible code you write ! Exact or not, this creates a healthy-looking, benchmark-beating equity.