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

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


      referencePrice = lastMarginPrice;
    } else { // Transaction is today
      referencePrice = _transactionPrice;
    }
    final InterestRateFutureSecurity underlying = _underlying.toDerivative(dateTime, yieldCurveNames);
    final InterestRateFutureTransaction future = new InterestRateFutureTransaction(underlying, referencePrice, _quantity);
    return future;
  }
View Full Code Here


      referencePrice = lastMarginPrice;
    } else { // Transaction is today
      referencePrice = _transactionPrice;
    }
    final InterestRateFutureSecurity underlying = _underlying.toDerivative(dateTime);
    final InterestRateFutureTransaction future = new InterestRateFutureTransaction(underlying, referencePrice, _quantity);
    return future;
  }
View Full Code Here

    return new SwapFixedCoupon<>(visitFixedCouponAnnuity(swap.getFixedLeg(), rate), swap.getSecondLeg());
  }

  @Override
  public InterestRateFutureTransaction visitInterestRateFutureTransaction(final InterestRateFutureTransaction security, final Double rate) {
    return new InterestRateFutureTransaction(security.getLastTradingTime(), security.getIborIndex(), security.getFixingPeriodStartTime(), security.getFixingPeriodEndTime(),
        security.getFixingPeriodAccrualFactor(), 1 - rate, security.getNotional(), security.getPaymentAccrualFactor(), security.getQuantity(), security.getName(), security.getDiscountingCurveName(),
        security.getForwardCurveName());
  }
View Full Code Here

    return new SwapFixedCoupon<>(visitFixedCouponAnnuity(swap.getFixedLeg(), rate), swap.getSecondLeg());
  }

  @Override
  public InterestRateFutureTransaction visitInterestRateFutureTransaction(final InterestRateFutureTransaction security, final Double rate) {
    return new InterestRateFutureTransaction(security.getLastTradingTime(), security.getIborIndex(), security.getFixingPeriodStartTime(), security.getFixingPeriodEndTime(),
        security.getFixingPeriodAccrualFactor(), 1 - rate, security.getNotional(), security.getPaymentAccrualFactor(), security.getQuantity(), security.getName());
  }
View Full Code Here

  public void toDerivativeDeprecated() {
    final double lastTradingTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, LAST_TRADING_DATE);
    final double fixingStartTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, SPOT_LAST_TRADING_DATE);
    final double fixingEndTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, FIXING_END_DATE);
    final double fixingAccrual = IBOR_INDEX.getDayCount().getDayCountFraction(SPOT_LAST_TRADING_DATE, FIXING_END_DATE);
    final InterestRateFutureTransaction ERU2 = new InterestRateFutureTransaction(lastTradingTime, IBOR_INDEX, fixingStartTime, fixingEndTime, fixingAccrual, TRADE_PRICE, NOTIONAL, FUTURE_FACTOR,
        QUANTITY, NAME, DISCOUNTING_CURVE_NAME, FORWARD_CURVE_NAME);
    final InterestRateFutureTransaction convertedERU2 = ERU2_DEFINITION.toDerivative(REFERENCE_DATE, TRADE_PRICE, CURVES);
    assertTrue("Rate future security converter", ERU2.equals(convertedERU2));
  }
View Full Code Here

  public void toDerivative() {
    final double lastTradingTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, LAST_TRADING_DATE);
    final double fixingStartTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, SPOT_LAST_TRADING_DATE);
    final double fixingEndTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, FIXING_END_DATE);
    final double fixingAccrual = IBOR_INDEX.getDayCount().getDayCountFraction(SPOT_LAST_TRADING_DATE, FIXING_END_DATE);
    final InterestRateFutureTransaction ERU2 = new InterestRateFutureTransaction(lastTradingTime, IBOR_INDEX, fixingStartTime, fixingEndTime, fixingAccrual, TRADE_PRICE, NOTIONAL, FUTURE_FACTOR,
        QUANTITY, NAME);
    final InterestRateFutureTransaction convertedERU2 = ERU2_DEFINITION.toDerivative(REFERENCE_DATE, TRADE_PRICE);
    assertTrue("Rate future security converter", ERU2.equals(convertedERU2));
  }
View Full Code Here

    final double fixingPeriodStartTime = 1.467;
    final double fixingPeriodEndTime = 1.75;
    final double fixingPeriodAccrualFactor = 0.267;
    final double paymentAccrualFactor = 0.25;
    final int quantity = 123;
    final InterestRateFutureTransaction ir1 = new InterestRateFutureTransaction(lastTradingTime, iborIndex, fixingPeriodStartTime, fixingPeriodEndTime, fixingPeriodAccrualFactor, 1 - R1, 1, paymentAccrualFactor, quantity,
        "K");
    final InterestRateFutureTransaction ir2 = new InterestRateFutureTransaction(lastTradingTime, iborIndex, fixingPeriodStartTime, fixingPeriodEndTime, fixingPeriodAccrualFactor, 1 - R2, 1, paymentAccrualFactor, quantity,
        "K");
    assertEquals(ir1.accept(VISITOR, R2), ir2);
  }
View Full Code Here

    return new ForwardRateAgreement(DUMMY_CUR, time - tau, tau, notional, DUMMY_INDEX, time - tau, time - tau, time, tau, rate);
  }

  public static InstrumentDerivative makeFuture(final double time, final SimpleFrequency paymentFreq) {
    final double tau = 1. / paymentFreq.getPeriodsPerYear();
    return new InterestRateFutureTransaction(time, DUMMY_INDEX, time, time + tau, tau, 0, 1, tau, 1, "N");
  }
View Full Code Here

    final double fixingPeriodStartTime = 1.467;
    final double fixingPeriodEndTime = 1.75;
    final double fixingPeriodAccrualFactor = 0.267;
    final double paymentAccrualFactor = 0.25;
    final double refrencePrice = 0.0;
    final InterestRateFutureTransaction ir = new InterestRateFutureTransaction(lastTradingTime, iborIndex, fixingPeriodStartTime, fixingPeriodEndTime, fixingPeriodAccrualFactor, refrencePrice, 1,
        paymentAccrualFactor, 1, "S");
    assertEquals(fixingPeriodEndTime, ir.accept(LDC), 1e-12);
  }
View Full Code Here

  /**
   * Test the par spread.
   */
  public void parSpread() {
    final double parSpread = ERU2_TRA.accept(PSMQDC, MULTICURVES);
    final InterestRateFutureTransaction futures0 = new InterestRateFutureTransaction(ERU2_SEC, REFERENCE_PRICE + parSpread, QUANTITY);
    //InterestRateFutureTransactionDefinition(ERU2_SEC_DEFINITION, TRADE_DATE, REFERENCE_PRICE + parSpread, QUANTITY);
    final MultipleCurrencyAmount pv0 = METHOD_IRFUT_TRA_DSC.presentValue(futures0, MULTICURVES);
    assertEquals("Future par spread", pv0.getAmount(EUR), 0, TOLERANCE_PRICE);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureTransaction

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.