Hello,
I'm trying to create a MA over 15m bars and keep receiving the following error:
ValueError: operands could not be broadcast together with shapes (15,) (31,)
USER ALGORITHM:41, in handle_data
if context.MA1 >= context.MA2:
I added the code below. Could someone briefly explain tell me why I'm receiving this error? From what I've read it's related to matrices, but don't see why this function returns different dimensions.
def handle_data(context, data):
context.price = data.current(context.fut,'price')
closes_1 = data.history(context.fut,'price', 15*MA1_Periods*2,'1m')
closes_1_15m = closes_1.resample('15T', label='right').mean
if context.MA1 >= context.MA2:
order(context.fut, 1, style=MarketOrder)