Class DiscretizedDermanKaniBarrierOption
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
A barrier option on a lattice with Derman and Kani's correction: at the nodes straddling the barrier, the values interpolate between the rolled-back value and the knocked-in vanilla or knocked-out rebate by the nodes' distances from the barrier.
[WorkingType]
public sealed class DiscretizedDermanKaniBarrierOption : DiscretizedAsset, IDiscretizedBarrierAsset<DiscretizedDermanKaniBarrierOption>
- Inheritance
-
DiscretizedDermanKaniBarrierOption
- Implements
- Inherited Members
Remarks
A working type, as every discretized asset is: it rolls an unenhanced DiscretizedBarrierOption back beside it, kept and initialized again at each reset, and reads the lattice's grid into a buffer it reserves at its widest step, so a rollback allocates nothing.
Constructors
DiscretizedDermanKaniBarrierOption(BarrierOption, StochasticProcess, TimeGrid?)
Initializes a new instance of the DiscretizedDermanKaniBarrierOption class.
public DiscretizedDermanKaniBarrierOption(BarrierOption option, StochasticProcess process, TimeGrid? grid = null)
Parameters
optionBarrierOptionThe barrier option.
processStochasticProcessThe process, which converts the exercise dates to times.
gridTimeGridThe time grid the exercise times are moved to the closest of, or null for none, QuantLib's empty grid.
Exceptions
- ArgumentNullException
optionorprocessis null.- NanoQLException
The option has no payoff.
Methods
MandatoryTimes()
The option's mandatory times: the unenhanced asset's, its exercise times.
public override ImmutableArray<double> MandatoryTimes()
Returns
- ImmutableArray<double>
The times.
PostAdjustValuesImpl()
Rolls the unenhanced asset back to the asset's time, corrects the nodes straddling the barrier, then applies the unenhanced asset's barrier check to the asset's values.
protected override void PostAdjustValuesImpl()
Reset(int)
Sets the values to zero at the given size, initializes the unenhanced asset beside them, then applies the barrier.
public override void Reset(int size)
Parameters
sizeintThe number of values.
Exceptions
- ArgumentOutOfRangeException
sizeis negative.- NanoQLException
The asset isn't on a lattice.
Explicit Interface Implementations
Create(BarrierOption, StochasticProcess, TimeGrid?)
Builds the asset of a barrier option.
static DiscretizedDermanKaniBarrierOption Create(BarrierOption option, StochasticProcess process, TimeGrid? grid)
Parameters
optionBarrierOptionThe barrier option.
processStochasticProcessThe process, which converts the exercise dates to times.
gridTimeGridThe time grid the exercise times are moved to the closest of, or null for none, QuantLib's empty grid.
Returns
- DiscretizedDermanKaniBarrierOption
The asset.