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

      • BlackOneTouchAssetPriceFormulaRepository

        public BlackOneTouchAssetPriceFormulaRepository()
    • 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 spot
        timeToExpiry - the time to expiry
        costOfCarry - the cost of carry
        rate - the interest rate
        lognormalVol - the lognormal volatility
        barrier - 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 spot
        timeToExpiry - the time to expiry
        costOfCarry - the cost of carry
        rate - the interest rate
        lognormalVol - the lognormal volatility
        barrier - the barrier
        Returns:
        the price and derivatives