Class AnalyticHolderExtensibleOptionEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The analytic engine for a holder-extensible option: Longstaff's formula, the vanilla to the first maturity and bivariate terms over the region where the holder extends, between two critical prices.
public static class AnalyticHolderExtensibleOptionEngine
- Inheritance
-
AnalyticHolderExtensibleOptionEngine
- Inherited Members
Remarks
Stateless. QuantLib's fixes after v1.44 (#2892) are taken: the put's correlation sign, the Newton seeds at the
strike, the put's derivative, the empty extension region and the call's with dividends
(Divergences/HolderExtensibleCriticalPricesTests.cs). QuantLib evaluates the formula on one zero rate,
dividend yield and volatility, read at the first maturity, for both periods, so it is exact only on flat markets;
here each term reads the variances to each maturity at the first strike, the correlation from their ratio and the
discounts by date, and the critical prices solve the forward Black values from the first maturity
(Divergences/HolderExtensibleTermStructureTests.cs, against the exact integral at the first maturity within
the critical prices' accuracy). The bivariate normal is West's, QuantLib's default, where its engine reads
Drezner's; an infinite critical price meets its limit there. QuantLib's Newton iterations and stopping rule are
kept, capped at 1,000 iterations.
Every structure is read by date, accruing nothing before its own date
(Divergences/ExoticMismatchedTimesTests.cs); a date before the process's clock keeps QuantLib's "negative
time" refusal.
Methods
Calculate(HolderExtensibleOption, EvaluationContext, GeneralizedBlackScholesProcess)
Prices a holder-extensible option: QuantLib's calculate.
public static OneAssetOptionResults Calculate(HolderExtensibleOption option, EvaluationContext context, GeneralizedBlackScholesProcess process)
Parameters
optionHolderExtensibleOptionThe option.
contextEvaluationContextThe evaluation context.
processGeneralizedBlackScholesProcessThe underlying's process.
Returns
- OneAssetOptionResults
The option's results: the value.
Exceptions
- ArgumentNullException
An argument is null.
- NanoQLException
The option's terms are invalid, its payoff isn't plain vanilla, a date is before the clock's date, or a critical price isn't found in 1,000 iterations.