Class AnalyticContinuousFixedLookbackEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The analytic engine for continuous fixed-strike lookback options: Conze and Viswanathan's closed form, as in Haug, "Option Pricing Formulas" (1998), pp. 63-64.
public static class AnalyticContinuousFixedLookbackEngine
- Inheritance
-
AnalyticContinuousFixedLookbackEngine
- Inherited Members
Remarks
The value alone, as QuantLib's. At zero carry, where the formula's ratio is 0/0, its limit, upstream's fix after v1.44 (#2856).
Documented divergences. Each rate is read on the volatility's clock and each time is the volatility's, as
AnalyticBarrierEngine reads them, where QuantLib reads every structure at the risk-free curve's times
(Divergences/LookbackMismatchedTimesTests.cs). The extremum observed so far is read as the spot where it lies
beyond it, the spot being observed, where QuantLib prices the impossible extremum
(Divergences/LookbackExtremeBeyondSpotTests.cs). Near zero carry the formula is evaluated in double-double,
where QuantLib's double cancels and #2856 switches to its limit below |λ| of 1e-7 (NanoQL.PricingEngines.LookbackSmallCarry,
Divergences/LookbackSmallCarryTests.cs). At small volatilities, where λ = 2b/σ² is large and QuantLib's power
of s times its normal factor is +∞ times 0, NaN, the product is taken in logs (NanoQL.PricingEngines.LookbackTails,
Divergences/LookbackSmallVolatilityTests.cs). And below machine-epsilon variance the underlying follows its
forward, where QuantLib divides by the volatility (Divergences/LookbackZeroVolatilityTests.cs).
The formula is a first-passage closed form in equivalent-constant rates and a volatility, the variance and discounts to expiry: no exact closed form exists for a first passage under general deterministic term structures; the term-structure-exact route is MCLookbackEngine.
Methods
Calculate(ContinuousFixedLookbackOption, EvaluationContext, GeneralizedBlackScholesProcess)
Prices a continuous fixed-strike lookback option.
public static OneAssetOptionResults Calculate(ContinuousFixedLookbackOption option, EvaluationContext context, GeneralizedBlackScholesProcess process)
Parameters
optionContinuousFixedLookbackOptionThe option, not a partial-time one.
contextEvaluationContextThe evaluation context.
processGeneralizedBlackScholesProcessThe Black-Scholes process.
Returns
- OneAssetOptionResults
The option's results: the value; the expired results when the option has expired.
Exceptions
- ArgumentNullException
An argument is null.
- NanoQLException
The option is a ContinuousPartialFixedLookbackOption ("wrong argument type", QuantLib's refusal of its arguments), its extremum is negative, its payoff isn't plain vanilla, the spot isn't positive, or the strike is negative (a call) or not positive (a put).