Package com.opengamma.analytics.financial.interestrate.payments.derivative

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixed.accept()


    // No extrapolation
    final CurrencyAmount pvCapLong = METHOD_CMS_SPREAD.presentValue(CMS_CAP_SPREAD, SABR_BUNDLE);
    final CurrencyAmount pvFloorLong = METHOD_CMS_SPREAD.presentValue(CMS_FLOOR_SPREAD, SABR_BUNDLE);
    final Double pvCMS1 = cms1.accept(PVC_SABR, SABR_BUNDLE);
    final Double pvCMS2 = cms2.accept(PVC_SABR, SABR_BUNDLE);
    final Double pvStrike = cpnStrike.accept(PVC_SABR, SABR_BUNDLE);
    assertEquals("CMS spread: Cap/Floor parity", pvCMS1 - pvCMS2 - pvStrike, pvCapLong.getAmount() - pvFloorLong.getAmount(), TOLERANCE_PRICE);
    // Extrapolation
    final CurrencyAmount pvCapLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_CAP_SPREAD, SABR_BUNDLE);
    final CurrencyAmount pvFloorLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_FLOOR_SPREAD, SABR_BUNDLE);
    final Double pvCMS1Extra = cms1.accept(PVC_SABR_EXTRA, SABR_BUNDLE);
View Full Code Here


    // No extrapolation
    final MultipleCurrencyAmount pvCapLong = METHOD_CMS_SPREAD.presentValue(CMS_CAP_SPREAD, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvFloorLong = METHOD_CMS_SPREAD.presentValue(CMS_FLOOR_SPREAD, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvCMS1 = cms1.accept(PVSSC, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvCMS2 = cms2.accept(PVSSC, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvStrike = cpnStrike.accept(PVDC, MULTICURVES);
    assertEquals("CMS spread: Cap/Floor parity", pvCMS1.getAmount(EUR) - pvCMS2.getAmount(EUR) - pvStrike.getAmount(EUR), pvCapLong.getAmount(EUR) - pvFloorLong.getAmount(EUR), TOLERANCE_PV);
    // Extrapolation
    final MultipleCurrencyAmount pvCapLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_CAP_SPREAD, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvFloorLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_FLOOR_SPREAD, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvCMS1Extra = cms1.accept(PVSSXC, SABR_MULTICURVES);
View Full Code Here

    final double coupon = 0.07;
    final double notional = 100;

    final CouponFixed payment = new CouponFixed(CUR, time, ZERO_PC_CURVE_NAME, yearFrac, notional, coupon);

    final Map<String, List<DoublesPair>> sense = payment.accept(PVSC, CURVES);

    assertFalse(sense.containsKey(FIVE_PC_CURVE_NAME));

    final double senseFD = curveSensitvityFDCalculator(payment, PVC, CURVES, ZERO_PC_CURVE_NAME, time);
    assertEquals(senseFD, sense.get(ZERO_PC_CURVE_NAME).get(0).second, eps * notional);
 
View Full Code Here

    final double coupon = 0.07;
    final double notional = 1000;

    final CouponFixed payment = new CouponFixed(CUR, time, ZERO_PC_CURVE_NAME, yearFrac, notional, coupon);
    final double expected = notional * yearFrac * coupon;
    final double pv = payment.accept(PVC, CURVES);
    assertEquals(expected, pv, 1e-8);
  }

  @Test
  public void forwardLiborPayment() {
View Full Code Here

  /**
   * Tests the cash-flow equivalent of a fixed coupon.
   */
  public void fixedCoupon() {
    final CouponFixed cpn = SWAP.getFixedLeg().getNthPayment(0);
    final AnnuityPaymentFixed cfe = cpn.accept(CFEC, CURVES);
    assertEquals("Fixed coupon: Number of flows", 1, cfe.getNumberOfPayments());
    assertEquals("Fixed coupon: Time", cpn.getPaymentTime(), cfe.getNthPayment(0).getPaymentTime(), 1E-5);
    assertEquals("Fixed coupon: Amount", cpn.getAmount(), cfe.getNthPayment(0).getAmount(), 1E-2);
  }

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.