Table of Contents

Class MCForwardEuropeanHestonEngine

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

The forward-start European option pricing engine by Monte Carlo simulation on a Heston process.

public static class MCForwardEuropeanHestonEngine
Inheritance
MCForwardEuropeanHestonEngine
Inherited Members

Remarks

A static class over MCForwardVanillaEngine<TMc, TPath, TStats>, pinned to HestonProcess, QuantLib's default template argument. The paths run on the process's clock, as the Monte Carlo Heston engine runs them, the reset read at its index on the grid and the payoff discounted at expiry there; on structures dated alike, QuantLib's bits. The control variate is the vanilla struck at the moneyness times the spot, priced by AnalyticHestonEngine and simulated with its reset at the start, QuantLib's. The payoff must be plain vanilla; the seed is explicit.

Methods

Calculate<TRng, TStats>(ForwardVanillaOption, EvaluationContext, HestonProcess, int?, int?, bool, int?, double?, int?, long, bool)

Prices a forward-start European option by Monte Carlo under a Heston process.

public static OneAssetOptionResults Calculate<TRng, TStats>(ForwardVanillaOption option, EvaluationContext context, HestonProcess process, int? timeSteps, int? timeStepsPerYear, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed, bool controlVariate = false) where TRng : IRngTraits where TStats : IStatistics, new()

Parameters

option ForwardVanillaOption

The option.

context EvaluationContext

The evaluation context.

process HestonProcess

The Heston process.

timeSteps int?

The number of time steps, or null for steps per year.

timeStepsPerYear int?

The number of time steps per year, or null.

antitheticVariate bool

Whether antithetic variates are used.

requiredSamples int?

The number of samples, or null.

requiredTolerance double?

The absolute tolerance, or null; it takes precedence.

maxSamples int?

The most samples for a tolerance, or null for no limit.

seed long

The seed, in [1, 4294967295].

controlVariate bool

Whether the analytic vanilla is used as a control variate.

Returns

OneAssetOptionResults

The option's results, the NPV and the error estimate; the expired results when it has expired.

Type Parameters

TRng

The random-number traits.

TStats

The statistics accumulator.

Exceptions

ArgumentNullException

The option, the context or the process is null.

ArgumentException

The time steps are given neither or both ways, or aren't positive.

ArgumentOutOfRangeException

A number of samples is negative, or the seed is outside its range.

NanoQLException

The option's terms are invalid, its payoff isn't plain vanilla or its exercise European, neither a tolerance nor a number of samples is given, the samples can't reach the tolerance, or a step refuses.