InterestRateFutureOptionMarginTransactionSABRMethod extends InterestRateFutureOptionMarginTransactionGenericMethod<SABRSTIRFuturesProviderInterface> { public MultipleCurrencyAmount presentValueFromFuturePrice(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData, final double priceFuture) { ArgumentChecker.notNull(transaction, "Transaction on option on STIR futures"); ArgumentChecker.notNull(sabrData, "SABR / multi-curves provider"); double priceSecurity = getSecurityMethod().priceFromFuturePrice(transaction.getUnderlyingSecurity(), sabrData, priceFuture); MultipleCurrencyAmount priceTransaction = presentValueFromPrice(transaction, priceSecurity); return priceTransaction; } private  InterestRateFutureOptionMarginTransactionSABRMethod(); static InterestRateFutureOptionMarginTransactionSABRMethod getInstance(); @Override InterestRateFutureOptionMarginSecuritySABRMethod getSecurityMethod(); MultipleCurrencyAmount presentValueFromFuturePrice(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData, final double priceFuture); PresentValueSABRSensitivityDataBundle presentValueSABRSensitivity(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData);  }
@Test public void presentValueFromFuturePrice() { final double priceFuture = 0.9905; final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, TRADE_PRICE); final MultipleCurrencyAmount pv = METHOD_SABR_TRA.presentValueFromFuturePrice(transactionNoPremium, SABR_MULTICURVES, priceFuture); final double priceSecurity = METHOD_SABR_SEC.priceFromFuturePrice(OPTION_EDU2, SABR_MULTICURVES, priceFuture); final double pvExpected = (priceSecurity - TRADE_PRICE) * QUANTITY * NOTIONAL * FUTURE_FACTOR; assertEquals("Future option: present value from future price", pvExpected, pv.getAmount(EUR), TOLERANCE_PV); }
@Test public void presentValue() { final double priceFuture = METHOD_FUT.price(EDU2, MULTICURVES); final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, TRADE_PRICE); final double pvNoPremium = METHOD_SABR_TRA.presentValue(transactionNoPremium, SABR_MULTICURVES).getAmount(EUR); final double pvNoPremiumExpected = METHOD_SABR_TRA.presentValueFromFuturePrice(transactionNoPremium, SABR_MULTICURVES, priceFuture).getAmount(EUR); assertEquals("Future option: present value", pvNoPremiumExpected, pvNoPremium, TOLERANCE_PV); }