Package com.opengamma.analytics.financial.instrument.cash

Examples of com.opengamma.analytics.financial.instrument.cash.DepositZeroDefinition.toDerivative()


  public void parSpreadTrade() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 12);
    final DepositZero deposit = DEPOSIT_DEFINITION.toDerivative(referenceDate, CURVES_NAME[0]);
    final double psMethod = METHOD_DEPOSIT.parSpread(deposit, CURVES);
    final DepositZeroDefinition deposit0Definition = new DepositZeroDefinition(EUR, SPOT_DATE, END_DATE, NOTIONAL, DEPOSIT_AF, new PeriodicInterestRate(RATE_FIGURE + psMethod, 1));
    final DepositZero deposit0 = deposit0Definition.toDerivative(referenceDate, CURVES_NAME[0]);
    final CurrencyAmount pv0 = METHOD_DEPOSIT.presentValue(deposit0, CURVES);
    assertEquals("DepositZero: par spread", 0, pv0.getAmount(), TOLERANCE_PRICE);
    final double psCalculator = deposit.accept(PSC, CURVES);
    assertEquals("DepositZero: par rate", psMethod, psCalculator, TOLERANCE_RATE);
  }
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.