Class BlackOneTouchAssetPriceFormulaRepository
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.option.BlackOneTouchAssetPriceFormulaRepository
-
public class BlackOneTouchAssetPriceFormulaRepository extends Object
The price function to compute the price of one-touch or no-touch (asset-or-nothing) option in the Black world.This function prices one-touch/no-touch option, where the asset 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 Summary
Constructors Constructor Description BlackOneTouchAssetPriceFormulaRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
price
public double price(double spot, double timeToExpiry, double costOfCarry, double rate, double lognormalVol, SimpleConstantContinuousBarrier barrier)
Computes the price of a one-touch/no-touch option.- Parameters:
spot
- the spottimeToExpiry
- the time to expirycostOfCarry
- the cost of carryrate
- the interest ratelognormalVol
- the lognormal volatilitybarrier
- the barrier- Returns:
- the price
-
priceAdjoint
public 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.The derivatives are [0] spot, [1] rate, [2] cost-of-carry, [3] volatility, [4] timeToExpiry, [5] spot twice.
- Parameters:
spot
- the spottimeToExpiry
- the time to expirycostOfCarry
- the cost of carryrate
- the interest ratelognormalVol
- the lognormal volatilitybarrier
- the barrier- Returns:
- the price and derivatives
-
-