I'm getting an error trying to get the difference in values from eroclatest. Anyone know what's the issue?
I think it's coming from erocspread
def make_pipeline():
eroclatest = roc.eroc.latest
eezlatest = roc.eez.latest
erocspread = eroclatest.iloc[[0, -5]]
factor_to_analyze = (current_assets - diff)
sector = Sector()
return Pipeline(
columns = {'eroclatest': eroclatest, 'eezlatest': eezlatest, 'erocspread': erocspread, 'sector': sector, },
screen = QTradableStocksUS() & erocspread.notnull() & sector.notnull()
)
factor_data = run_pipeline(make_pipeline(), '2015-1-1', '2016-1-1')
pricing_data = get_pricing(factor_data.index.levels[1], '2015-1-1', '2016-6-1', fields='open_price')