Class BlackBarrierPriceFormulaRepository
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.option.BlackBarrierPriceFormulaRepository
-
public class BlackBarrierPriceFormulaRepository extends Object
The price function to compute the price of barrier option in the Black world. Reference: E. G. Haug (2007) The complete guide to Option Pricing Formulas. Mc Graw Hill. Section 4.17.1.
-
-
Constructor Summary
Constructors Constructor Description BlackBarrierPriceFormulaRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
price(double spot, double strike, double timeToExpiry, double costOfCarry, double rate, double lognormalVol, boolean isCall, SimpleConstantContinuousBarrier barrier)
Computes the price of a barrier option.ValueDerivatives
priceAdjoint(double spot, double strike, double timeToExpiry, double costOfCarry, double rate, double lognormalVol, boolean isCall, SimpleConstantContinuousBarrier barrier)
Computes the price and derivatives of a barrier option.
-
-
-
Method Detail
-
price
public double price(double spot, double strike, double timeToExpiry, double costOfCarry, double rate, double lognormalVol, boolean isCall, SimpleConstantContinuousBarrier barrier)
Computes the price of a barrier option.- Parameters:
spot
- the spotstrike
- the striketimeToExpiry
- the time to expirycostOfCarry
- the cost of carryrate
- the interest ratelognormalVol
- the lognormal volatilityisCall
- true if call, false otherwisebarrier
- the barrier- Returns:
- the price
-
priceAdjoint
public ValueDerivatives priceAdjoint(double spot, double strike, double timeToExpiry, double costOfCarry, double rate, double lognormalVol, boolean isCall, SimpleConstantContinuousBarrier barrier)
Computes the price and derivatives of a barrier option. The derivatives are [0] spot, [1] strike, [2] rate, [3] cost-of-carry, [4] volatility, [5] timeToExpiry, [6] spot twice- Parameters:
spot
- the spotstrike
- the striketimeToExpiry
- the time to expirycostOfCarry
- the cost of carryrate
- the interest ratelognormalVol
- the lognormal volatilityisCall
- true if call, false otherwisebarrier
- the barrier- Returns:
- the price and derivatives
-
-