I keep getting this error and i have no idea how to fix it . KeyError: 'longs' There was a runtime error on line 63.
Here is the code
def my_rebalance(context,data):
long_secs = context.output[context.output['longs']].index
long_weight = 0.65 / len(long_secs)
short_secs = context.output[context.output['shorts']].index
short_weight = -0.35 / len(short_secs)
it only pulls this error for the 'longs' part but not for the 'shorts' part just below it which is pretty much the same.