Package com.opengamma.financial.security.future

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


  }

  @Override
  public FutureSecurity createSecurity(final OperationContext context,
                                       final FutureSecurityBean bean) {
    FutureSecurity sec = bean.accept(
      new FutureSecurityBean.Visitor<FutureSecurity>() {

        @Override
        public FutureSecurity visitBondFutureType(BondFutureBean bean) {
          final Set<FutureBundleBean> basketBeans = bean
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

    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

    Double dailyValueMove = dailyPriceMove - costOfCarry;

    // 4. Scale by Trade Notionals and Quantity
    // Some SecurityType's have Notional values built-in. Scale by these if required.
    if (security instanceof FutureSecurity) {
      final FutureSecurity futureSecurity = (FutureSecurity) security;
      dailyValueMove *= futureSecurity.getUnitAmount();
    } else if (security instanceof EquityOptionSecurity) {
      final EquityOptionSecurity optionSecurity = (EquityOptionSecurity) security;
      dailyValueMove *= optionSecurity.getPointValue();
    } else if (security instanceof EquityIndexOptionSecurity) {
      final EquityIndexOptionSecurity optionSecurity = (EquityIndexOptionSecurity) security;
View Full Code Here

    return null;
  }

  @Override
  public List<ExternalId> visitCommodityFutureOptionSecurity(final CommodityFutureOptionSecurity security) {
    final FutureSecurity underlyingSecurity = (FutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(security.getUnderlyingId()));
    return getContractType(underlyingSecurity);
  }
View Full Code Here

    return getContractType(underlyingSecurity);
  }

  @Override
  public List<ExternalId> visitFxFutureOptionSecurity(final FxFutureOptionSecurity security) {
    final FutureSecurity underlyingSecurity = (FutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(security.getUnderlyingId()));
    return getContractType(underlyingSecurity);
  }
View Full Code Here

    return getContractType(underlyingSecurity);
  }

  @Override
  public List<ExternalId> visitBondFutureOptionSecurity(final BondFutureOptionSecurity security) {
    final FutureSecurity underlyingSecurity = (FutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(security.getUnderlyingId()));
    return getContractType(underlyingSecurity);
  }
View Full Code Here

    return null;
  }

  @Override
  public List<ExternalId> visitEquityIndexDividendFutureOptionSecurity(final EquityIndexDividendFutureOptionSecurity security) {
    final FutureSecurity underlyingSecurity = (FutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(security.getUnderlyingId()));
    return getContractType(underlyingSecurity);
  }
View Full Code Here

    return getContractType(underlyingSecurity);
  }

  @Override
  public List<ExternalId> visitEquityIndexFutureOptionSecurity(final EquityIndexFutureOptionSecurity security) {
    final FutureSecurity underlyingSecurity = (FutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(security.getUnderlyingId()));
    return getContractType(underlyingSecurity);
  }
View Full Code Here

    return null;
  }

  @Override
  public List<ExternalId> visitIRFutureOptionSecurity(final IRFutureOptionSecurity security) {
    final FutureSecurity underlyingSecurity = (FutureSecurity) _securitySource.getSingle(ExternalIdBundle.of(security.getUnderlyingId()));
    return getContractType(underlyingSecurity);
  }
View Full Code Here

TOP

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

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.