I am trying to create a universe which filters by relative volume, and I'm using a class - SelectionData - to hold the SMA's for daily volume. However, I run into the error, "no constructor matches given arguments" on the line which instatiates the class -> self.universeAvgVol[symbol] = SelectionData(symbol, 60).

 

class RelativeVolumeUniverseSelector(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 1, 1) self.SetEndDate(2021, 1, 1) self.SetCash(100000) # relative volume universe selection. self.UniverseSettings.Resolution = Resolution.Minute self.AddUniverse(self.CoarseSelectionFunction) self.universeAvgVol = { } self.symbols = list() def CoarseSelectionFunction(self, universe): # calculate the 60-day average volume, then compare with premarket volume to get Relative Volume selected = [] for coarse in universe: symbol = coarse.Symbol # create list of all symbols with 60 day volume sma if symbol not in self.universeAvgVol: self.universeAvgVol[symbol] = SelectionData(symbol, 60) history = self.History(symbol, 60, Resolution.Daily) self.universeAvgVol[symbol].warmUp(history) # update symbol volume sma daily sd = self.univerAvgVol[symbol] sd.update(self.Time, coarse.Volume) if sd.is_ready(): selected.append(symbol) selected.sort(key=lambda x: x.relativeVolume, reverse=True) self.symbols = selected[:10] return self.symbols class SelectionData(object): def __init__(self, symbol, period): self.symbol = symbol self.sma = SimpleMovingAverage(period, Resolution.Daily) self.premarketVolume = 0 self.relativeVolume = 1 def is_ready(self): return self.sma.IsReady def update(self, time, volume): self.sma.Update(time, volume) if self.sma.Current.Value != 0: self.relativeVolume = self.premarketVolume / self.sma.Current.Value def warmUp(self, history): for bar in history.itertuples(): self.sma.Update(bar.Index[1], bar.volume)