Class MCLDLookbackEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
MCLookbackEngine on low-discrepancy draws with QuantLib's default statistics:
MCLDLookbackEngine, named as QuantLib-Python names its siblings, QuantLib's
MCLookbackEngine<LowDiscrepancy>, its calculations closed at LowDiscrepancy and
GeneralStatistics.
public static class MCLDLookbackEngine
- Inheritance
-
MCLDLookbackEngine
- Inherited Members
Methods
Calculate(ContinuousFixedLookbackOption, EvaluationContext, GeneralizedBlackScholesProcess, int?, int?, bool, bool, int?, double?, int?, long)
Prices a continuous fixed-strike lookback option by Monte Carlo.
public static OneAssetOptionResults Calculate(ContinuousFixedLookbackOption option, EvaluationContext context, GeneralizedBlackScholesProcess process, int? timeSteps, int? timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed)
Parameters
optionContinuousFixedLookbackOptionThe option, not a partial-time one.
contextEvaluationContextThe evaluation context.
processGeneralizedBlackScholesProcessThe Black-Scholes process.
timeStepsint?The number of time steps, or null for steps per year.
timeStepsPerYearint?The number of time steps per year, or null for a number of steps.
brownianBridgeboolWhether the draws are ordered by a Brownian bridge.
antitheticVariateboolWhether antithetic variates are used.
requiredSamplesint?The number of samples, or null.
requiredTolerancedouble?The absolute tolerance, or null; it takes precedence.
maxSamplesint?The most samples for a tolerance, or null for no limit.
seedlongThe seed, in [1, 4294967295].
Returns
- OneAssetOptionResults
The option's results, the NPV and the error estimate; the expired results when it has expired.
Exceptions
- ArgumentNullException
The option, the context or the process is null.
- ArgumentException
The time steps are given neither or both ways, or aren't positive.
- ArgumentOutOfRangeException
A number of samples is negative, or the seed is outside its range.
- NanoQLException
The option is a partial-time one ("wrong argument type"), its terms fail its validation, the payoff isn't plain vanilla or its strike is negative, the spot isn't positive, or the samples can't reach the tolerance.
Calculate(ContinuousFloatingLookbackOption, EvaluationContext, GeneralizedBlackScholesProcess, int?, int?, bool, bool, int?, double?, int?, long)
Prices a continuous floating-strike lookback option by Monte Carlo.
public static OneAssetOptionResults Calculate(ContinuousFloatingLookbackOption option, EvaluationContext context, GeneralizedBlackScholesProcess process, int? timeSteps, int? timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed)
Parameters
optionContinuousFloatingLookbackOptionThe option, not a partial-time one.
contextEvaluationContextThe evaluation context.
processGeneralizedBlackScholesProcessThe Black-Scholes process.
timeStepsint?The number of time steps, or null for steps per year.
timeStepsPerYearint?The number of time steps per year, or null for a number of steps.
brownianBridgeboolWhether the draws are ordered by a Brownian bridge.
antitheticVariateboolWhether antithetic variates are used.
requiredSamplesint?The number of samples, or null.
requiredTolerancedouble?The absolute tolerance, or null; it takes precedence.
maxSamplesint?The most samples for a tolerance, or null for no limit.
seedlongThe seed, in [1, 4294967295].
Returns
- OneAssetOptionResults
The option's results, the NPV and the error estimate; the expired results when it has expired.
Exceptions
- ArgumentNullException
The option, the context or the process is null.
- ArgumentException
The time steps are given neither or both ways, or aren't positive.
- ArgumentOutOfRangeException
A number of samples is negative, or the seed is outside its range.
- NanoQLException
The option is a partial-time one ("wrong argument type"), its terms fail its validation, the payoff isn't floating, the spot isn't positive, or the samples can't reach the tolerance.
Calculate(ContinuousPartialFixedLookbackOption, EvaluationContext, GeneralizedBlackScholesProcess, int?, int?, bool, bool, int?, double?, int?, long)
Prices a continuous partial-time fixed-strike lookback option by Monte Carlo.
public static OneAssetOptionResults Calculate(ContinuousPartialFixedLookbackOption option, EvaluationContext context, GeneralizedBlackScholesProcess process, int? timeSteps, int? timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed)
Parameters
optionContinuousPartialFixedLookbackOptionThe option.
contextEvaluationContextThe evaluation context.
processGeneralizedBlackScholesProcessThe Black-Scholes process.
timeStepsint?The number of time steps, or null for steps per year.
timeStepsPerYearint?The number of time steps per year, or null for a number of steps.
brownianBridgeboolWhether the draws are ordered by a Brownian bridge.
antitheticVariateboolWhether antithetic variates are used.
requiredSamplesint?The number of samples, or null.
requiredTolerancedouble?The absolute tolerance, or null; it takes precedence.
maxSamplesint?The most samples for a tolerance, or null for no limit.
seedlongThe seed, in [1, 4294967295].
Returns
- OneAssetOptionResults
The option's results, the NPV and the error estimate; the expired results when it has expired.
Exceptions
- ArgumentNullException
The option, the context or the process is null.
- ArgumentException
The time steps are given neither or both ways, or aren't positive.
- ArgumentOutOfRangeException
A number of samples is negative, or the seed is outside its range.
- NanoQLException
The option's terms fail its validation, the payoff isn't plain vanilla or its strike is negative, the spot isn't positive, the lookback period started before the evaluation date, or the samples can't reach the tolerance.
Calculate(ContinuousPartialFloatingLookbackOption, EvaluationContext, GeneralizedBlackScholesProcess, int?, int?, bool, bool, int?, double?, int?, long)
Prices a continuous partial-time floating-strike lookback option by Monte Carlo.
public static OneAssetOptionResults Calculate(ContinuousPartialFloatingLookbackOption option, EvaluationContext context, GeneralizedBlackScholesProcess process, int? timeSteps, int? timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed)
Parameters
optionContinuousPartialFloatingLookbackOptionThe option.
contextEvaluationContextThe evaluation context.
processGeneralizedBlackScholesProcessThe Black-Scholes process.
timeStepsint?The number of time steps, or null for steps per year.
timeStepsPerYearint?The number of time steps per year, or null for a number of steps.
brownianBridgeboolWhether the draws are ordered by a Brownian bridge.
antitheticVariateboolWhether antithetic variates are used.
requiredSamplesint?The number of samples, or null.
requiredTolerancedouble?The absolute tolerance, or null; it takes precedence.
maxSamplesint?The most samples for a tolerance, or null for no limit.
seedlongThe seed, in [1, 4294967295].
Returns
- OneAssetOptionResults
The option's results, the NPV and the error estimate; the expired results when it has expired.
Exceptions
- ArgumentNullException
The option, the context or the process is null.
- ArgumentException
The time steps are given neither or both ways, or aren't positive.
- ArgumentOutOfRangeException
A number of samples is negative, or the seed is outside its range.
- NanoQLException
The option's terms fail its validation, the payoff isn't floating, the spot isn't positive, or the samples can't reach the tolerance.