Table of Contents

Class BarrierPathPricer

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

The path pricer of a barrier option with the Brownian bridge correction for the barrier's crossings between the path's points: each step's extreme is drawn from its bridge, given a uniform number of its own (Beaglehole, Dybvig and Zhou, "Going to Extremes: Correcting Simulation Bias in Exotic Option Valuation", Financial Analysts Journal, Jan/Feb 1997; El Babsiri and Noel, "Simulating path-dependent options: A new approach", Journal of Derivatives, Winter 1998).

[WorkingType]
public sealed class BarrierPathPricer : PathPricer<MonteCarloPath>
Inheritance
BarrierPathPricer
Inherited Members

Remarks

A working type, as in QuantLib: it draws a new uniform sequence for each path it prices, from a copy of the generator it is given, read as a view of the generator's buffer where QuantLib copies a vector per path, so a price allocates nothing. A knock-out pays its rebate at the hit's node, a knock-in at expiry.

Constructors

BarrierPathPricer(BarrierType, double, double, OptionType, double, IEnumerable<double>, StochasticProcess1D, MersenneTwisterUniformRsg)

Initializes a new instance of the BarrierPathPricer class.

public BarrierPathPricer(BarrierType barrierType, double barrier, double rebate, OptionType type, double strike, IEnumerable<double> discounts, StochasticProcess1D diffProcess, MersenneTwisterUniformRsg sequenceGen)

Parameters

barrierType BarrierType

The barrier's type.

barrier double

The barrier, positive.

rebate double

The rebate.

type OptionType

The option type.

strike double

The strike, non-negative.

discounts IEnumerable<double>

The discount factors at the path's grid times.

diffProcess StochasticProcess1D

The process, whose diffusion the bridge reads at each step's start.

sequenceGen MersenneTwisterUniformRsg

The uniform sequence generator, of the grid's steps, which the pricer copies.

Exceptions

ArgumentNullException

A reference argument is null.

ArgumentOutOfRangeException

barrierType or type isn't a member of its type.

ArgumentException

The strike is negative ("strike less than zero not allowed") or the barrier isn't positive ("barrier less/equal zero not allowed").

Methods

Evaluate(MonteCarloPath)

The discounted payoff on a path, its crossings of the barrier between points drawn from the bridge.

public override double Evaluate(MonteCarloPath path)

Parameters

path MonteCarloPath

The path.

Returns

double

The value.

Exceptions

ArgumentNullException

path is null.

NanoQLException

The path has fewer than two points.