Package com.opengamma.financial.security.future

Examples of com.opengamma.financial.security.future.InterestRateFutureSecurity


          return security;
        }

        @Override
        public FutureSecurity visitInterestRateFutureType(InterestRateFutureBean bean) {
          return new InterestRateFutureSecurity(
            expiryBeanToExpiry(bean.getExpiry()),
            bean.getTradingExchange().getName(),
            bean.getSettlementExchange().getName(),
            currencyBeanToCurrency(bean.getCurrency()),
            bean.getUnitAmount(),
View Full Code Here


      final int n = 1 + random.nextInt(5);
      final Expiry expiry = new Expiry(tradeDate.plusMonths(3 * n).with(THIRD_WED_ADJUSTER));
      final String letter = MONTHS.get(expiry.getExpiry().getMonth());
      final String year = Integer.toString(expiry.getExpiry().getYear() - 2010);
      final String code = "ER" + letter + year;
      final FutureSecurity security = new InterestRateFutureSecurity(expiry, "XLIF", "XLIF", CURRENCY, 2500, EURIBOR_3M, "Interest rate");
      security.setName(code);
      security.setExternalIdBundle(ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId(code)));
      security.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
      securities.add(security);
      amounts[i] = 50 - random.nextInt(100);
      prices[i] = 1 - (1e-5 + random.nextDouble() / 100.);
    }
    return securities;
View Full Code Here

    assertEquals(ExternalId.of(SCHEME, "FUTURE"), ids.get(0));
  }

  @Test
  public void testInterestRateFutureSecurity() {
    final InterestRateFutureSecurity future = ExposureFunctionTestHelper.getInterestRateFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "FUTURE"), ids.get(0));
  }
View Full Code Here

    assertEquals(ExternalId.of(SCHEME, "FUTURE_EUR"), ids.get(0));
  }

  @Test
  public void testInterestRateFutureSecurity() {
    final InterestRateFutureSecurity future = ExposureFunctionTestHelper.getInterestRateFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "FUTURE_USD"), ids.get(0));
  }
View Full Code Here

    assertNull(ids);
  }

  @Test
  public void testInterestRateFutureSecurity() {
    final InterestRateFutureSecurity future = ExposureFunctionTestHelper.getInterestRateFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalSchemes.syntheticSecurityId("USD 3m Libor"), ids.get(0));
  }
View Full Code Here

    assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0));
  }

  @Test
  public void testInterestRateFutureSecurity() {
    final InterestRateFutureSecurity future = ExposureFunctionTestHelper.getInterestRateFutureSecurity();
    final List<ExternalId> ids = future.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0));
  }
View Full Code Here

    security.setUniqueId(UniqueId.of(UniqueId.EXTERNAL_SCHEME.getName(), "897"));
    return security;
  }

  public static InterestRateFutureSecurity getInterestRateFutureSecurity() {
    final InterestRateFutureSecurity security = new InterestRateFutureSecurity(new Expiry(DateUtils.getUTCDate(2013, 9, 1)), TRADING, SETTLEMENT, USD, 12500,
        ExternalSchemes.syntheticSecurityId("USD 3m Libor"), "Financial");
    security.setUniqueId(UniqueId.of(UniqueId.EXTERNAL_SCHEME.getName(), "4567"));
    return security;
  }
View Full Code Here

  @Override
  public InstrumentDefinition<?> visitIRFutureOptionSecurity(final IRFutureOptionSecurity security) {
    ArgumentChecker.notNull(security, "security");
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    // REVIEW Andrew 2012-01-17 -- This call to getSingle is not correct as the resolution time of the view cycle will not be considered
    final InterestRateFutureSecurity underlyingSecurity = ((InterestRateFutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(underlyingIdentifier)));
    if (underlyingSecurity == null) {
      throw new OpenGammaRuntimeException("Underlying security " + underlyingIdentifier + " was not found in database");
    }
    final InterestRateFutureSecurityDefinition underlyingFuture = _underlyingConverter.visitInterestRateFutureSecurity(underlyingSecurity);
    final ZonedDateTime expirationDate = security.getExpiry().getExpiry();
View Full Code Here

    cash.setExternalIdBundle(bundle);
    final FixedIncomeStripWithSecurity cashStrip = new FixedIncomeStripWithSecurity(new FixedIncomeStrip(StripInstrumentType.CASH, Tenor.ONE_MONTH, "DEFAULT"), Tenor.ONE_MONTH, maturity, dummyId, cash);

    dummyId = ExternalSchemes.bloombergTickerSecurityId("EDZ2 Comdty");
    bundle = ExternalIdBundle.of(dummyId);
    final FutureSecurity future = new InterestRateFutureSecurity(new Expiry(ZonedDateTime.now()), "XCSE", "XCSE", Currency.USD, 0, dummyId, "Interest Rate");
    future.setExternalIdBundle(bundle);
    final FixedIncomeStripWithSecurity futureStrip = new FixedIncomeStripWithSecurity(new FixedIncomeStrip(StripInstrumentType.FUTURE, Tenor.THREE_MONTHS, 2, "DEFAULT"), Tenor.THREE_MONTHS, DateUtils.getUTCDate(2011, 12, 1), dummyId, future);

    dummyId = ExternalSchemes.bloombergTickerSecurityId("USFR0BE Curncy");
    bundle = ExternalIdBundle.of(dummyId);
    final ZonedDateTime startDate = DateUtils.getUTCDate(2011, 11, 1);
View Full Code Here

  @Override
  public InstrumentDefinition<?> visitIRFutureOptionSecurity(final IRFutureOptionSecurity security) {
    ArgumentChecker.notNull(security, "security");
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    // REVIEW Andrew 2012-01-17 -- This call to getSingle is not correct as the resolution time of the view cycle will not be considered
    final InterestRateFutureSecurity underlyingSecurity = ((InterestRateFutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(underlyingIdentifier)));
    if (underlyingSecurity == null) {
      throw new OpenGammaRuntimeException("Underlying security " + underlyingIdentifier + " was not found in database");
    }
    final InterestRateFutureSecurityDefinition underlyingFuture = _underlyingConverter.visitInterestRateFutureSecurity(underlyingSecurity);
    final ZonedDateTime expirationDate = security.getExpiry().getExpiry();
View Full Code Here

TOP

Related Classes of com.opengamma.financial.security.future.InterestRateFutureSecurity

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.