The tutorial has this code to run a pipeline, but I would just like to poke around at what the output columns look like for one ticker and one date, without having to wait the 1m it takes for a pipeline to finish running, something like:
print USEquityPricing.close.latest
but it just returns Latest([EquityPricing.close], 1)
Is there any way to somehow pass in a much smaller data to compute, say one ticker and one date, and see the results immediately? Ideally I would be able to iterate quickly and build out the code I want for make_pipeline
, and then use the pipeline to parallelize fetching data on my ticker universe and dates
Tutorial code:
# Import Pipeline class and datasets
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data import USEquityPricing
from quantopian.pipeline.data.psychsignal import stocktwits
# Import built-in moving average calculation
from quantopian.pipeline.factors import SimpleMovingAverage
# Import built-in trading universe
from quantopian.pipeline.experimental import QTradableStocksUS
# Import run_pipeline method
from quantopian.research import run_pipeline
def make_pipeline():
# Create a reference to our trading universe
base_universe = QTradableStocksUS()
# Get latest closing price
close_price = USEquityPricing.close.latest
# Calculate 3 day average of bull_minus_bear scores
sentiment_score = SimpleMovingAverage(
inputs=[stocktwits.bull_minus_bear],
window_length=3,
)
# Return Pipeline containing close_price and
# sentiment_score that has our trading universe as screen
return Pipeline(
columns={
'close_price': close_price,
'sentiment_score': sentiment_score,
},
screen=base_universe,
)
# Execute pipeline created by make_pipeline
# between start_date and end_date
pipeline_output = run_pipeline(
make_pipeline(),
start_date='2013-12-11',
end_date='2013-12-31'
)
# Display last 10 rows
pipeline_output.tail(10)