Examples of PaymentFixedDefinition


Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

    assertEquals(SETTLEMENT_DAYS, FRN_DEFINITION.getSettlementDays());
    assertEquals(DAY_COUNT, FRN_DEFINITION.getDayCount());
    assertEquals(0, FRN_DEFINITION.getExCouponDays()); //Default
    final AnnuityCouponIborDefinition coupon = AnnuityCouponIborDefinition.fromAccrualUnadjusted(START_ACCRUAL_DATE, MATURITY_DATE, 1.0, IBOR_INDEX, false, CALENDAR);
    assertEquals(coupon, FRN_DEFINITION.getCoupons());
    final AnnuityDefinition<PaymentFixedDefinition> nominal = new AnnuityDefinition<>(new PaymentFixedDefinition[] {new PaymentFixedDefinition(CUR,
        BUSINESS_DAY.adjustDate(CALENDAR, MATURITY_DATE), 1.0) }, CALENDAR);
    assertEquals(nominal.getCurrency(), FRN_DEFINITION.getNominal().getCurrency());
    assertEquals(nominal.getNthPayment(0).getPaymentDate(), FRN_DEFINITION.getNominal().getNthPayment(0).getPaymentDate());
    assertEquals(nominal.getNthPayment(0).getReferenceAmount(), FRN_DEFINITION.getNominal().getNthPayment(0).getReferenceAmount());
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

  /**
   * Tests the bond constructors.
   */
  public void constructorBondsWithFirstCouponDate() {
    // Nominal construction
    final PaymentFixedDefinition nominalPayment = new PaymentFixedDefinition(PRICE_INDEX_UKRPI.getCurrency(), BUSINESS_DAY_GBP.adjustDate(CALENDAR_GBP, MATURITY_DATE_1), NOTIONAL_1);
    final AnnuityDefinition<PaymentFixedDefinition> nominalAnnuity = new AnnuityDefinition<>(new PaymentFixedDefinition[] {nominalPayment }, CALENDAR_GBP);
    // Coupon construction
    final ZonedDateTime[] paymentDatesUnadjusted = ScheduleCalculator.getUnadjustedDateSchedule(FIRST_COUPON_DATE_1, MATURITY_DATE_1, COUPON_PERIOD_1,
        true, false);
    final ZonedDateTime[] paymentDates = ScheduleCalculator.getAdjustedDateSchedule(paymentDatesUnadjusted, BUSINESS_DAY_GBP, CALENDAR_GBP, false);
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

  /**
   * Tests the bond constructors.
   */
  public void constructorBondsWithoutFirstCouponDate() {
    // Nominal construction
    final PaymentFixedDefinition nominalPayment = new PaymentFixedDefinition(PRICE_INDEX_UKRPI.getCurrency(), BUSINESS_DAY_GBP.adjustDate(CALENDAR_GBP, MATURITY_DATE_1), NOTIONAL_1);
    final AnnuityDefinition<PaymentFixedDefinition> nominalAnnuity = new AnnuityDefinition<>(new PaymentFixedDefinition[] {nominalPayment }, CALENDAR_GBP);
    // Coupon construction
    final ZonedDateTime[] paymentDatesUnadjusted = ScheduleCalculator.getUnadjustedDateSchedule(START_DATE_1, MATURITY_DATE_1, COUPON_PERIOD_1,
        true, false);
    final ZonedDateTime[] paymentDates = ScheduleCalculator.getAdjustedDateSchedule(paymentDatesUnadjusted, BUSINESS_DAY_GBP, CALENDAR_GBP, false);
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

    final double factorSpot = DAY_COUNT_1.getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(), spot, couponDefinition.getNthPayment(0)
        .getAccrualEndDate(), 1.0, COUPON_PER_YEAR_1);
    final double factorPeriod = DAY_COUNT_1.getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(), couponDefinition.getNthPayment(0)
        .getAccrualEndDate(), couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, COUPON_PER_YEAR_1);
    final double factorToNextCoupon = (factorPeriod - factorSpot) / factorPeriod;
    final PaymentFixedDefinition nominalLast = bondFromDefinition.getNominal().getNthPayment(bondFromDefinition.getNominal().getNumberOfPayments() - 1);
    final ZonedDateTime settlementDate2 = spot;
    final double notional = 1.0;
    final PaymentFixedDefinition settlementDefinition = new PaymentFixedDefinition(nominalLast.getCurrency(), settlementDate2, notional);
    final PaymentFixed settlement = settlementDefinition.toDerivative(pricingDate);
    final BondInterestIndexedSecurity<PaymentFixed, Coupon> bondSecurityExpected = new BondInterestIndexedSecurity<>(nominal, coupon, settleTime, accruedInterest,
        factorToNextCoupon, YIELD_CONVENTION_1, COUPON_PER_YEAR_1, settlement, ISSUER_UK, PRICE_INDEX_UKRPI);
    assertEquals("Interest Index Bond: toDerivative", bondSecurityExpected, bond);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testPositiveNominal() {
    final AnnuityCouponFixedDefinition coupon = AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, START_ACCRUAL_DATE, MATURITY_DATE, PAYMENT_TENOR, true, true,
        CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, 1.0, RATE, false);
    final AnnuityPaymentFixedDefinition nominal = new AnnuityPaymentFixedDefinition(new PaymentFixedDefinition[] {new PaymentFixedDefinition(CUR, MATURITY_DATE, -1.0)}, CALENDAR);
    new BondFixedSecurityDefinition(nominal, coupon, 0, SETTLEMENT_DAYS, CALENDAR, DAY_COUNT, YIELD_CONVENTION, IS_EOM, ISSUER_NAME);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testPositiveCoupon() {
    final AnnuityCouponFixedDefinition coupon = AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, START_ACCRUAL_DATE, MATURITY_DATE, PAYMENT_TENOR, true, true,
        CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, 1.0, RATE, true);
    final AnnuityPaymentFixedDefinition nominal = new AnnuityPaymentFixedDefinition(new PaymentFixedDefinition[] {new PaymentFixedDefinition(CUR, MATURITY_DATE, 1.0) }, CALENDAR);
    new BondFixedSecurityDefinition(nominal, coupon, 0, SETTLEMENT_DAYS, CALENDAR, DAY_COUNT, YIELD_CONVENTION, IS_EOM, ISSUER_NAME);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

    assertEquals(0, BOND_SECURITY_DEFINITION.getExCouponDays()); //Default
    assertEquals(CUR, BOND_SECURITY_DEFINITION.getCurrency());
    final AnnuityCouponFixedDefinition coupon = AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, START_ACCRUAL_DATE, MATURITY_DATE, PAYMENT_TENOR, true, true,
        CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, 1.0, RATE, false);
    assertEquals(coupon, BOND_SECURITY_DEFINITION.getCoupons());
    final AnnuityDefinition<PaymentFixedDefinition> nominal = new AnnuityDefinition<>(new PaymentFixedDefinition[] {new PaymentFixedDefinition(CUR,
        BUSINESS_DAY.adjustDate(CALENDAR, MATURITY_DATE), 1.0) }, CALENDAR);
    assertEquals(nominal.getCurrency(), BOND_SECURITY_DEFINITION.getNominal().getCurrency());
    assertEquals(nominal.getNthPayment(0).getPaymentDate(), BOND_SECURITY_DEFINITION.getNominal().getNthPayment(0).getPaymentDate());
    assertEquals(nominal.getNthPayment(0).getReferenceAmount(), BOND_SECURITY_DEFINITION.getNominal().getNthPayment(0).getReferenceAmount());
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

    new ForexDefinition(CUR_1, CUR_2, PAYMENT_DATE, NOMINAL_1, -FX_RATE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void wrongSign() {
    new ForexDefinition(PAY_1, new PaymentFixedDefinition(CUR_2, PAYMENT_DATE, NOMINAL_1 * FX_RATE));
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

    assertEquals("ForexDefinition getter", CUR_1, FX.getCurrency1());
    assertEquals(CUR_2, FX.getCurrency2());
    assertEquals(PAYMENT_DATE, FX.getExchangeDate());
    assertEquals(NOMINAL_1, FX.getPaymentCurrency1().getReferenceAmount());
    assertEquals(-NOMINAL_1 * FX_RATE, FX.getPaymentCurrency2().getReferenceAmount());
    assertEquals(new PaymentFixedDefinition(CUR_1, PAYMENT_DATE, NOMINAL_1), FX.getPaymentCurrency1());
    assertEquals(new PaymentFixedDefinition(CUR_2, PAYMENT_DATE, -NOMINAL_1 * FX_RATE), FX.getPaymentCurrency2());
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.payment.PaymentFixedDefinition

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testPositiveNominal() {
    final AnnuityCouponIborDefinition coupon = AnnuityCouponIborDefinition.fromAccrualUnadjusted(START_ACCRUAL_DATE, MATURITY_DATE, 1.0, IBOR_INDEX, false, CALENDAR);
    final AnnuityPaymentFixedDefinition nominal = new AnnuityPaymentFixedDefinition(new PaymentFixedDefinition[] {new PaymentFixedDefinition(CUR, MATURITY_DATE, -1.0) }, CALENDAR);
    new BondIborSecurityDefinition(nominal, coupon, 0, SETTLEMENT_DAYS, CALENDAR, DAY_COUNT, ISSUER_NAME);
  }
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.