Class KirkEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
Kirk's engine for a European spread option on two futures: E. Kirk, "Correlation in the Energy Markets", Managing Energy Price Risk, Risk Publications and Enron, pp. 71-78.
public sealed class KirkEngine : SpreadBlackScholesVanillaEngine
- Inheritance
-
KirkEngine
- Inherited Members
Remarks
Immutable. A second forward and strike summing to zero or less is refused by Black's formula, as in QuantLib.
Constructors
KirkEngine(GeneralizedBlackScholesProcess, GeneralizedBlackScholesProcess, double)
Initializes a new instance of the KirkEngine class.
public KirkEngine(GeneralizedBlackScholesProcess process1, GeneralizedBlackScholesProcess process2, double correlation)
Parameters
process1GeneralizedBlackScholesProcessThe first asset's process.
process2GeneralizedBlackScholesProcessThe second asset's process.
correlationdoubleThe correlation of the two assets.
Exceptions
- ArgumentNullException
A process is null.
Methods
Calculate(BasketOption, EvaluationContext, GeneralizedBlackScholesProcess, GeneralizedBlackScholesProcess, double)
Prices a European spread option by Kirk's formula.
public static MultiAssetOptionResults Calculate(BasketOption option, EvaluationContext context, GeneralizedBlackScholesProcess process1, GeneralizedBlackScholesProcess process2, double correlation)
Parameters
optionBasketOptionThe option, on a SpreadBasketPayoff over a plain vanilla payoff.
contextEvaluationContextThe evaluation context.
process1GeneralizedBlackScholesProcessThe first asset's process.
process2GeneralizedBlackScholesProcessThe second asset's process.
correlationdoubleThe correlation of the two assets.
Returns
- MultiAssetOptionResults
The option's results: the value; the expired results when it has expired.
Exceptions
- ArgumentNullException
An argument is null.
- NanoQLException
The exercise isn't European, the payoff isn't a spread payoff over a plain vanilla payoff, or the second forward and the strike sum to zero or less.
Calculate(double, double, double, OptionType, double, double, double)
The value of a spread option on two forwards.
protected override double Calculate(double f1, double f2, double strike, OptionType optionType, double variance1, double variance2, double df)
Parameters
f1doubleThe first forward.
f2doubleThe second forward.
strikedoubleThe strike.
optionTypeOptionTypeThe option's type.
variance1doubleThe first forward's Black variance to expiry.
variance2doubleThe second forward's Black variance to expiry.
dfdoubleThe discount factor to expiry.
Returns
- double
The value.