I am trying to narrow down securities from my pipeline, but I am running into errors.
def before_trading_start(context, data):
"""
Called every day before market open.
"""
context.output = pipeline_output('my_pipeline')
#get top/bottom of percent dif
context.longs_10 = context.output.sort(['percent_dif'], ascending=False).iloc[:10]
context.shorts_10 = context.output.sort(['percent_dif'], ascending=True).iloc[:10]
#get the top 5 RSI values to long / short
context.longs_5 = context.longs_10(['RSI'], ascending=False).iloc[:5]
context.shorts_5 = context.longs_10(['RSI'], ascending=True).iloc[:5]
# store for later use
context.security_list_longs = context.longs_5.index
context.security_list_shorts = context.shorts_5.index
The error is on the line
context.longs_5 = context.longs_10(['RSI'], ascending=False).iloc[:5]
Does anyone have any ideas?