/** * Calculates the price sensitivity of the bond future option product based on curves. * <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. * <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 PointSensitivities priceSensitivityRatesStickyStrike( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities) { ArgChecker.isTrue(futureOption.getPremiumStyle().equals(FutureOptionPremiumStyle.DAILY_MARGIN), "Premium style should be DAILY_MARGIN"); double futurePrice = futurePrice(futureOption, discountingProvider); return priceSensitivityRatesStickyStrike(futureOption, discountingProvider, volatilities, futurePrice); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1574023291: // securityId return ((ResolvedBondFutureOption) bean).getSecurityId(); case -219971059: // putCall return ((ResolvedBondFutureOption) bean).getPutCall(); case 50946231: // strikePrice return ((ResolvedBondFutureOption) bean).getStrikePrice(); case -1289159373: // expiry return ((ResolvedBondFutureOption) bean).getExpiry(); case -1257652838: // premiumStyle return ((ResolvedBondFutureOption) bean).getPremiumStyle(); case -142444: // rounding return ((ResolvedBondFutureOption) bean).getRounding(); case -165476480: // underlyingFuture return ((ResolvedBondFutureOption) bean).getUnderlyingFuture(); } return super.propertyGet(bean, propertyName, quiet); }
/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(ResolvedBondFutureOption beanToCopy) { this.securityId = beanToCopy.getSecurityId(); this.putCall = beanToCopy.getPutCall(); this.strikePrice = beanToCopy.getStrikePrice(); this.expiry = beanToCopy.getExpiry(); this.premiumStyle = beanToCopy.getPremiumStyle(); this.rounding = beanToCopy.getRounding(); this.underlyingFuture = beanToCopy.getUnderlyingFuture(); }
/** * Calculates the gamma of the bond future option product based on the price of the underlying future. * <p> * The gamma of the product is the sensitivity of the option delta to the future price. * 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 double gammaStickyStrike( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities, double futurePrice) { ArgChecker.isTrue(futureOption.getPremiumStyle().equals(FutureOptionPremiumStyle.DAILY_MARGIN), "Premium style should be DAILY_MARGIN"); double strike = futureOption.getStrikePrice(); ResolvedBondFuture future = futureOption.getUnderlyingFuture(); double volatility = volatilities.volatility(futureOption.getExpiry(), future.getLastTradeDate(), strike, futurePrice); double timeToExpiry = volatilities.relativeTime(futureOption.getExpiry()); double gamma = BlackFormulaRepository.gamma(futurePrice, strike, timeToExpiry, volatility); return gamma; }
/** * Calculates the theta of the bond future option product based on the price of the underlying future. * <p> * The theta of the product is 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. * * @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 double theta( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities, double futurePrice) { ArgChecker.isTrue(futureOption.getPremiumStyle().equals(FutureOptionPremiumStyle.DAILY_MARGIN), "Premium style should be DAILY_MARGIN"); double strike = futureOption.getStrikePrice(); ResolvedBondFuture future = futureOption.getUnderlyingFuture(); double volatility = volatilities.volatility(futureOption.getExpiry(), future.getLastTradeDate(), strike, futurePrice); double timeToExpiry = volatilities.relativeTime(futureOption.getExpiry()); double theta = BlackFormulaRepository.driftlessTheta(futurePrice, strike, timeToExpiry, volatility); return theta; }
/** * Calculates the delta of the bond future option product based on the price of the underlying future. * <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. * * @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 double deltaStickyStrike( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities, double futurePrice) { ArgChecker.isTrue(futureOption.getPremiumStyle().equals(FutureOptionPremiumStyle.DAILY_MARGIN), "Premium style should be DAILY_MARGIN"); double strike = futureOption.getStrikePrice(); ResolvedBondFuture future = futureOption.getUnderlyingFuture(); double volatility = volatilities.volatility(futureOption.getExpiry(), future.getLastTradeDate(), strike, futurePrice); double timeToExpiry = volatilities.relativeTime(futureOption.getExpiry()); double delta = BlackFormulaRepository.delta( futurePrice, strike, timeToExpiry, volatility, futureOption.getPutCall().isCall()); return delta; }
double futurePrice) { ArgChecker.isTrue(futureOption.getPremiumStyle().equals(FutureOptionPremiumStyle.DAILY_MARGIN), "Premium style should be DAILY_MARGIN"); double strike = futureOption.getStrikePrice();
/** * Calculates the price sensitivity to the Black volatility used for the pricing of the bond future option * based on the price of the underlying future. * * @param futureOption the option product * @param discountingProvider the discounting provider * @param volatilities the volatilities * @param futurePrice the underlying future price * @return the sensitivity */ public BondFutureOptionSensitivity priceSensitivityModelParamsVolatility( ResolvedBondFutureOption futureOption, LegalEntityDiscountingProvider discountingProvider, BlackBondFutureVolatilities volatilities, double futurePrice) { ArgChecker.isTrue(futureOption.getPremiumStyle().equals(FutureOptionPremiumStyle.DAILY_MARGIN), "Premium style should be DAILY_MARGIN"); double strike = futureOption.getStrikePrice(); ResolvedBondFuture future = futureOption.getUnderlyingFuture(); double volatility = volatilities.volatility(futureOption.getExpiry(), future.getLastTradeDate(), strike, futurePrice); double timeToExpiry = volatilities.relativeTime(futureOption.getExpiry()); double vega = BlackFormulaRepository.vega(futurePrice, strike, timeToExpiry, volatility); return BondFutureOptionSensitivity.of( volatilities.getName(), timeToExpiry, future.getLastTradeDate(), strike, futurePrice, future.getCurrency(), vega); }