ForexNonDeliverableForwardDiscountingMethod { public MultipleCurrencyAmount presentValue(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves) { ArgumentChecker.notNull(ndf, "Non deliverable forward"); ArgumentChecker.notNull(multicurves, "Multi-curves provider"); final double df2 = multicurves.getDiscountFactor(ndf.getCurrency2(), ndf.getPaymentTime()); final double df1 = multicurves.getDiscountFactor(ndf.getCurrency1(), ndf.getPaymentTime()); final double spot = multicurves.getFxRate(ndf.getCurrency2(), ndf.getCurrency1()); final double pv2 = ndf.getNotionalCurrency2() * (df2 - ndf.getExchangeRate() / spot * df1); return MultipleCurrencyAmount.of(ndf.getCurrency2(), pv2); } private  ForexNonDeliverableForwardDiscountingMethod(); static ForexNonDeliverableForwardDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves); MultipleCurrencyAmount currencyExposure(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves); double forwardForexRate(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves);  }
@Test public void presentValue() { final MultipleCurrencyAmount ce = METHOD_NDF.currencyExposure(NDF, MULTICURVES); final MultipleCurrencyAmount pv = METHOD_NDF.presentValue(NDF, MULTICURVES); final double pvExpected = ce.getAmount(KRW) * FX_MATRIX.getFxRate(KRW, USD) + ce.getAmount(USD); assertEquals("Present value - non-deliverable forward", pvExpected, pv.getAmount(USD), TOLERANCE_PV); }
@Test public void presentValueVsForex() { final MultipleCurrencyAmount pvNDF = METHOD_NDF.presentValue(NDF, MULTICURVES); final MultipleCurrencyAmount pvFX = METHOD_FX.presentValue(FOREX, MULTICURVES); assertEquals("Present value - non-deliverable forward", pvFX.getAmount(USD) + pvFX.getAmount(KRW) * FX_MATRIX.getFxRate(KRW, USD), pvNDF.getAmount(USD), TOLERANCE_PV); }
@Test public void presentValueMethodVsCalculator() { final MultipleCurrencyAmount pvMethod = METHOD_NDF.presentValue(NDF, MULTICURVES); final MultipleCurrencyAmount pvCalculator = NDF.accept(PVDC, MULTICURVES); assertEquals("Present value - non-deliverable forward", pvMethod, pvCalculator); }