Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
get_pricing for a list of days

Hi,

I am looking to get intra-day data for a list of days so I can look at the distribution. Is there a fast way of doing this? From what see get_pricing only allows you to put in a start and end date. The table below is small sample of the days I want.

2007-08-17 00:00:00+00:00 118.871 119.141 116.289 118.266 294489021.0 118.266 True
2007-08-31 00:00:00+00:00 120.644 121.339 119.974 120.497 151048400.0 120.497 True
2007-10-26 00:00:00+00:00 125.657 126.019 124.705 125.978 138820930.0 125.978 True
2007-11-30 00:00:00+00:00 122.365 122.530 120.953 121.865 187399829.0 121.865 True
2007-12-12 00:00:00+00:00 124.410 124.582 120.847 122.456 238506380.0 122.456 True
2007-12-21 00:00:00+00:00 121.630 122.373 121.399 122.307 111234322.0 122.307 True
2008-01-25 00:00:00+00:00 112.650 112.873 109.440 109.753 227690732.0 109.753 True
2008-02-19 00:00:00+00:00 112.815 112.980 111.098 111.453 127492887.0 111.453 True
2008-03-11 00:00:00+00:00 107.888 109.324 106.426 109.266 265063146.0 109.266 True

1 response

The way to get split adjusted data in a notebook is the get_pricing method. It's fast and returns the same data which would be used in pipeline and backtests. See the documentation https://www.quantopian.com/help#quantopian_research_get_pricing

One can get either daily or minute data by setting the 'frequency' parameter. The start and end dates are actually date-time parameters. Include the minutes if desired. Just be aware that the minutes are in UTC while the market hours are either EDT or EST depending upon the time of year (ie UTC -4 or UTC -5).

So code something like this is what you want

# make a list of the securities one wishes to get pricing for  
my_securities = symbols(['AAPL', 'IBM', 'SPY'])

# set the start and stop date-time.  
# note that times are specified in UTC  
start_date = '2013-01-03-15:00'  
end_date = '2013-01-04-16:00'

# run the get_pricing method to pull in actual data  
# the result is a Pandas dataframe  
my_prices = get_pricing(symbols=my_securities,  
                        start_date=start_date,  
                        end_date=end_date,  
                        frequency='minute',  
                        fields='close_price')

See the attached notebook with this code in action.