Examples of InterestRateFutureOptionMarginTransaction


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

  @Test
  public void toDerivativeTradeInPast() {
    final InterestRateFutureOptionMarginSecurity securityConverted = OPTION_ERU2.toDerivative(REFERENCE_DATE);
    final double lastMarginPrice = 0.99;
    final InterestRateFutureOptionMarginTransaction transactionConverted = OPTION_TRANSACTION.toDerivative(REFERENCE_DATE, lastMarginPrice);
    final InterestRateFutureOptionMarginTransaction transaction = new InterestRateFutureOptionMarginTransaction(securityConverted, QUANTITY, lastMarginPrice);
    assertTrue("Conversion with trade date in the past", transactionConverted.equals(transaction));
  }
View Full Code Here

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

  @Test
  public void toDerivativeTradeToday() {
    final ZonedDateTime referenceDate = TRADE_DATE;
    final InterestRateFutureOptionMarginSecurity securityConverted = OPTION_ERU2.toDerivative(referenceDate);
    final double lastMarginPrice = 0.99;
    final InterestRateFutureOptionMarginTransaction transactionConverted = OPTION_TRANSACTION.toDerivative(referenceDate, lastMarginPrice);
    final InterestRateFutureOptionMarginTransaction transaction = new InterestRateFutureOptionMarginTransaction(securityConverted, QUANTITY, TRADE_PRICE);
    assertTrue("Conversion with trade date in the past", transactionConverted.equals(transaction));
  }
View Full Code Here

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

  @SuppressWarnings("deprecation")
  @Test
  public void toDerivativeTradeInPastDeprecated() {
    final InterestRateFutureOptionMarginSecurity securityConverted = OPTION_ERU2.toDerivative(REFERENCE_DATE, CURVES_NAMES);
    final double lastMarginPrice = 0.99;
    final InterestRateFutureOptionMarginTransaction transactionConverted = OPTION_TRANSACTION.toDerivative(REFERENCE_DATE, lastMarginPrice, CURVES_NAMES);
    final InterestRateFutureOptionMarginTransaction transaction = new InterestRateFutureOptionMarginTransaction(securityConverted, QUANTITY, lastMarginPrice);
    assertTrue("Conversion with trade date in the past", transactionConverted.equals(transaction));
  }
View Full Code Here

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

  @Test
  public void toDerivativeTradeTodayDeprecated() {
    final ZonedDateTime referenceDate = TRADE_DATE;
    final InterestRateFutureOptionMarginSecurity securityConverted = OPTION_ERU2.toDerivative(referenceDate, CURVES_NAMES);
    final double lastMarginPrice = 0.99;
    final InterestRateFutureOptionMarginTransaction transactionConverted = OPTION_TRANSACTION.toDerivative(referenceDate, lastMarginPrice, CURVES_NAMES);
    final InterestRateFutureOptionMarginTransaction transaction = new InterestRateFutureOptionMarginTransaction(securityConverted, QUANTITY, TRADE_PRICE);
    assertTrue("Conversion with trade date in the past", transactionConverted.equals(transaction));
  }
View Full Code Here

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

  /**
   * Test the present value from the quoted option price.
   */
  public void presentValueFromOptionPrice() {
    final double priceQuoted = 0.01;
    final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, TRADE_PRICE);
    final MultipleCurrencyAmount pv = METHOD_SABR_TRA.presentValueFromPrice(transactionNoPremium, priceQuoted);
    final double pvExpected = (priceQuoted - TRADE_PRICE) * QUANTITY * NOTIONAL * FUTURE_FACTOR;
    assertEquals("Future option: present value from quoted price", pvExpected, pv.getAmount(EUR), TOLERANCE_PV);
  }
View Full Code Here

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

  /**
   * Test the present value from the future price.
   */
  public void presentValueFromFuturePrice() {
    final double priceFuture = 0.9905;
    final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, TRADE_PRICE);
    final MultipleCurrencyAmount pv = METHOD_SABR_TRA.presentValueFromFuturePrice(transactionNoPremium, SABR_MULTICURVES, priceFuture);
    final double priceSecurity = METHOD_SABR_SEC.priceFromFuturePrice(OPTION_EDU2, SABR_MULTICURVES, priceFuture);
    final double pvExpected = (priceSecurity - TRADE_PRICE) * QUANTITY * NOTIONAL * FUTURE_FACTOR;
    assertEquals("Future option: present value from future price", pvExpected, pv.getAmount(EUR), TOLERANCE_PV);
  }
View Full Code Here

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

  /**
   * Test the present value from the future price.
   */
  public void presentValue() {
    final double priceFuture = METHOD_FUT.price(EDU2, MULTICURVES);
    final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, TRADE_PRICE);
    final double pvNoPremium = METHOD_SABR_TRA.presentValue(transactionNoPremium, SABR_MULTICURVES).getAmount(EUR);
    final double pvNoPremiumExpected = METHOD_SABR_TRA.presentValueFromFuturePrice(transactionNoPremium, SABR_MULTICURVES, priceFuture).getAmount(EUR);
    assertEquals("Future option: present value", pvNoPremiumExpected, pvNoPremium, TOLERANCE_PV);
  }
View Full Code Here

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

  @Test
  /**
   * Test the present value from the method and from the calculator.
   */
  public void presentValueMethodVsCalculator() {
    final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, 0.0);
    final MultipleCurrencyAmount pvNoPremiumMethod = METHOD_SABR_TRA.presentValue(transactionNoPremium, SABR_MULTICURVES);
    final MultipleCurrencyAmount pvNoPremiumCalculator = transactionNoPremium.accept(PVSFC, SABR_MULTICURVES);
    assertEquals("Future option: present value: Method vs Calculator", pvNoPremiumMethod.getAmount(EUR), pvNoPremiumCalculator.getAmount(EUR), TOLERANCE_PV);
  }
View Full Code Here

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

    final InterestRateCurveSensitivity pvcsMethod = METHOD_TRANSACTION_OPTION_BLACK.presentValueCurveSensitivity(TRANSACTION_1, BLACK_BUNDLE);
    pvcsMethod.cleaned();
    // 1. Forward curve sensitivity
    final String bumpedCurveName = "Bumped Curve";
    final String[] curvesBumpedForward = new String[] {CURVE_NAMES[0], bumpedCurveName};
    final InterestRateFutureOptionMarginTransaction transactionBumped = TRANSACTION_1_DEFINITION.toDerivative(REFERENCE_DATE, TRADE_PRICE, curvesBumpedForward);
    final double[] nodeTimesForward = new double[] {ERU2.getFixingPeriodStartTime(), ERU2.getFixingPeriodEndTime()};
    final double[] sensiForwardMethod = SensitivityFiniteDifference.curveSensitivity(transactionBumped, BLACK_BUNDLE, CURVE_NAMES[1], bumpedCurveName, nodeTimesForward, DELTA_SHIFT,
        METHOD_TRANSACTION_OPTION_BLACK);
    assertEquals("Sensitivity finite difference method: number of node", 2, sensiForwardMethod.length);
    final List<DoublesPair> sensiPvForward = pvcsMethod.getSensitivities().get(CURVE_NAMES[1]);
View Full Code Here

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

  /**
   * Test the present value from the quoted option price.
   */
  public void presentValueFromOptionPrice() {
    final double priceQuoted = 0.01;
    final InterestRateFutureOptionMarginTransaction transactionNoPremium = new InterestRateFutureOptionMarginTransaction(OPTION_EDU2, QUANTITY, TRADE_PRICE);
    final double pv = METHOD.presentValueFromPrice(transactionNoPremium, priceQuoted).getAmount();
    final double pvExpected = (priceQuoted - TRADE_PRICE) * QUANTITY * NOTIONAL * FUTURE_FACTOR;
    assertEquals("Future option: present value from quoted price", pvExpected, pv);
  }
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.