Hi everyone,

im new to QuantConnet starting from the basic.

im looking to calculate a difference between the momentum indicator of one asset against the other. but i cannot return properly the values from the list.

Thanks in advance 

def __init__(self): #Empty list self.mom = [ ] self.mom = [] def OnSecuritiesChanged(self, algorithm, changes): #15-minute momentum indicator for each symbol for security in changes.AddedSecurities: symbol = security.Symbol self.mom.append({"symbol":symbol, "indicator":algorithm.MOMP(symbol, 30, Resolution.Minute)}) def Update(self, algorithm, data): spread = self.mom[0].xxxxx - self.mom[1].xxxxx

 

Author