Class 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 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
      • 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 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