|
Lean
$LEAN_TAG$
|
Provides QuantLib(QL) implementation of IOptionPriceModel to support major option pricing models, available in QL. More...
Public Member Functions | |
| QLOptionPriceModel (PricingEngineFunc pricingEngineFunc, IQLUnderlyingVolatilityEstimator underlyingVolEstimator=null, IQLRiskFreeRateEstimator riskFreeRateEstimator=null, IQLDividendYieldEstimator dividendYieldEstimator=null, OptionStyle[] allowedOptionStyles=null) | |
| Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield More... | |
| QLOptionPriceModel (PricingEngineFuncEx pricingEngineFunc, IQLUnderlyingVolatilityEstimator underlyingVolEstimator=null, IQLRiskFreeRateEstimator riskFreeRateEstimator=null, IQLDividendYieldEstimator dividendYieldEstimator=null, OptionStyle[] allowedOptionStyles=null) | |
| Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield More... | |
| OptionPriceModelResult | Evaluate (Security security, Slice slice, OptionContract contract) |
| Evaluates the specified option contract to compute a theoretical price, IV and greeks More... | |
Public Attributes | |
| bool | VolatilityEstimatorWarmedUp => _underlyingVolEstimator.IsReady |
| True if volatility model is warmed up, i.e. has generated volatility value different from zero, otherwise false. More... | |
Protected Member Functions | |
| double | ImpliedVolatilityEstimation (double price, double initialGuess, double timeTillExpiry, double riskFreeDiscount, double forwardPrice, PlainVanillaPayoff payoff, out BlackCalculator black) |
| An implied volatility approximation by Newton-Raphson method. Return 0 if result is not converged More... | |
Properties | |
| bool | EnableGreekApproximation = true [get, set] |
| When enabled, approximates Greeks if corresponding pricing model didn't calculate exact numbers. The default value is true. More... | |
| IReadOnlyCollection< OptionStyle > | AllowedOptionStyles [get] |
| List of option styles supported by the pricing model. By default, both American and European option styles are supported. More... | |
Provides QuantLib(QL) implementation of IOptionPriceModel to support major option pricing models, available in QL.
Definition at line 33 of file QLOptionPriceModel.cs.
| QuantConnect.Securities.Option.QLOptionPriceModel.QLOptionPriceModel | ( | PricingEngineFunc | pricingEngineFunc, |
| IQLUnderlyingVolatilityEstimator | underlyingVolEstimator = null, |
||
| IQLRiskFreeRateEstimator | riskFreeRateEstimator = null, |
||
| IQLDividendYieldEstimator | dividendYieldEstimator = null, |
||
| OptionStyle[] | allowedOptionStyles = null |
||
| ) |
Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield
| pricingEngineFunc | Function modeled stochastic process, and returns new pricing engine to run calculations for that option |
| underlyingVolEstimator | The underlying volatility estimator |
| riskFreeRateEstimator | The risk free rate estimator |
| dividendYieldEstimator | The underlying dividend yield estimator |
| allowedOptionStyles | List of option styles supported by the pricing model. It defaults to both American and European option styles |
Definition at line 70 of file QLOptionPriceModel.cs.
| QuantConnect.Securities.Option.QLOptionPriceModel.QLOptionPriceModel | ( | PricingEngineFuncEx | pricingEngineFunc, |
| IQLUnderlyingVolatilityEstimator | underlyingVolEstimator = null, |
||
| IQLRiskFreeRateEstimator | riskFreeRateEstimator = null, |
||
| IQLDividendYieldEstimator | dividendYieldEstimator = null, |
||
| OptionStyle[] | allowedOptionStyles = null |
||
| ) |
Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield
| pricingEngineFunc | Function takes option and modeled stochastic process, and returns new pricing engine to run calculations for that option |
| underlyingVolEstimator | The underlying volatility estimator |
| riskFreeRateEstimator | The risk free rate estimator |
| dividendYieldEstimator | The underlying dividend yield estimator |
| allowedOptionStyles | List of option styles supported by the pricing model. It defaults to both American and European option styles |
Definition at line 85 of file QLOptionPriceModel.cs.
| OptionPriceModelResult QuantConnect.Securities.Option.QLOptionPriceModel.Evaluate | ( | Security | security, |
| Slice | slice, | ||
| OptionContract | contract | ||
| ) |
Evaluates the specified option contract to compute a theoretical price, IV and greeks
| security | The option security object |
| slice | The current data slice. This can be used to access other information available to the algorithm |
| contract | The option contract to evaluate |
Implements QuantConnect.Securities.Option.IOptionPriceModel.
Definition at line 108 of file QLOptionPriceModel.cs.
|
protected |
An implied volatility approximation by Newton-Raphson method. Return 0 if result is not converged
Orlando G, Taglialatela G. A review on implied volatility calculation. Journal of Computational and Applied Mathematics. 2017 Aug 15;320:202-20. https://www.sciencedirect.com/science/article/pii/S0377042717300602
| price | current price of the option |
| initialGuess | initial guess of the IV |
| timeTillExpiry | time till option contract expiry |
| riskFreeDiscount | risk free rate discount factor |
| forwardPrice | future value of underlying price |
| payoff | payoff structure of the option contract |
| black | black calculator instance |
Definition at line 346 of file QLOptionPriceModel.cs.
| bool QuantConnect.Securities.Option.QLOptionPriceModel.VolatilityEstimatorWarmedUp => _underlyingVolEstimator.IsReady |
True if volatility model is warmed up, i.e. has generated volatility value different from zero, otherwise false.
Definition at line 54 of file QLOptionPriceModel.cs.
|
getset |
When enabled, approximates Greeks if corresponding pricing model didn't calculate exact numbers. The default value is true.
Definition at line 49 of file QLOptionPriceModel.cs.
|
get |
List of option styles supported by the pricing model. By default, both American and European option styles are supported.
Definition at line 60 of file QLOptionPriceModel.cs.