Lean  $LEAN_TAG$
QuantConnect.Securities.ContractSecurityFilterUniverse< T > Class Template Referenceabstract

Base class for contract symbols filtering universes. Used by OptionFilterUniverse and FutureFilterUniverse More...

Inheritance diagram for QuantConnect.Securities.ContractSecurityFilterUniverse< T >:
[legend]

Public Member Functions

virtual void Refresh (IEnumerable< Symbol > allSymbols, 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 (Func< IEnumerable< Symbol >, 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...
 
OnlyApplyFilterAtMarketOpen ()
 Instructs the engine to only filter contracts on the first time step of each market day. More...
 
IEnumerator< SymbolGetEnumerator ()
 IEnumerable interface method implementation More...
 

Protected Member Functions

 ContractSecurityFilterUniverse ()
 Constructs ContractSecurityFilterUniverse More...
 
 ContractSecurityFilterUniverse (IEnumerable< Symbol > allSymbols, DateTime localTime)
 Constructs ContractSecurityFilterUniverse More...
 
abstract bool IsStandard (Symbol symbol)
 Function to determine if the given symbol is a standard contract More...
 

Protected Attributes

ContractExpirationType Type = ContractExpirationType.Standard
 Expiration Types allowed through the filter Standards only by default More...
 

Properties

DateTime LocalTime [get]
 The local exchange current time More...
 

Detailed Description

Base class for contract symbols filtering universes. Used by OptionFilterUniverse and FutureFilterUniverse

Type Constraints
T :ContractSecurityFilterUniverse<T> 

Definition at line 29 of file ContractSecurityFilterUniverse.cs.

Constructor & Destructor Documentation

◆ ContractSecurityFilterUniverse() [1/2]

Constructs ContractSecurityFilterUniverse

Definition at line 69 of file ContractSecurityFilterUniverse.cs.

◆ ContractSecurityFilterUniverse() [2/2]

QuantConnect.Securities.ContractSecurityFilterUniverse< T >.ContractSecurityFilterUniverse ( IEnumerable< Symbol allSymbols,
DateTime  localTime 
)
protected

Constructs ContractSecurityFilterUniverse

Definition at line 76 of file ContractSecurityFilterUniverse.cs.

Member Function Documentation

◆ IsStandard()

abstract bool QuantConnect.Securities.ContractSecurityFilterUniverse< T >.IsStandard ( Symbol  symbol)
protectedpure virtual

Function to determine if the given symbol is a standard contract

Returns
True if standard type

Implemented in QuantConnect.Securities.OptionFilterUniverse, and QuantConnect.Securities.FutureFilterUniverse.

◆ Refresh()

virtual void QuantConnect.Securities.ContractSecurityFilterUniverse< T >.Refresh ( IEnumerable< Symbol allSymbols,
DateTime  localTime 
)
virtual

Refreshes this filter universe

Parameters
allSymbolsAll the contract symbols for the Universe
localTimeThe local exchange current time

Definition at line 134 of file ContractSecurityFilterUniverse.cs.

◆ StandardsOnly()

Sets universe of standard contracts (if any) as selection Contracts by default are standards; only needed to switch back if changed

Returns
Universe with filter applied

Definition at line 146 of file ContractSecurityFilterUniverse.cs.

◆ IncludeWeeklys()

Includes universe of non-standard weeklys contracts (if any) into selection

Returns
Universe with filter applied

Definition at line 156 of file ContractSecurityFilterUniverse.cs.

◆ WeeklysOnly()

Sets universe of weeklys contracts (if any) as selection

Returns
Universe with filter applied

Definition at line 166 of file ContractSecurityFilterUniverse.cs.

◆ FrontMonth()

virtual T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.FrontMonth ( )
virtual

Returns front month contract

Returns
Universe with filter applied

Definition at line 176 of file ContractSecurityFilterUniverse.cs.

◆ BackMonths()

virtual T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.BackMonths ( )
virtual

Returns a list of back month contracts

Returns
Universe with filter applied

Definition at line 190 of file ContractSecurityFilterUniverse.cs.

Here is the caller graph for this function:

◆ BackMonth()

Returns first of back month contracts

Returns
Universe with filter applied

Definition at line 204 of file ContractSecurityFilterUniverse.cs.

◆ Expiration() [1/2]

virtual T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.Expiration ( TimeSpan  minExpiry,
TimeSpan  maxExpiry 
)
virtual

Applies filter selecting options contracts based on a range of expiration dates relative to the current day

Parameters
minExpiryThe minimum time until expiry to include, for example, TimeSpan.FromDays(10) would exclude contracts expiring in less than 10 days
maxExpiryThe maximum time until expiry to include, for example, TimeSpan.FromDays(10) would exclude contracts expiring in more than 10 days
Returns
Universe with filter applied

Definition at line 217 of file ContractSecurityFilterUniverse.cs.

Here is the caller graph for this function:

◆ Expiration() [2/2]

T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.Expiration ( int  minExpiryDays,
int  maxExpiryDays 
)

Applies filter selecting contracts based on a range of expiration dates relative to the current day

Parameters
minExpiryDaysThe minimum time, expressed in days, until expiry to include, for example, 10 would exclude contracts expiring in less than 10 days
maxExpiryDaysThe maximum time, expressed in days, until expiry to include, for example, 10 would exclude contracts expiring in more than 10 days
Returns
Universe with filter applied

Definition at line 244 of file ContractSecurityFilterUniverse.cs.

◆ Contracts() [1/3]

T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.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.

Parameters
contractsThe option contract symbol objects to select
Returns
Universe with filter applied

Definition at line 255 of file ContractSecurityFilterUniverse.cs.

Here is the caller graph for this function:

◆ Contracts() [2/3]

T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.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.

Parameters
contractsThe option contract symbol objects to select
Returns
Universe with filter applied

Definition at line 267 of file ContractSecurityFilterUniverse.cs.

◆ Contracts() [3/3]

T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.Contracts ( Func< IEnumerable< Symbol >, 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.

Parameters
contractSelectorThe option contract symbol objects to select
Returns
Universe with filter applied

Definition at line 279 of file ContractSecurityFilterUniverse.cs.

◆ OnlyApplyFilterAtMarketOpen()

T QuantConnect.Securities.ContractSecurityFilterUniverse< T >.OnlyApplyFilterAtMarketOpen ( )

Instructs the engine to only filter contracts on the first time step of each market day.

Returns
Universe with filter applied

Deprecated since filters are always non-dynamic now

Definition at line 292 of file ContractSecurityFilterUniverse.cs.

◆ GetEnumerator()

IEnumerable interface method implementation

Returns
IEnumerator of Symbols in Universe

Definition at line 301 of file ContractSecurityFilterUniverse.cs.

Member Data Documentation

◆ Type

ContractExpirationType QuantConnect.Securities.ContractSecurityFilterUniverse< T >.Type = ContractExpirationType.Standard
protected

Expiration Types allowed through the filter Standards only by default

Definition at line 53 of file ContractSecurityFilterUniverse.cs.

Property Documentation

◆ LocalTime

The local exchange current time

Definition at line 58 of file ContractSecurityFilterUniverse.cs.


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