Hi there, 

I'm new here and learning how to build strategy with QC while I'm struggling for couple of days when using FundamentalUniverseSelectionModel. Below is a piece of code copying from official documents. Whenever I run backtest with it, i always get below error. I'm sure the select function has been overrided and I've also tried to use Select with upper case. However it sill no go. I hope if someone can give me some guidance of what goes wrong and how to fix it. 

Thank you!

 

Runtime Error: If inheriting, please overrride the 'Select' fundamental function, else provide it as a constructor parameter in FundamentalUniverseSelectionModel.cs:line 203 (Open Stack Trace)

 

class CustomUniverseSelection(FundamentalUniverseSelectionModel):

def __init__(self, universe_count=10, universe_settings=None):

super().__init__(False, universe_settings)

self.universe_count = universe_count

self._selection_data_by_symbol = {}




def select(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:

for f in fundamental:

# Create/Update the EMA indicators of each stock.

if f.symbol not in self._selection_data_by_symbol:

self._selection_data_by_symbol[f.symbol] = self.SelectionData(algorithm, f.symbol, 200)

self._selection_data_by_symbol[f.symbol].update(f.end_time, f.adjusted_price, f.dollar_volume)

# Select the Equities above their EMA and have a daily volume of $1B.

# These assets are in an uptrend and are very liquid.

selected = [x for x in self._selection_data_by_symbol.values() if x.is_above_ema and x.volume > 1_000_000_000]

# Select the 10 most liquid Equities to avoid extra slippage.

return [x.symbol for x in sorted(selected, key=lambda x: x.volume)[-self.universe_count:]]




class SelectionData():

def __init__(self, algorithm: QCAlgorithm, symbol: Symbol, period: int):

self.symbol = symbol

self._ema = ExponentialMovingAverage(period)

self.is_above_ema = False

self.volume = 0

algorithm.warm_up_indicator(symbol, self._ema, Resolution.DAILY)

def update(self, time: datetime, price: float, volume: float) -> None:

self.volume = volume

if self._ema.update(time, price):

self.is_above_ema = price > self._ema.current.value