Examples of SwapFuturesPriceDeliverableSecurity


Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

  @Override
  public SwapFuturesPriceDeliverableSecurity toDerivative(final ZonedDateTime date, final String... yieldCurveNames) {
    final double lastTradingTime = TimeCalculator.getTimeBetween(date, _lastTradingDate);
    final double deliveryTime = TimeCalculator.getTimeBetween(date, _deliveryDate);
    final SwapFixedCoupon<? extends Coupon> underlyingSwap = _underlyingSwap.toDerivative(date, yieldCurveNames);
    return new SwapFuturesPriceDeliverableSecurity(lastTradingTime, deliveryTime, underlyingSwap, _notional);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

  @Override
  public SwapFuturesPriceDeliverableSecurity toDerivative(final ZonedDateTime date) {
    final double lastTradingTime = TimeCalculator.getTimeBetween(date, _lastTradingDate);
    final double deliveryTime = TimeCalculator.getTimeBetween(date, _deliveryDate);
    final SwapFixedCoupon<? extends Coupon> underlyingSwap = _underlyingSwap.toDerivative(date);
    return new SwapFuturesPriceDeliverableSecurity(lastTradingTime, deliveryTime, underlyingSwap, _notional);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

    if (transactionDateLocal.isBefore(date)) { // Transaction was before last margining.
      referencePrice = lastMarginPrice;
    } else { // Transaction is today
      referencePrice = _transactionPrice;
    }
    final SwapFuturesPriceDeliverableSecurity underlying = _underlying.toDerivative(dateTime, yieldCurveNames);
    final SwapFuturesPriceDeliverableTransaction future = new SwapFuturesPriceDeliverableTransaction(underlying, referencePrice, _quantity);
    return future;
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

    if (transactionDateLocal.isBefore(date)) { // Transaction was before last margining.
      referencePrice = lastMarginPrice;
    } else { // Transaction is today
      referencePrice = _transactionPrice;
    }
    final SwapFuturesPriceDeliverableSecurity underlying = _underlying.toDerivative(dateTime);
    final SwapFuturesPriceDeliverableTransaction future = new SwapFuturesPriceDeliverableTransaction(underlying, referencePrice, _quantity);
    return future;
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

   * Tests the toDerivative method.
   */
  public void toDerivativeOnTradeDate() {
    final ZonedDateTime referenceDate = TRAN_DATE;
    final double lastMargin = 0.99 + 1.0 / 32.0 / 100.0;
    final SwapFuturesPriceDeliverableSecurity underlying = SWAP_FUTURES_SECURITY_DEFINITION.toDerivative(referenceDate);
    final SwapFuturesPriceDeliverableTransaction derivativeExpected = new SwapFuturesPriceDeliverableTransaction(underlying, TRAN_PRICE, QUANTITY);
    final SwapFuturesPriceDeliverableTransaction derivativeConverted = SWAP_FUTURES_TRANSACTION_DEFINITION.toDerivative(referenceDate, lastMargin);
    assertEquals("DeliverableSwapFuturesTransactionDefinition: toDerivative", derivativeExpected, derivativeConverted);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

   * Tests the toDerivative method.
   */
  public void toDerivativeAfterTradeDate() {
    final ZonedDateTime referenceDate = ScheduleCalculator.getAdjustedDate(TRAN_DATE, 1, NYC);
    final double lastMargin = 0.99080;
    final SwapFuturesPriceDeliverableSecurity underlying = SWAP_FUTURES_SECURITY_DEFINITION.toDerivative(referenceDate);
    final SwapFuturesPriceDeliverableTransaction derivativeExpected = new SwapFuturesPriceDeliverableTransaction(underlying, lastMargin, QUANTITY);
    final SwapFuturesPriceDeliverableTransaction derivativeConverted = SWAP_FUTURES_TRANSACTION_DEFINITION.toDerivative(referenceDate, lastMargin);
    assertEquals("DeliverableSwapFuturesTransactionDefinition: toDerivative", derivativeExpected, derivativeConverted);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

    final String fwd3Name = "USD Forward 3M";
    final String[] curveNames = {dscName, fwd3Name };
    final SwapFixedCoupon<? extends Coupon> underlying = SWAP_DEFINITION.toDerivative(referenceDate, curveNames);
    final double expiryTime = TimeCalculator.getTimeBetween(referenceDate, LAST_TRADING_DATE);
    final double deliveryTime = TimeCalculator.getTimeBetween(referenceDate, EFFECTIVE_DATE);
    final SwapFuturesPriceDeliverableSecurity futuresExpected = new SwapFuturesPriceDeliverableSecurity(expiryTime, deliveryTime, underlying, NOTIONAL);
    final SwapFuturesPriceDeliverableSecurity futuresConverted = SWAP_FUTURES_SECURITY_DEFINITION.toDerivative(referenceDate, curveNames);
    assertEquals("DeliverableSwapFuturesSecurityDefinition: toDerivative", futuresExpected, futuresConverted);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity

  public void toDerivative() {
    final ZonedDateTime referenceDate = DateUtils.getUTCDate(2012, 9, 21);
    final SwapFixedCoupon<? extends Coupon> underlying = SWAP_DEFINITION.toDerivative(referenceDate);
    final double expiryTime = TimeCalculator.getTimeBetween(referenceDate, LAST_TRADING_DATE);
    final double deliveryTime = TimeCalculator.getTimeBetween(referenceDate, EFFECTIVE_DATE);
    final SwapFuturesPriceDeliverableSecurity futuresExpected = new SwapFuturesPriceDeliverableSecurity(expiryTime, deliveryTime, underlying, NOTIONAL);
    final SwapFuturesPriceDeliverableSecurity futuresConverted = SWAP_FUTURES_SECURITY_DEFINITION.toDerivative(referenceDate);
    assertEquals("DeliverableSwapFuturesSecurityDefinition: toDerivative", futuresExpected, futuresConverted);
  }
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.