## 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
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.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### BlackBarrierPriceFormulaRepository

public BlackBarrierPriceFormulaRepository()
• ### 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 spot
strike - the strike
timeToExpiry - the time to expiry
costOfCarry - the cost of carry
rate - the interest rate
lognormalVol - the lognormal volatility
isCall - true if call, false otherwise
barrier - the barrier
Returns:
the price

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 spot
strike - the strike
timeToExpiry - the time to expiry
costOfCarry - the cost of carry
rate - the interest rate
lognormalVol - the lognormal volatility
isCall - true if call, false otherwise
barrier - the barrier
Returns:
the price and derivatives