Examples of PaymentFixed


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

   */
  @Test
  public void toDerivativeAfterSettle() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 6, 20);
    final BondFutureOptionPremiumTransaction transactionConverted = FVU1_C120_TR_DEFINITION.toDerivative(referenceDate);
    final PaymentFixed premium = new PaymentFixed(FVU1_C120_TR_DEFINITION.getCurrency(), 0.0, 0.0);
    final BondFutureOptionPremiumTransaction transactionExpected = new BondFutureOptionPremiumTransaction(FVU1_C120_SEC_DEFINITION.toDerivative(referenceDate), QUANTITY, premium);
    assertEquals("Bond future option premium security definition: toDerivative", transactionExpected, transactionConverted);
  }
View Full Code Here

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

  public void testToDerivativeDeprecated() {
    final DayCount actAct = DayCountFactory.INSTANCE.getDayCount("Actual/Actual ISDA");
    final ZonedDateTime zonedDate = ZonedDateTime.of(LocalDateTime.of(REFERENCE_DATE.toLocalDate(), LocalTime.MIDNIGHT), ZoneOffset.UTC);
    final double paymentTime = actAct.getDayCountFraction(zonedDate, PAYMENT_DATE);
    final String fundingCurve = "Funding";
    final PaymentFixed paymentFixed = new PaymentFixed(CUR, paymentTime, AMOUNT, fundingCurve);
    final PaymentFixed convertedDefinition = FIXED_PAYMENT.toDerivative(REFERENCE_DATE, fundingCurve);
    assertEquals(paymentFixed, convertedDefinition);
  }
View Full Code Here

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

  @Test
  public void testToDerivative() {
    final DayCount actAct = DayCountFactory.INSTANCE.getDayCount("Actual/Actual ISDA");
    final ZonedDateTime zonedDate = ZonedDateTime.of(LocalDateTime.of(REFERENCE_DATE.toLocalDate(), LocalTime.MIDNIGHT), ZoneOffset.UTC);
    final double paymentTime = actAct.getDayCountFraction(zonedDate, PAYMENT_DATE);
    final PaymentFixed paymentFixed = new PaymentFixed(CUR, paymentTime, AMOUNT);
    final PaymentFixed convertedDefinition = FIXED_PAYMENT.toDerivative(REFERENCE_DATE);
    assertEquals(paymentFixed, convertedDefinition);
  }
View Full Code Here

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

    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.interestrate.payments.derivative.PaymentFixed

    assertTrue(FX.equals(FX));
    final Forex newFx = new Forex(PAY_1, PAY_2);
    assertTrue(FX.equals(newFx));
    assertTrue(FX.hashCode() == newFx.hashCode());
    Forex modifiedFx;
    final PaymentFixed payModified1 = new PaymentFixed(CUR_1, PAYMENT_TIME, NOMINAL_1 * 10.0, DISCOUNTING_CURVE_NAME_CUR_1);
    final PaymentFixed payModified2 = new PaymentFixed(CUR_2, PAYMENT_TIME, -NOMINAL_1 * 10.0, DISCOUNTING_CURVE_NAME_CUR_2);
    modifiedFx = new Forex(payModified1, PAY_2);
    assertFalse(FX.equals(modifiedFx));
    modifiedFx = new Forex(PAY_1, payModified2);
    assertFalse(FX.equals(modifiedFx));
    assertFalse(FX.equals(CUR_1));
View Full Code Here

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

    assertTrue(FX.equals(FX));
    final Forex newFx = new Forex(PAY_1, PAY_2);
    assertTrue(FX.equals(newFx));
    assertTrue(FX.hashCode() == newFx.hashCode());
    Forex modifiedFx;
    final PaymentFixed payModified1 = new PaymentFixed(CUR_1, PAYMENT_TIME, NOMINAL_1 * 10.0);
    final PaymentFixed payModified2 = new PaymentFixed(CUR_2, PAYMENT_TIME, -NOMINAL_1 * 10.0);
    modifiedFx = new Forex(payModified1, PAY_2);
    assertFalse(FX.equals(modifiedFx));
    modifiedFx = new Forex(PAY_1, payModified2);
    assertFalse(FX.equals(modifiedFx));
    assertFalse(FX.equals(CUR_1));
View Full Code Here

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

    final double ramp = 0.0025;
    final CouponFixed[] coupons = new CouponFixed[n];
    for (int i = 0; i < n; i++) {
      coupons[i] = new CouponFixed(CUR, tau * (i + 1), FUNDING_CURVE_NAME, yearFrac, initialCoupon + i * ramp);
    }
    final AnnuityPaymentFixed nominal = new AnnuityPaymentFixed(new PaymentFixed[] {new PaymentFixed(CUR, tau * n, 1, FUNDING_CURVE_NAME) });
    final BondFixedSecurity bond = new BondFixedSecurity(nominal, new AnnuityCouponFixed(coupons), 0, 0, 0.5, SimpleYieldConvention.TRUE, 2, FUNDING_CURVE_NAME, "S");
    doTest(bond, CURVES);
    final BondFixedTransaction trade = new BondFixedTransaction(bond, 100, 100, bond, 90);
    doTest(trade, CURVES);
  }
View Full Code Here

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

    final String discountingEUR = "Discounting EUR";
    final String discountingUSD = "Discounting USD";
    final String[] curves = new String[] {discountingEUR, discountingUSD};
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 5, 20);
    final Forex fxConverted = FX.toDerivative(referenceDate, curves);
    final PaymentFixed pay1 = PAY_1.toDerivative(referenceDate, discountingEUR);
    final PaymentFixed pay2 = PAY_2.toDerivative(referenceDate, discountingUSD);
    final Forex fxComparison = new Forex(pay1, pay2);
    assertEquals(fxComparison, fxConverted);
  }
View Full Code Here

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

   * Tests the conversion to derivative.
   */
  public void toDerivative() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 5, 20);
    final Forex fxConverted = FX.toDerivative(referenceDate);
    final PaymentFixed pay1 = PAY_1.toDerivative(referenceDate);
    final PaymentFixed pay2 = PAY_2.toDerivative(referenceDate);
    final Forex fxComparison = new Forex(pay1, pay2);
    assertEquals(fxComparison, fxConverted);
  }
View Full Code Here

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

   * @return
   */
  //TODO determine domestic and notional from dominance data
  private static ForexForward getFXForward(final Currency ccy1, final Currency ccy2, final double paymentTime, final double spotFX, final double forwardFX,
      final String curveName1, final String curveName2) {
    final PaymentFixed paymentCurrency1 = new PaymentFixed(ccy1, paymentTime, 1, curveName1);
    final PaymentFixed paymentCurrency2 = new PaymentFixed(ccy2, paymentTime, -1. / forwardFX, curveName2);
    return new ForexForward(paymentCurrency1, paymentCurrency2, spotFX);
  }
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.