Class DoubleBarrierPathPricer
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
The path pricer of a double barrier option: either barrier is checked at the path's points, a knock-out paying its rebate at the first hit's node and a knock-in its rebate at expiry where neither is hit.
[Experimental("NQL0001")]
public sealed class DoubleBarrierPathPricer : PathPricer<MonteCarloPath>
- Inheritance
-
DoubleBarrierPathPricer
- Inherited Members
Remarks
Immutable and public, as QuantLib's.
Constructors
DoubleBarrierPathPricer(DoubleBarrierType, double, double, double, OptionType, double, IEnumerable<double>)
Initializes a new instance of the DoubleBarrierPathPricer class.
public DoubleBarrierPathPricer(DoubleBarrierType barrierType, double barrierLow, double barrierHigh, double rebate, OptionType type, double strike, IEnumerable<double> discounts)
Parameters
barrierTypeDoubleBarrierTypeThe barrier's type, a knock-in or a knock-out.
barrierLowdoubleThe lower barrier, positive.
barrierHighdoubleThe upper barrier, positive.
rebatedoubleThe rebate.
typeOptionTypeThe option type.
strikedoubleThe strike, non-negative.
discountsIEnumerable<double>The discount factors at the path's grid times.
Exceptions
- ArgumentNullException
discountsis null.- ArgumentOutOfRangeException
barrierTypeortypeisn't a member of its type.- ArgumentException
The strike is negative ("strike less than zero not allowed") or a barrier isn't positive.
Methods
Evaluate(MonteCarloPath)
The discounted payoff on a path, the barriers checked at its points.
public override double Evaluate(MonteCarloPath path)
Parameters
pathMonteCarloPathThe path.
Returns
- double
The value.
Exceptions
- ArgumentNullException
pathis null.- NanoQLException
The path has fewer than two points, or the type is a KIKO or a KOKI ("unknown barrier type").