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

Examples of com.opengamma.analytics.financial.interestrate.cash.derivative.DepositIbor


  @Override
  public DepositIbor toDerivative(final ZonedDateTime date, final String... yieldCurveNames) {
    ArgumentChecker.isTrue(!date.isAfter(getEndDate()), "date is after end date");
    final double startTime = TimeCalculator.getTimeBetween(date, getStartDate());
    if (startTime < 0) {
      return new DepositIbor(getCurrency(), 0, TimeCalculator.getTimeBetween(date, getEndDate()), getNotional(), 0, getRate(), getAccrualFactor(), _index,
          yieldCurveNames[0]);
    }
    return new DepositIbor(getCurrency(), startTime, TimeCalculator.getTimeBetween(date, getEndDate()), getNotional(), getNotional(), getRate(), getAccrualFactor(),
        _index, yieldCurveNames[0]);
  }
View Full Code Here


  @Override
  public DepositIbor toDerivative(final ZonedDateTime date) {
    ArgumentChecker.isTrue(!date.isAfter(getEndDate()), "date is after end date");
    final double startTime = TimeCalculator.getTimeBetween(date, getStartDate());
    if (startTime < 0) {
      return new DepositIbor(getCurrency(), 0, TimeCalculator.getTimeBetween(date, getEndDate()), getNotional(), 0, getRate(), getAccrualFactor(), _index);
    }
    return new DepositIbor(getCurrency(), startTime, TimeCalculator.getTimeBetween(date, getEndDate()), getNotional(), getNotional(), getRate(), getAccrualFactor(),
        _index);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeTradeDeprecated() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 12);
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate, CURVE_NAME);
    final double startTime = TimeCalculator.getTimeBetween(referenceDate, SPOT_DATE);
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, NOTIONAL, RATE, DEPOSIT_AF, INDEX, CURVE_NAME);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeBetweenTradeAndSettleDeprecated() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 13);
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate, CURVE_NAME);
    final double startTime = TimeCalculator.getTimeBetween(referenceDate, SPOT_DATE);
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, NOTIONAL, RATE, DEPOSIT_AF, INDEX, CURVE_NAME);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeSettleDeprecated() {
    final ZonedDateTime referenceDate = SPOT_DATE;
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate, CURVE_NAME);
    final double startTime = TimeCalculator.getTimeBetween(referenceDate, SPOT_DATE);
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, NOTIONAL, RATE, DEPOSIT_AF, INDEX, CURVE_NAME);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeBetweenSettleMaturityDeprecated() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 20);
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate, CURVE_NAME);
    final double startTime = 0;
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, 0, RATE, DEPOSIT_AF, INDEX, CURVE_NAME);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeMaturityDeprecated() {
    final ZonedDateTime referenceDate = END_DATE;
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate, CURVE_NAME);
    final double startTime = 0;
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, 0, RATE, DEPOSIT_AF, INDEX, CURVE_NAME);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeTrade() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 12);
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate);
    final double startTime = TimeCalculator.getTimeBetween(referenceDate, SPOT_DATE);
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, NOTIONAL, RATE, DEPOSIT_AF, INDEX);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeBetweenTradeAndSettle() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 13);
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate);
    final double startTime = TimeCalculator.getTimeBetween(referenceDate, SPOT_DATE);
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, NOTIONAL, RATE, DEPOSIT_AF, INDEX);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

  /**
   * Tests toDerivative.
   */
  public void toDerivativeSettle() {
    final ZonedDateTime referenceDate = SPOT_DATE;
    final DepositIbor converted = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate);
    final double startTime = TimeCalculator.getTimeBetween(referenceDate, SPOT_DATE);
    final double endTime = TimeCalculator.getTimeBetween(referenceDate, END_DATE);
    final DepositIbor expected = new DepositIbor(EUR, startTime, endTime, NOTIONAL, NOTIONAL, RATE, DEPOSIT_AF, INDEX);
    assertEquals("DepositDefinition: toDerivative", expected, converted);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.interestrate.cash.derivative.DepositIbor

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.