Table of Contents

Class MCPRVarianceSwapEngine

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

MCVarianceSwapEngine on pseudo-random draws with QuantLib's default statistics: QuantLib-Python's MCPRVarianceSwapEngine, QuantLib's MCVarianceSwapEngine<PseudoRandom>, its calculations closed at PseudoRandom and GeneralStatistics.

public static class MCPRVarianceSwapEngine
Inheritance
MCPRVarianceSwapEngine
Inherited Members

Methods

Calculate(VarianceSwap, EvaluationContext, GeneralizedBlackScholesProcess, int?, int?, bool, bool, int?, double?, int?, long)

Prices a variance swap by Monte Carlo.

public static VarianceSwapResults Calculate(VarianceSwap swap, EvaluationContext context, GeneralizedBlackScholesProcess process, int? timeSteps, int? timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed)

Parameters

swap VarianceSwap

The variance swap.

context EvaluationContext

The evaluation context.

process GeneralizedBlackScholesProcess

The Black-Scholes process.

timeSteps int?

The number of time steps, or null.

timeStepsPerYear int?

The number of time steps per year, or null.

brownianBridge bool

Whether the draws are ordered by a Brownian bridge.

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].

Returns

VarianceSwapResults

The swap's results: the NPV, the variance and, where the numbers give one, the error estimate.

Exceptions

ArgumentNullException

The swap, the context or the process is null.

ArgumentException

The time steps are both given, neither, or not positive.

ArgumentOutOfRangeException

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

NanoQLException

Neither a tolerance nor a number of samples is given, or the samples can't reach the tolerance.