I am trying to adapt the EmaCrossAlphaModel to a large universe of futures, using the Algorithm Framework.

the algorithm is initialized by 

class MovingAverageCrossTrendFollowing(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 1, 1) # Set Start Date self.SetStartDate(2019, 3,30) # Set End Date self.SetCash(100000) # Set Strategy Cash self.UniverseSettings.Resolution = Resolution.Daily self.AddAlpha(MovingAverageCrossAlphaModel(50, 200, Resolution.Minute)) self.SetExecution(ImmediateExecutionModel()) self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel()) self.SetUniverseSelection(FuturesUniverseSelectionModel(self.SelectFuturesSymbols)) def SelectFuturesSymbols(self, utcTime): tickers = [Futures.Indices.SP500EMini, #Many more futures Futures.Dairy.NonfatDryMilk] return [ Symbol.Create(ticker, SecurityType.Future, Market.USA) for ticker in tickers]

where 

FuturesUniverseSelectionModel(self.SelectFuturesSymbols)

just filters the futures by expiration date:

class FuturesUniverseSelectionModel(FutureUniverseSelectionModel): def __init__(self, select_future_chain_symbols): super().__init__(timedelta(1), select_future_chain_symbols) def Filter(self, filter): return (filter.Expiration(timedelta(0), timedelta(90)) .OnlyApplyFilterAtMarketOpen())

The Update method in MovingAverageCrossAlphaMode starts with a selection of the contract with the highest open interest per chain:

def Update(self, algorithm, data): for chain in data.FutureChains: #1. Filter to choose popular contracts with OpenInterest > 1000 popularContracts = [contract for contract in chain.Value if contract.OpenInterest>1000] #2. If the length of contracts in this chain is zero, continue to the next chain if len(popularContracts) is 0: continue #3. Sort our contracts by open interest in descending order and save to sortedByOIContracts sortedByOIContracts = sorted(popularContracts, key=lambda k : k.OpenInterest, reverse=True) #4. Save the contract with the highest open interest to self.liquidContract liquidContract = sortedByOIContracts[0] #5. Generate insights based on EMA crossings return insights

As the attached backtest shows, however, the Update method is never called, despite the initialization

self.UniverseSettings.Resolution = Resolution.Daily

What is the problem, here? 

Author