ForexForwardPointsMethod { public double[] presentValueForwardPointsSensitivity(final Forex fx, final MulticurveProviderInterface multicurves, final DoublesCurve forwardRates, final Pair<Currency, Currency> ccyPair) { final double payTime = fx.getPaymentTime(); final Currency ccy2; final double amount1; if (checkCurrency(fx, ccyPair)) { ccy2 = fx.getCurrency2(); amount1 = fx.getPaymentCurrency1().getAmount(); } else { ccy2 = fx.getCurrency1(); amount1 = fx.getPaymentCurrency2().getAmount(); } final double df2 = multicurves.getDiscountFactor(ccy2, payTime); final double pvBar = 1.0; final double fwdRateBar = df2 * amount1 * pvBar; final Double[] fwdRateDp = forwardRates.getYValueParameterSensitivity(payTime); final double[] sensitivity = new double[fwdRateDp.length]; for (int loops = 0; loops < fwdRateDp.length; loops++) { sensitivity[loops] = fwdRateDp[loops] * fwdRateBar; } return sensitivity; } private  ForexForwardPointsMethod(); static ForexForwardPointsMethod getInstance(); MultipleCurrencyAmount presentValue(final Forex fx, final MulticurveProviderInterface multicurves, final DoublesCurve forwardRates, final Pair<Currency, Currency> ccyPair); MultipleCurrencyAmount presentValue(final Forex fx, final MulticurveForwardPointsProviderInterface multicurvesForward); MultipleCurrencyAmount currencyExposure(final Forex fx, final MulticurveProviderInterface multicurves, final DoublesCurve forwardRates, final Pair<Currency, Currency> ccyPair); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final Forex fx, final MulticurveProviderInterface multicurves, final DoublesCurve forwardRates,
      final Pair<Currency, Currency> ccyPair); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final Forex fx, final MulticurveForwardPointsProviderInterface multicurvesForward); double[] presentValueForwardPointsSensitivity(final Forex fx, final MulticurveProviderInterface multicurves, final DoublesCurve forwardRates, final Pair<Currency, Currency> ccyPair);  }
@Test public void presentValueForwardPointsSensitivity() { final double[] fpsComputed = METHOD_FX_PTS.presentValueForwardPointsSensitivity(FX, MULTICURVES, FWD_RATES, PAIR); final MultipleCurrencyAmount pv = METHOD_FX_PTS.presentValue(FX, MULTICURVES, FWD_RATES, PAIR); final double[] fpsExpected = new double[NB_MARKET_QUOTES]; final double shift = 1.0E-6; for (int loopt = 0; loopt < NB_MARKET_QUOTES; loopt++) { final double[] mqpShift = MARKET_QUOTES_FWD.clone(); mqpShift[loopt] += shift; final InterpolatedDoublesCurve fwdPtsShift = new InterpolatedDoublesCurve(MARKET_QUOTES_TIME, mqpShift, LINEAR_FLAT, true); final MultipleCurrencyAmount pvShift = METHOD_FX_PTS.presentValue(FX, MULTICURVES, fwdPtsShift, PAIR); fpsExpected[loopt] = (pvShift.getAmount(CUR_2) - pv.getAmount(CUR_2)) / shift; assertEquals("ForexForwardPointsMethod: presentValueForwardPointsSensitivity - node " + loopt, fpsExpected[loopt], fpsComputed[loopt], TOLERANCE_PV_DELTA); } }