Package com.opengamma.analytics.financial.instrument.index

Examples of com.opengamma.analytics.financial.instrument.index.GeneratorDeposit


    assertEquals(FIXED_COUPON.getAmount(), RATE * NOTIONAL * ACCRUAL_FACTOR, 1E-10);
  }

  @Test
  public void fromGeneratorDeposit() {
    final GeneratorDeposit generator = new USDDeposit(CALENDAR);
    final Period tenor = Period.ofMonths(3);
    final CouponFixedDefinition cpnFixed = CouponFixedDefinition.from(ACCRUAL_START_DATE, tenor, generator, NOTIONAL, RATE);
    final ZonedDateTime endDate = ScheduleCalculator.getAdjustedDate(ACCRUAL_START_DATE, tenor, generator.getBusinessDayConvention(), CALENDAR, generator.isEndOfMonth());
    final double accrual = generator.getDayCount().getDayCountFraction(ACCRUAL_START_DATE, endDate);
    final CouponFixedDefinition cpnExpected = new CouponFixedDefinition(generator.getCurrency(), endDate, ACCRUAL_START_DATE, endDate, accrual, NOTIONAL, RATE);
    assertEquals("CouponFixedDefinition: from deposit generator", cpnExpected, cpnFixed);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.instrument.index.GeneratorDeposit

Copyright © 2018 www.massapicom. 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.