Lean  $LEAN_TAG$
QuantConnect.Indicators.ImpliedVolatility Class Reference

Implied Volatility indicator that calculate the IV of an option using Black-Scholes Model More...

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

Public Member Functions

 ImpliedVolatility (string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield=0.0m, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield=0.0m, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield=0.0m, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (Symbol option, PyObject riskFreeRateModel, decimal dividendYield=0.0m, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (string name, Symbol option, decimal riskFreeRate=0.05m, decimal dividendYield=0.0m, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
 ImpliedVolatility (Symbol option, decimal riskFreeRate=0.05m, decimal dividendYield=0.0m, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=252)
 Initializes a new instance of the ImpliedVolatility class More...
 
void SetSmoothingFunction (Func< decimal, decimal, decimal > function)
 Set the smoothing function of IV, using both call and put IV value More...
 
void SetSmoothingFunction (PyObject function)
 Set the smoothing function of IV, using both call and put IV value More...
 
override void Reset ()
 Resets this indicator and all sub-indicators More...
 
- Public Member Functions inherited from QuantConnect.Indicators.OptionIndicatorBase
override void Reset ()
 Resets this indicator and all sub-indicators More...
 

Public Attributes

override bool IsReady => UseMirrorContract ? _isReady && Price.Current.Time == OppositePrice.Current.Time && OppositePrice.IsReady : _isReady
 Gets a flag indicating when this indicator is ready and fully initialized More...
 
- Public Attributes inherited from QuantConnect.Indicators.OptionIndicatorBase
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

override decimal ComputeNextValue (IndicatorDataPoint input)
 Computes the next value More...
 
virtual decimal CalculateIV (decimal timeTillExpiry)
 Computes the IV of the option More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.OptionIndicatorBase
 OptionIndicatorBase (string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption=null, OptionPricingModelType optionModel=OptionPricingModelType.BlackScholes, int period=2)
 Initializes a new instance of the OptionIndicatorBase class More...
 

Properties

IndicatorBase< IndicatorDataPointHistoricalVolatility [get]
 Gets the historical volatility of the underlying More...
 
- Properties inherited from QuantConnect.Indicators.OptionIndicatorBase
Symbol _oppositeOptionSymbol [get]
 Mirror option symbol (by option right), for implied volatility 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...
 

Additional Inherited Members

- Protected Attributes inherited from QuantConnect.Indicators.OptionIndicatorBase
readonly Symbol _optionSymbol
 Option's symbol object More...
 
Symbol _underlyingSymbol => _optionSymbol.Underlying
 Underlying security's symbol object More...
 
OptionPricingModelType _optionModel
 Option pricing model used to calculate indicator More...
 
readonly IRiskFreeInterestRateModel _riskFreeInterestRateModel
 Risk-free rate model More...
 
readonly IDividendYieldModel _dividendYieldModel
 Dividend yield model, for continuous dividend yield More...
 

Detailed Description

Implied Volatility indicator that calculate the IV of an option using Black-Scholes Model

Definition at line 30 of file ImpliedVolatility.cs.

Constructor & Destructor Documentation

◆ ImpliedVolatility() [1/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( string  name,
Symbol  option,
IRiskFreeInterestRateModel  riskFreeRateModel,
IDividendYieldModel  dividendYieldModel,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility 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
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 52 of file ImpliedVolatility.cs.

Here is the call graph for this function:

◆ ImpliedVolatility() [2/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( Symbol  option,
IRiskFreeInterestRateModel  riskFreeRateModel,
IDividendYieldModel  dividendYieldModel,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldModelDividend yield model
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 100 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [3/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( string  name,
Symbol  option,
PyObject  riskFreeRateModel,
PyObject  dividendYieldModel,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility 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
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 117 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [4/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( Symbol  option,
PyObject  riskFreeRateModel,
PyObject  dividendYieldModel,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldModelDividend yield model
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 133 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [5/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( string  name,
Symbol  option,
IRiskFreeInterestRateModel  riskFreeRateModel,
decimal  dividendYield = 0.0m,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
nameThe name of this indicator
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldDividend yield, as a constant
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 150 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [6/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( Symbol  option,
IRiskFreeInterestRateModel  riskFreeRateModel,
decimal  dividendYield = 0.0m,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldDividend yield, as a constant
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 165 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [7/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( string  name,
Symbol  option,
PyObject  riskFreeRateModel,
decimal  dividendYield = 0.0m,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
nameThe name of this indicator
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldDividend yield, as a constant
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 182 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [8/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( Symbol  option,
PyObject  riskFreeRateModel,
decimal  dividendYield = 0.0m,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
optionThe option to be tracked
riskFreeRateModelRisk-free rate model
dividendYieldDividend yield, as a constant
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 198 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [9/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( string  name,
Symbol  option,
decimal  riskFreeRate = 0.05m,
decimal  dividendYield = 0.0m,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
nameThe name of this indicator
optionThe option to be tracked
riskFreeRateRisk-free rate, as a constant
dividendYieldDividend yield, as a constant
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 215 of file ImpliedVolatility.cs.

◆ ImpliedVolatility() [10/10]

QuantConnect.Indicators.ImpliedVolatility.ImpliedVolatility ( Symbol  option,
decimal  riskFreeRate = 0.05m,
decimal  dividendYield = 0.0m,
Symbol  mirrorOption = null,
OptionPricingModelType  optionModel = OptionPricingModelType.BlackScholes,
int  period = 252 
)

Initializes a new instance of the ImpliedVolatility class

Parameters
optionThe option to be tracked
riskFreeRateRisk-free rate, as a constant
dividendYieldDividend yield, as a constant
mirrorOptionThe mirror option for parity calculation
optionModelThe option pricing model used to estimate IV
periodThe lookback period of historical volatility

Definition at line 230 of file ImpliedVolatility.cs.

Member Function Documentation

◆ SetSmoothingFunction() [1/2]

void QuantConnect.Indicators.ImpliedVolatility.SetSmoothingFunction ( Func< decimal, decimal, decimal >  function)

Set the smoothing function of IV, using both call and put IV value

Parameters
functionthe smoothing function

Definition at line 241 of file ImpliedVolatility.cs.

◆ SetSmoothingFunction() [2/2]

void QuantConnect.Indicators.ImpliedVolatility.SetSmoothingFunction ( PyObject  function)

Set the smoothing function of IV, using both call and put IV value

Parameters
functionthe smoothing function

Definition at line 250 of file ImpliedVolatility.cs.

◆ ComputeNextValue()

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

Computes the next value

Parameters
inputThe input given to the indicator
Returns
The input is returned unmodified.

Definition at line 267 of file ImpliedVolatility.cs.

Here is the call graph for this function:

◆ CalculateIV()

virtual decimal QuantConnect.Indicators.ImpliedVolatility.CalculateIV ( decimal  timeTillExpiry)
protectedvirtual

Computes the IV of the option

Parameters
timeTillExpirythe time until expiration in years
Returns
Smoothened IV of the option

Definition at line 330 of file ImpliedVolatility.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

override void QuantConnect.Indicators.ImpliedVolatility.Reset ( )

Resets this indicator and all sub-indicators

Definition at line 367 of file ImpliedVolatility.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.ImpliedVolatility.IsReady => UseMirrorContract ? _isReady && Price.Current.Time == OppositePrice.Current.Time && OppositePrice.IsReady : _isReady

Gets a flag indicating when this indicator is ready and fully initialized

Definition at line 260 of file ImpliedVolatility.cs.

Property Documentation

◆ HistoricalVolatility

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.ImpliedVolatility.HistoricalVolatility
get

Gets the historical volatility of the underlying

Definition at line 40 of file ImpliedVolatility.cs.


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