Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
average daily volume

How do I get daily volume for a security on a particular day? I seem to be unable to find it in the docs? Same goes for other trading measures...

2 responses

Hello Igor,

It's kinda buried in the documentation for the history() API. See https://www.quantopian.com/help#ide-history:

The returned data for daily history, for each day, is:

open_price: the open of the first minute bar of the given day.  
high: the maximum of the minute highs for the given day.  
low: the minimum of the minute bar lows for the given day.  
close_price: the close of the last minute bar in the specified period. This value is not forward-filled. If there is no price in the bar, the returned price is NaN.  
price: the close of the last minute bar as of the specified period. This value is forward-filled. If there is no price in the bar, the returned price is the previous price, until there is new trade data available.  
volume: the sum of all minute volumes. For the current day, the sum of volume thus far.  

The data comes in a handy Pandas DataFrame, which you can then slice and dice to your heart's content.

After checking out the help page, if you are still stuck, just post again with questions.

Grant

Hi Grant, I follow the code on https://www.quantopian.com/tutorials/getting-started#lesson6 and try to get daily price and volume.
However, when I use '1d' in my code, it still gives me the minute data.
Can you help me with that ?
Thanks very much.