I'm trying to extend the sample notebook for Zacks Earning Surprise by adding the Open and Close prices following the earning announcement.
The original pipeline (code snippet below) seems to output fine ..
pipe = Pipeline(
columns={
'EPS mean estimate': EarningsSurprises.eps_mean_est.latest,
'asof_date': EarningsSurprises.asof_date.latest,
'Zacks adj': EarningsSurprises.eps_act_zacks_adj.latest,
'eps_act': EarningsSurprises.eps_act.latest,
'act_rpt_code': EarningsSurprises.act_rpt_code.latest,
'eps_cnt_est': EarningsSurprises.eps_cnt_est.latest
},
screen=(top_1000_most_liquid & EarningsSurprises.eps_mean_est.latest.notnan()) # & EarningsSurprises.eps_cnt_est.latest>2.0
)
.. However, I added these columns to the pipe code after, as shown in code below, but it doesn't seem to display the columns i added.
pea_date = EarningsSurprises.asof_date.latest.timedelta(days=1) if (EarningsSurprises.act_rpt_code.latest=='AMC') else EarningsSurprises.asof_date.latest
from quantopian.pipeline.data.builtin import USEquityPricing
pea_close = USEquityPricing.close[pea_date]
pea_open = USEquityPricing.open[pea_date]
pipe.add(pea_date, 'pea_date')
pipe.add(pea_close, 'pea_close')
pipe.add(pea_open, 'pea_open')
.. However, it doesn't print these added columns to the output.
# run_pipeline will show the output of your pipeline
pipe_output = run_pipeline(pipe, start_date='2016-03-01', end_date='2016-03-02')
pipe_output
I'm a newbie to Python Pandas - please advise how to correct my code, so as to include these fields.