/** * Calculates the delta of the bond future option product. * <p> * The delta of the product is the sensitivity of the option price to the future price. * The volatility is unchanged for a fixed strike in the sensitivity computation, hence the "StickyStrike" name. * <p> * This calculates the underlying future price using the future pricer. * * @param futureOption the option product * @param discountingProvider the discounting provider * @param volatilities the volatilities * @return the price curve sensitivity of the product */ public double deltaStickyStrike( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities) { double futurePrice = futurePrice(futureOption, discountingProvider); return deltaStickyStrike(futureOption, discountingProvider, volatilities, futurePrice); }
/** * Calculates the price sensitivity of the bond future option product based on the price of the underlying future. * <p> * The price sensitivity of the product is the sensitivity of the price to the underlying curves. * The volatility is unchanged for a fixed strike in the sensitivity computation, hence the "StickyStrike" name. * * @param futureOption the option product * @param discountingProvider the discounting provider * @param volatilities the volatilities * @param futurePrice the price of the underlying future * @return the price curve sensitivity of the product */ public PointSensitivities priceSensitivityRatesStickyStrike( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities, double futurePrice) { double delta = deltaStickyStrike(futureOption, discountingProvider, volatilities, futurePrice); PointSensitivities futurePriceSensitivity = futurePricer.priceSensitivity(futureOption.getUnderlyingFuture(), discountingProvider); return futurePriceSensitivity.multipliedBy(delta); }
public void test_delta_from_future_price() { double futurePrice = 1.1d; double computed = OPTION_PRICER.deltaStickyStrike( FUTURE_OPTION_PRODUCT, RATE_PROVIDER, VOLS, futurePrice); double strike = FUTURE_OPTION_PRODUCT.getStrikePrice(); double expiryTime = ACT_365F.relativeYearFraction(VAL_DATE, FUTURE_OPTION_PRODUCT.getExpiryDate()); double logMoneyness = Math.log(strike / futurePrice); double vol = SURFACE.zValue(expiryTime, logMoneyness); double expected = BlackFormulaRepository.delta(futurePrice, strike, expiryTime, vol, true); assertEquals(computed, expected, TOL); }
public void test_delta() { double computed = OPTION_PRICER.deltaStickyStrike(FUTURE_OPTION_PRODUCT, RATE_PROVIDER, VOLS); double futurePrice = FUTURE_PRICER.price(FUTURE_OPTION_PRODUCT.getUnderlyingFuture(), RATE_PROVIDER); double strike = FUTURE_OPTION_PRODUCT.getStrikePrice(); double expiryTime = ACT_365F.relativeYearFraction(VAL_DATE, FUTURE_OPTION_PRODUCT.getExpiryDate()); double logMoneyness = Math.log(strike / futurePrice); double vol = SURFACE.zValue(expiryTime, logMoneyness); double expected = BlackFormulaRepository.delta(futurePrice, strike, expiryTime, vol, true); assertEquals(computed, expected, TOL); }
public void test_priceSensitivity_from_future_price() { double futurePrice = 1.1d; PointSensitivities point = OPTION_PRICER.priceSensitivityRatesStickyStrike( FUTURE_OPTION_PRODUCT, RATE_PROVIDER, VOLS, futurePrice); CurrencyParameterSensitivities computed = RATE_PROVIDER.parameterSensitivity(point); double delta = OPTION_PRICER.deltaStickyStrike(FUTURE_OPTION_PRODUCT, RATE_PROVIDER, VOLS, futurePrice); CurrencyParameterSensitivities expected = RATE_PROVIDER.parameterSensitivity( FUTURE_PRICER.priceSensitivity(FUTURE_OPTION_PRODUCT.getUnderlyingFuture(), RATE_PROVIDER)).multipliedBy(delta); assertTrue(computed.equalWithTolerance(expected, TOL)); }