I am having an issue comparing prices of crypto currencies in quant connect, I am getting the error message TypeError : '>' not supported between instances of 'NoneType' and 'NoneType' (Open Stacktrace)
, but the variables do have values, I am confused as to why they are 'NoneType'. For those unfamiliar with Quant Connect self.Debug is equivalent to print.
week = self.sma_dict.get(cryp, {}).get('week_mavg')
mavg = self.sma_dict.get(cryp, {}).get('mavg')
trois = self.sma_dict.get(cryp, {}).get('trois_mavg')
self.Debug(week)
self.Debug(mavg)
self.Debug(trois)
if week > mavg and trois < week and y > trois and cryp not in self.Portfolio.Invested:
I've also tried:
week = self.sma_dict.get(cryp, {}).get('week_mavg', float)
mavg = self.sma_dict.get(cryp, {}).get('mavg', float)
trois = self.sma_dict.get(cryp, {}).get('trois_mavg', float)
self.Debug(week)
self.Debug(mavg)
self.Debug(trois)
if week > mavg and trois < week and y > trois and cryp not in self.Portfolio.Invested:
But I then get the error message TypeError : '>' not supported between instances of 'Type' and 'Type' (Open Stacktrace)
This could very well be a Quant Connect issue, but any suggestions would be appreciated. Thanks, Jack.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…