Lean  $LEAN_TAG$
QuantConnect.Securities.OptionFilterUniverse Class Reference

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

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

Public Member Functions

 OptionFilterUniverse (Option.Option option)
 Constructs OptionFilterUniverse More...
 
 OptionFilterUniverse (IEnumerable< Symbol > allSymbols, BaseData underlying, decimal underlyingScaleFactor=1)
 Constructs OptionFilterUniverse More...
 
void Refresh (IEnumerable< Symbol > allSymbols, BaseData underlying, DateTime localTime)
 Refreshes this option filter universe and allows specifying if the exchange date changed from last call More...
 
OptionFilterUniverse Strikes (int minStrike, int maxStrike)
 Applies filter selecting options contracts based on a range of strikes in relative terms More...
 
OptionFilterUniverse CallsOnly ()
 Sets universe of call options (if any) as a selection More...
 
OptionFilterUniverse PutsOnly ()
 Sets universe of put options (if any) as a selection More...
 
- Public Member Functions inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< OptionFilterUniverse >
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

override bool IsStandard (Symbol symbol)
 Determine if the given Option contract symbol is standard More...
 
- Protected Member Functions inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< OptionFilterUniverse >
 ContractSecurityFilterUniverse ()
 Constructs ContractSecurityFilterUniverse More...
 
 ContractSecurityFilterUniverse (IEnumerable< Symbol > allSymbols, DateTime localTime)
 Constructs ContractSecurityFilterUniverse More...
 

Properties

BaseData UnderlyingInternal [get, set]
 The underlying price data More...
 
BaseData Underlying [get]
 The underlying price data More...
 
- Properties inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< OptionFilterUniverse >
DateTime LocalTime [get]
 The local exchange current time More...
 

Additional Inherited Members

- Protected Attributes inherited from QuantConnect.Securities.ContractSecurityFilterUniverse< OptionFilterUniverse >
ContractExpirationType Type
 Expiration Types allowed through the filter Standards only by default More...
 

Detailed Description

Represents options symbols universe used in filtering.

Definition at line 30 of file OptionFilterUniverse.cs.

Constructor & Destructor Documentation

◆ OptionFilterUniverse() [1/2]

QuantConnect.Securities.OptionFilterUniverse.OptionFilterUniverse ( Option.Option  option)

Constructs OptionFilterUniverse

Parameters
optionThe canonical option chain security

Definition at line 58 of file OptionFilterUniverse.cs.

◆ OptionFilterUniverse() [2/2]

QuantConnect.Securities.OptionFilterUniverse.OptionFilterUniverse ( IEnumerable< Symbol allSymbols,
BaseData  underlying,
decimal  underlyingScaleFactor = 1 
)

Constructs OptionFilterUniverse

Used for testing only

Definition at line 67 of file OptionFilterUniverse.cs.

Member Function Documentation

◆ Refresh()

void QuantConnect.Securities.OptionFilterUniverse.Refresh ( IEnumerable< Symbol allSymbols,
BaseData  underlying,
DateTime  localTime 
)

Refreshes this option filter universe and allows specifying if the exchange date changed from last call

Parameters
allSymbolsAll the options contract symbols
underlyingThe current underlying last data point
localTimeThe current local time

Definition at line 81 of file OptionFilterUniverse.cs.

◆ IsStandard()

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

Determine if the given Option contract symbol is standard

Returns
True if standard

Implements QuantConnect.Securities.ContractSecurityFilterUniverse< OptionFilterUniverse >.

Definition at line 94 of file OptionFilterUniverse.cs.

Here is the call graph for this function:

◆ Strikes()

OptionFilterUniverse QuantConnect.Securities.OptionFilterUniverse.Strikes ( int  minStrike,
int  maxStrike 
)

Applies filter selecting options contracts based on a range of strikes in relative terms

Parameters
minStrikeThe minimum strike relative to the underlying price, for example, -1 would filter out contracts further than 1 strike below market price
maxStrikeThe maximum strike relative to the underlying price, for example, +1 would filter out contracts further than 1 strike above market price
Returns
Universe with filter applied

Definition at line 113 of file OptionFilterUniverse.cs.

◆ CallsOnly()

OptionFilterUniverse QuantConnect.Securities.OptionFilterUniverse.CallsOnly ( )

Sets universe of call options (if any) as a selection

Returns
Universe with filter applied

Definition at line 214 of file OptionFilterUniverse.cs.

Here is the call graph for this function:

◆ PutsOnly()

OptionFilterUniverse QuantConnect.Securities.OptionFilterUniverse.PutsOnly ( )

Sets universe of put options (if any) as a selection

Returns
Universe with filter applied

Definition at line 223 of file OptionFilterUniverse.cs.

Here is the call graph for this function:

Property Documentation

◆ UnderlyingInternal

BaseData QuantConnect.Securities.OptionFilterUniverse.UnderlyingInternal
getsetprotected

The underlying price data

Definition at line 41 of file OptionFilterUniverse.cs.

◆ Underlying

BaseData QuantConnect.Securities.OptionFilterUniverse.Underlying
get

The underlying price data

Definition at line 47 of file OptionFilterUniverse.cs.


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