Class BasketPayoff
- Namespace
- NanoQL.Instruments
- Assembly
- NanoQL.dll
The payoff of a basket option: a one-dimensional payoff applied to a value accumulated from the assets' prices.
public abstract class BasketPayoff : Payoff
- Inheritance
-
BasketPayoff
- Derived
- Inherited Members
Remarks
An extension point, as in QuantLib: the minimum, maximum, average and spread payoffs derive from it, and later
multi-asset options define their own. The assets' prices come as a ReadOnlySpan<T>, which takes an
array, a Vector's storage or a stack buffer alike, so the path pricers and the
finite-difference inner values pass their buffers without a copy, where QuantLib's members take an Array.
The payoff is immutable and safe to share across threads.
Constructors
BasketPayoff(Payoff)
Initializes a new instance of the BasketPayoff class.
protected BasketPayoff(Payoff basePayoff)
Parameters
basePayoffPayoffThe one-dimensional payoff applied to the accumulated value.
Exceptions
- ArgumentNullException
basePayoffis null.
Properties
BasePayoff
Gets the one-dimensional payoff applied to the accumulated value.
public Payoff BasePayoff { get; }
Property Value
Description
Gets the base payoff's description.
public override string Description { get; }
Property Value
Name
Gets the base payoff's name.
public override string Name { get; }
Property Value
Methods
Accumulate(ReadOnlySpan<double>)
The value the payoff accumulates from the assets' prices.
public abstract double Accumulate(ReadOnlySpan<double> a)
Parameters
aReadOnlySpan<double>The assets' prices.
Returns
- double
The accumulated value.
Exceptions
- ArgumentException
The payoff refuses the prices.
Evaluate(double)
The base payoff at a price.
public override double Evaluate(double price)
Parameters
pricedoubleThe price.
Returns
- double
The base payoff's value.
Evaluate(ReadOnlySpan<double>)
The payoff at the assets' prices: the base payoff at their accumulated value.
public virtual double Evaluate(ReadOnlySpan<double> a)
Parameters
aReadOnlySpan<double>The assets' prices.
Returns
- double
The payoff.
Exceptions
- ArgumentException
The accumulation refuses the prices.