/** * Calculates the theta of the bond future option product. * <p> * The theta of the product is the minus of the option price sensitivity to the time to expiry. * 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 theta( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities) { double futurePrice = futurePrice(futureOption, discountingProvider); return theta(futureOption, discountingProvider, volatilities, futurePrice); }
public void test_theta_from_future_price() { double futurePrice = 1.1d; double computed = OPTION_PRICER.theta(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.driftlessTheta(futurePrice, strike, expiryTime, vol); assertEquals(computed, expected, TOL); }
public void test_theta() { double computed = OPTION_PRICER.theta(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.driftlessTheta(futurePrice, strike, expiryTime, vol); assertEquals(computed, expected, TOL); }