public class BlackOneTouchCashPriceFormulaRepository extends Object
This function prices one-touch/no-touch option, where the cash payment can occur at hit for a one-touch option, and at expiry for a no-touch option. Reference: E. G. Haug (2007) The complete guide to Option Pricing Formulas. Mc Graw Hill. Section 4.19.5.
| Constructor and Description |
|---|
BlackOneTouchCashPriceFormulaRepository() |
| Modifier and Type | Method and Description |
|---|---|
double |
price(double spot,
double timeToExpiry,
double costOfCarry,
double rate,
double lognormalVol,
SimpleConstantContinuousBarrier barrier)
Computes the price of a one-touch/no-touch option.
|
ValueDerivatives |
priceAdjoint(double spot,
double timeToExpiry,
double costOfCarry,
double rate,
double lognormalVol,
SimpleConstantContinuousBarrier barrier)
Computes the price and derivatives of a one-touch/no-touch option.
|
public BlackOneTouchCashPriceFormulaRepository()
public double price(double spot,
double timeToExpiry,
double costOfCarry,
double rate,
double lognormalVol,
SimpleConstantContinuousBarrier barrier)
spot - the spottimeToExpiry - the time to expirycostOfCarry - the cost of carryrate - the interest ratelognormalVol - the lognormal volatilitybarrier - the barrierpublic ValueDerivatives priceAdjoint(double spot, double timeToExpiry, double costOfCarry, double rate, double lognormalVol, SimpleConstantContinuousBarrier barrier)
The derivatives are [0] spot, [1] rate, [2] cost-of-carry, [3] volatility, [4] timeToExpiry, [5] spot twice.
spot - the spottimeToExpiry - the time to expirycostOfCarry - the cost of carryrate - the interest ratelognormalVol - the lognormal volatilitybarrier - the barrierCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.