Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to use USEquityPricing

Hi guys,

I am kind of new to Quantopian, do you guys know what's wrong with this line of code?

test_price = data.history(USEquityPricing,'price',context.lookback/2,'1d').dropna(axis=1)

2 responses

@Jihong

You need to pass the 'history' method either a single security or a list of securities which you want to get prices for. 'USEquityPricing' is not a list of securities. You should do something like this:

my_securities = symbol('IBM')  
test_price = data.history(my_securities, 'price', context.lookback/2, '1d').dropna(axis=1)

Take a look at the documentation https://www.quantopian.com/help#api-data-history

@Dan

Thank you Dan. I know how history function works. I am just wondering if I could us USEquityPricing to get a list of securities because I want to get all the stock prices in the database. And I don't want to use pipeline because I have already created one. Quantopian doesn't support multiple pipeline.

I just wondering how can I use USEquityPricing in history function because according to quantopian, https://www.quantopian.com/data/quantopian/us_equity_pricing
It can be used through the data object besides pipeline.

Thank you Dan