Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Selection.OpenInterestFutureUniverseSelectionModel Class Reference

Selects contracts in a futures universe, sorted by open interest. This allows the selection to identifiy current active contract. More...

Inheritance diagram for QuantConnect.Algorithm.Framework.Selection.OpenInterestFutureUniverseSelectionModel:
[legend]

Public Member Functions

 OpenInterestFutureUniverseSelectionModel (IAlgorithm algorithm, Func< DateTime, IEnumerable< Symbol >> futureChainSymbolSelector, int? chainContractsLookupLimit=6, int? resultsLimit=1)
 Creates a new instance of OpenInterestFutureUniverseSelectionModel More...
 
 OpenInterestFutureUniverseSelectionModel (IAlgorithm algorithm, PyObject futureChainSymbolSelector, int? chainContractsLookupLimit=6, int? resultsLimit=1)
 Creates a new instance of OpenInterestFutureUniverseSelectionModel More...
 
IEnumerable< SymbolFilterByOpenInterest (IReadOnlyDictionary< Symbol, MarketHoursDatabase.Entry > contracts)
 Filters a set of contracts based on open interest. More...
 
- Public Member Functions inherited from QuantConnect.Algorithm.Framework.Selection.FutureUniverseSelectionModel
override DateTime GetNextRefreshTimeUtc ()
 Gets the next time the framework should invoke the CreateUniverses method to refresh the set of universes. More...
 
 FutureUniverseSelectionModel (TimeSpan refreshInterval, Func< DateTime, IEnumerable< Symbol >> futureChainSymbolSelector)
 Creates a new instance of FutureUniverseSelectionModel More...
 
 FutureUniverseSelectionModel (TimeSpan refreshInterval, Func< DateTime, IEnumerable< Symbol >> futureChainSymbolSelector, UniverseSettings universeSettings)
 Creates a new instance of FutureUniverseSelectionModel More...
 
override IEnumerable< UniverseCreateUniverses (QCAlgorithm algorithm)
 Creates the universes for this algorithm. Called once after IAlgorithm.Initialize More...
 

Protected Member Functions

override FutureFilterUniverse Filter (FutureFilterUniverse filter)
 Defines the future chain universe filter More...
 

Detailed Description

Selects contracts in a futures universe, sorted by open interest. This allows the selection to identifiy current active contract.

Definition at line 32 of file OpenInterestFutureUniverseSelectionModel.cs.

Constructor & Destructor Documentation

◆ OpenInterestFutureUniverseSelectionModel() [1/2]

QuantConnect.Algorithm.Framework.Selection.OpenInterestFutureUniverseSelectionModel.OpenInterestFutureUniverseSelectionModel ( IAlgorithm  algorithm,
Func< DateTime, IEnumerable< Symbol >>  futureChainSymbolSelector,
int?  chainContractsLookupLimit = 6,
int?  resultsLimit = 1 
)

Creates a new instance of OpenInterestFutureUniverseSelectionModel

Parameters
algorithmAlgorithm
futureChainSymbolSelectorSelects symbols from the provided future chain
chainContractsLookupLimitLimit on how many contracts to query for open interest
resultsLimitLimit on how many contracts will be part of the universe

Definition at line 46 of file OpenInterestFutureUniverseSelectionModel.cs.

Here is the call graph for this function:

◆ OpenInterestFutureUniverseSelectionModel() [2/2]

QuantConnect.Algorithm.Framework.Selection.OpenInterestFutureUniverseSelectionModel.OpenInterestFutureUniverseSelectionModel ( IAlgorithm  algorithm,
PyObject  futureChainSymbolSelector,
int?  chainContractsLookupLimit = 6,
int?  resultsLimit = 1 
)

Creates a new instance of OpenInterestFutureUniverseSelectionModel

Parameters
algorithmAlgorithm
futureChainSymbolSelectorSelects symbols from the provided future chain
chainContractsLookupLimitLimit on how many contracts to query for open interest
resultsLimitLimit on how many contracts will be part of the universe

Definition at line 67 of file OpenInterestFutureUniverseSelectionModel.cs.

Member Function Documentation

◆ Filter()

override FutureFilterUniverse QuantConnect.Algorithm.Framework.Selection.OpenInterestFutureUniverseSelectionModel.Filter ( FutureFilterUniverse  filter)
protectedvirtual

Defines the future chain universe filter

Reimplemented from QuantConnect.Algorithm.Framework.Selection.FutureUniverseSelectionModel.

Definition at line 75 of file OpenInterestFutureUniverseSelectionModel.cs.

Here is the call graph for this function:

◆ FilterByOpenInterest()

IEnumerable<Symbol> QuantConnect.Algorithm.Framework.Selection.OpenInterestFutureUniverseSelectionModel.FilterByOpenInterest ( IReadOnlyDictionary< Symbol, MarketHoursDatabase.Entry contracts)

Filters a set of contracts based on open interest.

Parameters
contractsContracts to filter
Returns
Filtered set

Definition at line 85 of file OpenInterestFutureUniverseSelectionModel.cs.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: