I'm stuck on an error when trying to create a momentum indicator as a separate class, which is called from within an alpha model.I'm getting "TypeError : no constructor matches given arguments" for line 72:from datetime import timedelta, datetime from QuantConnect.Data.UniverseSelection import * from QuantConnect.Indicators import * from Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel class TestAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2021, 1, 4) self.SetEndDate(self.StartDate + timedelta(3)) self.SetCash(10000) self.UniverseSettings.Resolution = Resolution.Daily # Note: this determines the resolution of data piped into the alpha model self.UniverseSettings.FillForward = True self.AddUniverseSelection(LiquidUniverseSelection()) self.AddAlpha(MyAlpha()) self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel()) self.SetExecution(ImmediateExecutionModel()) self.SetRiskManagement(MaximumDrawdownPercentPerSecurity(0.02)) class LiquidUniverseSelection(FundamentalUniverseSelectionModel): def __init__(self): super().__init__(False) # Note: set to True if also using SelectFine() self.last_universe_update = datetime(1900, 1, 1) # Parameters self.universe_update_freq_days = 1 self.universe_min_daily_volume = 100000000 self.universe_min_price = 300 def SelectCoarse(self, algo, coarse): if algo.Time < self.last_universe_update + timedelta(self.universe_update_freq_days): return Universe.Unchanged self.last_universe_update = algo.Time # Filter to liquid stocks # Note: the coarse dataset is updated nightly and gives data in daily resolution by default selected = [x.Symbol for x in coarse if x.Price >= self.universe_min_price and x.DollarVolume >= self.universe_min_daily_volume] algo.Log('Universe Updated. Current universe has %d securities.' % len(selected)) return selected class MyAlpha(AlphaModel): def __init__(self): # Parameters self.universe_momentum_period = 3 self.universe_momentum_resolution = Resolution.Daily self.portfolio_size = 10 self.momentum_data = {} def OnSecuritiesChanged(self, algo, changes): # Remove securities from momentum_data once they are dropped from universe for security in changes.RemovedSecurities: self.momentum_data.pop(security, None) def Update(self, algo, data): insights = [] # Sort by momentum for security in algo.ActiveSecurities.Values: symbol = security.Symbol if symbol not in self.momentum_data: history = algo.History(symbol, self.universe_momentum_period, self.universe_momentum_resolution) self.momentum_data[symbol] = MomentumIndicator(history, self.universe_momentum_period) else: self.momentum_data[symbol].Update(algo.Time, security.Close) mom_data_sorted = sorted(self.momentum_data.items(), key=lambda x: x.self.mom).reverse() self.momentum_data = dict(mom_data_sorted) algo.Log('Highest momentum: %s' % str(self.momentum_data[:10])) # Emit a Up insight if symbol is among the top symbols by momentum for security in self.momentum_data[:self.portfolio_size]: insights.append(Insight.Price(security.Symbol, InsightDirection.Up)) return insights class MomentumIndicator(Momentum): def __init__(self, history, period): self.mom = Momentum(period) for bar in history.itertuples(): self.mom.Update(bar.Index[1], bar.close) def IsReady(self): return self.mom.IsReady def Update(self, time, price): self.mom.Update(time, price)