Hello,
I just started on Quantopian and I can't seem to find the correct function to get price data for different days into a pipeline.
I've tried several things to get the stock prices for the last three days, but the code below for example only gets me the last closing price three times.
Does anyone have a solution for this problem? Many thanks!
# Pipeline definition
def make_pipeline():
universe = QTradableStocksUS()
price_1d = Latest(inputs=[USEquityPricing.close], window_length=1)
price_2d = Latest(inputs=[USEquityPricing.close], window_length=2)
price_3d = Latest(inputs=[USEquityPricing.close], window_length=3)
return Pipeline(
columns={
'price_1d': price_1d,
'price_2d': price_2d,
'price_3d': price_3d
},
# Set screen as the intersection between our filter
# and trading universe
screen=(universe)
)