Lean  $LEAN_TAG$
QuantConnect.Indicators.OptionIndicatorBase Class Referenceabstract

To provide a base class for option indicator More...

Inheritance diagram for QuantConnect.Indicators.OptionIndicatorBase:
[legend]

Public Member Functions

override void Reset ()
 Resets this indicator and all sub-indicators More...
 

Static Public Member Functions

static OptionPricingModelType GetOptionModel (OptionPricingModelType? optionModel, OptionStyle optionStyle)
 Gets the option pricing model based on the option style, if not specified More...
 

Public Attributes

DateTime Expiry => OptionSymbol.ID.Date
 Gets the expiration time of the option More...
 
OptionRight Right => OptionSymbol.ID.OptionRight
 Gets the option right (call/put) of the option More...
 
decimal Strike => OptionSymbol.ID.StrikePrice
 Gets the strike price of the option More...
 
OptionStyle Style => OptionSymbol.ID.OptionStyle
 Gets the option style (European/American) of the option More...
 
bool UseMirrorContract => _oppositeOptionSymbol != null
 Flag if mirror option is implemented for parity type calculation More...
 

Protected Member Functions

 OptionIndicatorBase (string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption=null, OptionPricingModelType? optionModel=null, int period=2)
 Initializes a new instance of the OptionIndicatorBase class More...
 
override decimal ComputeNextValue (IndicatorDataPoint input)
 Computes the next value of this indicator from the given state. This will round the result to 7 decimal places. More...
 
abstract decimal Calculate (IndicatorDataPoint input)
 Computes the next value of this indicator from the given state. More...
 

Protected Attributes

Symbol _underlyingSymbol => OptionSymbol.Underlying
 Underlying security's symbol object More...
 

Properties

Symbol OptionSymbol [get]
 Option's symbol object More...
 
Symbol _oppositeOptionSymbol [get]
 Mirror option symbol (by option right), for implied volatility More...
 
OptionPricingModelType _optionModel [get, set]
 Option pricing model used to calculate indicator More...
 
IRiskFreeInterestRateModel _riskFreeInterestRateModel [get]
 Risk-free rate model More...
 
IDividendYieldModel _dividendYieldModel [get]
 Dividend yield model, for continuous dividend yield More...
 
Identity RiskFreeRate [get, set]
 Risk Free Rate More...
 
Identity DividendYield [get, set]
 Dividend Yield More...
 
IndicatorBase< IndicatorDataPointPrice [get]
 Gets the option price level More...
 
IndicatorBase< IndicatorDataPointOppositePrice [get]
 Gets the mirror option price level, for implied volatility More...
 
IndicatorBase< IndicatorDataPointUnderlyingPrice [get]
 Gets the underlying's price level More...
 
int WarmUpPeriod [get, set]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 
- Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider
int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Detailed Description

To provide a base class for option indicator

Definition at line 24 of file OptionIndicatorBase.cs.

Constructor & Destructor Documentation

◆ OptionIndicatorBase()

QuantConnect.Indicators.OptionIndicatorBase.OptionIndicatorBase ( string  name,
Symbol  option,
IRiskFreeInterestRateModel  riskFreeRateModel,
IDividendYieldModel  dividendYieldModel,
Symbol  mirrorOption = null,
OptionPricingModelType optionModel = null,
int  period = 2 
)
protected

Initializes a new instance of the OptionIndicatorBase class

Parameters
nameThe name of this indicator
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldModelDividend yield model
mirrorOptionThe mirror option for parity calculation
periodThe lookback period of volatility
optionModelThe option pricing model used to estimate the Greek/IV

Definition at line 116 of file OptionIndicatorBase.cs.

Here is the call graph for this function:

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.OptionIndicatorBase.ComputeNextValue ( IndicatorDataPoint  input)
protected

Computes the next value of this indicator from the given state. This will round the result to 7 decimal places.

Parameters
inputThe input given to the indicator
Returns
A new value for this indicator

Definition at line 156 of file OptionIndicatorBase.cs.

Here is the call graph for this function:

◆ Calculate()

abstract decimal QuantConnect.Indicators.OptionIndicatorBase.Calculate ( IndicatorDataPoint  input)
protectedpure virtual

Computes the next value of this indicator from the given state.

Parameters
inputThe input given to the indicator
Returns
A new value for this indicator

Implemented in QuantConnect.Indicators.ImpliedVolatility, and QuantConnect.Indicators.OptionGreeksIndicatorBase.

Here is the caller graph for this function:

◆ Reset()

override void QuantConnect.Indicators.OptionIndicatorBase.Reset ( )

Resets this indicator and all sub-indicators

Definition at line 171 of file OptionIndicatorBase.cs.

Here is the caller graph for this function:

◆ GetOptionModel()

static OptionPricingModelType QuantConnect.Indicators.OptionIndicatorBase.GetOptionModel ( OptionPricingModelType optionModel,
OptionStyle  optionStyle 
)
static

Gets the option pricing model based on the option style, if not specified

Parameters
optionModelThe optional option pricing model, which will be returned if not null
optionStyleThe option style
Returns
The option pricing model based on the option style, if not specified

Definition at line 191 of file OptionIndicatorBase.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ _underlyingSymbol

Symbol QuantConnect.Indicators.OptionIndicatorBase._underlyingSymbol => OptionSymbol.Underlying
protected

Underlying security's symbol object

Definition at line 39 of file OptionIndicatorBase.cs.

◆ Expiry

DateTime QuantConnect.Indicators.OptionIndicatorBase.Expiry => OptionSymbol.ID.Date

Gets the expiration time of the option

Definition at line 59 of file OptionIndicatorBase.cs.

◆ Right

OptionRight QuantConnect.Indicators.OptionIndicatorBase.Right => OptionSymbol.ID.OptionRight

Gets the option right (call/put) of the option

Definition at line 64 of file OptionIndicatorBase.cs.

◆ Strike

decimal QuantConnect.Indicators.OptionIndicatorBase.Strike => OptionSymbol.ID.StrikePrice

Gets the strike price of the option

Definition at line 69 of file OptionIndicatorBase.cs.

◆ Style

OptionStyle QuantConnect.Indicators.OptionIndicatorBase.Style => OptionSymbol.ID.OptionStyle

Gets the option style (European/American) of the option

Definition at line 74 of file OptionIndicatorBase.cs.

◆ UseMirrorContract

bool QuantConnect.Indicators.OptionIndicatorBase.UseMirrorContract => _oppositeOptionSymbol != null

Flag if mirror option is implemented for parity type calculation

Definition at line 104 of file OptionIndicatorBase.cs.

Property Documentation

◆ OptionSymbol

Symbol QuantConnect.Indicators.OptionIndicatorBase.OptionSymbol
get

Option's symbol object

Definition at line 29 of file OptionIndicatorBase.cs.

◆ _oppositeOptionSymbol

Symbol QuantConnect.Indicators.OptionIndicatorBase._oppositeOptionSymbol
getprotected

Mirror option symbol (by option right), for implied volatility

Definition at line 34 of file OptionIndicatorBase.cs.

◆ _optionModel

OptionPricingModelType QuantConnect.Indicators.OptionIndicatorBase._optionModel
getsetprotected

Option pricing model used to calculate indicator

Definition at line 44 of file OptionIndicatorBase.cs.

◆ _riskFreeInterestRateModel

IRiskFreeInterestRateModel QuantConnect.Indicators.OptionIndicatorBase._riskFreeInterestRateModel
getprotected

Risk-free rate model

Definition at line 49 of file OptionIndicatorBase.cs.

◆ _dividendYieldModel

IDividendYieldModel QuantConnect.Indicators.OptionIndicatorBase._dividendYieldModel
getprotected

Dividend yield model, for continuous dividend yield

Definition at line 54 of file OptionIndicatorBase.cs.

◆ RiskFreeRate

Identity QuantConnect.Indicators.OptionIndicatorBase.RiskFreeRate
getset

Risk Free Rate

Definition at line 79 of file OptionIndicatorBase.cs.

◆ DividendYield

Identity QuantConnect.Indicators.OptionIndicatorBase.DividendYield
getset

Dividend Yield

Definition at line 84 of file OptionIndicatorBase.cs.

◆ Price

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.OptionIndicatorBase.Price
get

Gets the option price level

Definition at line 89 of file OptionIndicatorBase.cs.

◆ OppositePrice

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.OptionIndicatorBase.OppositePrice
get

Gets the mirror option price level, for implied volatility

Definition at line 94 of file OptionIndicatorBase.cs.

◆ UnderlyingPrice

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.OptionIndicatorBase.UnderlyingPrice
get

Gets the underlying's price level

Definition at line 99 of file OptionIndicatorBase.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.OptionIndicatorBase.WarmUpPeriod
getset

Required period, in data points, for the indicator to be ready and fully initialized.

Definition at line 148 of file OptionIndicatorBase.cs.


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