Lean  $LEAN_TAG$
All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
QuantConnect.Securities.FutureFilterUniverse Class Reference

Represents futures symbols universe used in filtering. More...

Inheritance diagram for QuantConnect.Securities.FutureFilterUniverse:
[legend]

Public Member Functions

 FutureFilterUniverse (IEnumerable< Symbol > allSymbols, DateTime localTime)
 Constructs FutureFilterUniverse More...
 
FutureFilterUniverse ExpirationCycle (int[] months)
 Applies filter selecting futures contracts based on expiration cycles. See FutureExpirationCycles for details More...
 
- Public Member Functions inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< FutureFilterUniverse, Symbol >
virtual void Refresh (IEnumerable< TData > allData, DateTime localTime)
 Refreshes this filter universe More...
 
StandardsOnly ()
 Sets universe of standard contracts (if any) as selection Contracts by default are standards; only needed to switch back if changed More...
 
IncludeWeeklys ()
 Includes universe of non-standard weeklys contracts (if any) into selection More...
 
WeeklysOnly ()
 Sets universe of weeklys contracts (if any) as selection More...
 
virtual T FrontMonth ()
 Returns front month contract More...
 
virtual T BackMonths ()
 Returns a list of back month contracts More...
 
BackMonth ()
 Returns first of back month contracts More...
 
virtual T Expiration (TimeSpan minExpiry, TimeSpan maxExpiry)
 Applies filter selecting options contracts based on a range of expiration dates relative to the current day More...
 
Expiration (int minExpiryDays, int maxExpiryDays)
 Applies filter selecting contracts based on a range of expiration dates relative to the current day More...
 
Contracts (PyObject contracts)
 Explicitly sets the selected contract symbols for this universe. This overrides and and all other methods of selecting symbols assuming it is called last. More...
 
Contracts (IEnumerable< Symbol > contracts)
 Explicitly sets the selected contract symbols for this universe. This overrides and and all other methods of selecting symbols assuming it is called last. More...
 
Contracts (IEnumerable< TData > contracts)
 Explicitly sets the selected contract symbols for this universe. This overrides and and all other methods of selecting symbols assuming it is called last. More...
 
Contracts (Func< IEnumerable< TData >, IEnumerable< Symbol >> contractSelector)
 Sets a function used to filter the set of available contract filters. The input to the 'contractSelector' function will be the already filtered list if any other filters have already been applied. More...
 
Contracts (Func< IEnumerable< TData >, IEnumerable< TData >> contractSelector)
 Sets a function used to filter the set of available contract filters. The input to the 'contractSelector' function will be the already filtered list if any other filters have already been applied. More...
 
OnlyApplyFilterAtMarketOpen ()
 Instructs the engine to only filter contracts on the first time step of each market day. More...
 
IEnumerator< TData > GetEnumerator ()
 IEnumerable interface method implementation More...
 

Protected Member Functions

override bool IsStandard (Symbol symbol)
 Determine if the given Future contract symbol is standard More...
 
override Symbol GetSymbol (Symbol data)
 Gets the symbol from the data More...
 
override Symbol CreateDataInstance (Symbol symbol)
 Creates a new instance of the data type for the given symbol More...
 
- Protected Member Functions inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< FutureFilterUniverse, Symbol >
 ContractSecurityFilterUniverse ()
 Constructs ContractSecurityFilterUniverse More...
 
 ContractSecurityFilterUniverse (IEnumerable< TData > allData, DateTime localTime)
 Constructs ContractSecurityFilterUniverse More...
 
abstract Symbol GetSymbol (TData data)
 Gets the symbol from the data More...
 
virtual DateTime AdjustExpirationReferenceDate (DateTime referenceDate)
 Adjust the reference date used for expiration filtering. By default it just returns the same date. More...
 

Additional Inherited Members

- Properties inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< FutureFilterUniverse, Symbol >
ContractExpirationType Type [get, set]
 Expiration Types allowed through the filter Standards only by default More...
 
DateTime LocalTime [get]
 The local exchange current time More...
 

Detailed Description

Represents futures symbols universe used in filtering.

Definition at line 28 of file FutureFilterUniverse.cs.

Constructor & Destructor Documentation

◆ FutureFilterUniverse()

QuantConnect.Securities.FutureFilterUniverse.FutureFilterUniverse ( IEnumerable< Symbol allSymbols,
DateTime  localTime 
)

Constructs FutureFilterUniverse

Definition at line 33 of file FutureFilterUniverse.cs.

Member Function Documentation

◆ IsStandard()

override bool QuantConnect.Securities.FutureFilterUniverse.IsStandard ( Symbol  symbol)
protectedvirtual

Determine if the given Future contract symbol is standard

Returns
True if contract is standard

Implements QuantConnect.Securities.ContractSecurityFilterUniverse< FutureFilterUniverse, Symbol >.

Definition at line 42 of file FutureFilterUniverse.cs.

Here is the call graph for this function:

◆ GetSymbol()

override Symbol QuantConnect.Securities.FutureFilterUniverse.GetSymbol ( Symbol  data)
protected

Gets the symbol from the data

Returns
The symbol that represents the datum

Definition at line 51 of file FutureFilterUniverse.cs.

◆ CreateDataInstance()

override Symbol QuantConnect.Securities.FutureFilterUniverse.CreateDataInstance ( Symbol  symbol)
protectedvirtual

Creates a new instance of the data type for the given symbol

Returns
A data instance for the given symbol, which is just the symbol itself

Implements QuantConnect.Securities.ContractSecurityFilterUniverse< FutureFilterUniverse, Symbol >.

Definition at line 60 of file FutureFilterUniverse.cs.

◆ ExpirationCycle()

FutureFilterUniverse QuantConnect.Securities.FutureFilterUniverse.ExpirationCycle ( int[]  months)

Applies filter selecting futures contracts based on expiration cycles. See FutureExpirationCycles for details

Parameters
monthsMonths to select contracts from
Returns
Universe with filter applied

Definition at line 70 of file FutureFilterUniverse.cs.


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