I'm using the Algorithm Framework. I've seen examples of filtering using coarse and fine filters, they seem to be geared toward Stocks. Haven't seen many examples for futures, I thought the OpenInterestFutureUniverseSelectionModel.py would be a good frame of reference however there's an ongoing issue with the class.

Suppose I wanted to create a Futures universe with let's say 10 different futures symbols. Then rank the 10 symbols based on volatility and send the highest vol symbol to the Alpha model.

How would one go about writing this functionality?

 

from AlgorithmImports import *

from Alphas.ConstantAlphaModel import ConstantAlphaModel
from Selection.FutureUniverseSelectionModel import FutureUniverseSelectionModel
from BreakoutHurstAlpha import BreakoutHurstAlpha

### <summary>
### Basic template futures framework algorithm uses framework components
### to define an algorithm that trades futures.
### </summary>
class BasicTemplateFuturesFrameworkAlgorithm(QCAlgorithm):

    def Initialize(self):

        self.UniverseSettings.Resolution = Resolution.Minute
        self.UniverseSettings.DataNormalizationMode =  DataNormalizationMode.BackwardsRatio
        self.UniverseSettings.DataMappingMode = DataMappingMode.LastTradingDay
       

        # System config dates
        self.SetStartDate(2012, 10, 1)
        self.SetEndDate(2014, 10, 1)
        self.SetCash(100000)

        # Universe Model 
        self.SetUniverseSelection(MyFutureUniverseSelectionModel(self.future_chain_symbol_selector))

        
        # Alpha Model
        self.SetAlpha(EmaCrossAlphaModel())

        # Portfolio Model
        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())

        # Risk Model
        self.SetRiskManagement(TrailingStopRiskManagementModel())

        # Execution model
        self.SetExecution(ImmediateExecutionModel())

        

    def future_chain_symbol_selector(self, utc_time: datetime) -> List[Symbol]:
        return [ Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME),
			Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.Comex),
			Symbol.Create(Futures.Energies.CrudeOilWTI, SecurityType.Future, Market.NYMEX)]        


class MyFutureUniverseSelectionModel(FutureUniverseSelectionModel):
    
    def __init__(self, select_future_chain_symbols):
        super().__init__(timedelta(1), select_future_chain_symbols)

    def Filter(self, filter):
		# Filter Symbols here?
        return (filter.FrontMonth().OnlyApplyFilterAtMarketOpen())