Examples of CouponFixedAccruedCompounding


Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixedAccruedCompounding

  @Override
  public CouponFixedAccruedCompounding toDerivative(final ZonedDateTime date) {
    ArgumentChecker.notNull(date, "date");
    ArgumentChecker.isTrue(!date.isAfter(getPaymentDate()), "date {} is after payment date {}", date, getPaymentDate()); // Required: reference date <= payment date
    final double paymentTime = TimeCalculator.getTimeBetween(date, getPaymentDate());
    return new CouponFixedAccruedCompounding(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), getRate(), getAccrualStartDate(), getAccrualEndDate());
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixedAccruedCompounding

  private static final double TOLERANCE_DELTA = 2.0E+2;

  @Test
  public void presentValue() {
    final Swap<CouponFixedAccruedCompounding, CouponONCompounded> swap = SWAPTION_LONG_REC.getUnderlyingSwap();
    final CouponFixedAccruedCompounding cpn0 = swap.getFirstLeg().getNthPayment(0);
    final double forwardModified = METHOD_SWAP.forwardModified(swap, CURVES);
    final double strikeModified = Math.pow(1.0 + RATE, cpn0.getPaymentYearFraction()) - 1.0d;
    final double num = CURVES.getCurve(CURVES_NAME[0]).getDiscountFactor(cpn0.getPaymentTime()) * NOTIONAL;
    final double expiry = SWAPTION_LONG_REC.getTimeToExpiry();
    final double vol = BLACK.getVolatility(expiry, SWAPTION_LONG_REC.getMaturityTime());
    final EuropeanVanillaOption option = new EuropeanVanillaOption(strikeModified, expiry, SWAPTION_LONG_REC.isCall());
    final BlackPriceFunction blackFunction = new BlackPriceFunction();
    final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, num, vol);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixedAccruedCompounding

    final CouponONCompounded cpnON = SWAPTION_LONG_REC.getUnderlyingSwap().getSecondLeg().getNthPayment(0);
    discTime.add(cpnON.getFixingPeriodStartTimes()[0]);
    for (int loopp = 0; loopp < cpnON.getFixingPeriodStartTimes().length; loopp++) {
      discTime.add(cpnON.getFixingPeriodEndTimes()[loopp]);
    }
    final CouponFixedAccruedCompounding cpnF = SWAPTION_LONG_REC.getUnderlyingSwap().getFirstLeg().getNthPayment(0);
    discTime.add(cpnF.getPaymentTime());
    final double[] nodeTimesDisc = discTime.toDoubleArray();
    final List<DoublesPair> sensiPvDisc = pvcsSwaption.getSensitivities().get(CURVES_NAME[0]);
    final List<DoublesPair> fdSense = FDCurveSensitivityCalculator.curveSensitvityFDCalculator(SWAPTION_LONG_REC, METHOD_BLACK, CURVES_BLACK, CURVES_NAME[0], nodeTimesDisc, 0.0);
    assertSensitivityEquals(sensiPvDisc, fdSense, TOLERANCE_DELTA);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.