Examples of addExternalId()


Examples of com.opengamma.core.region.impl.SimpleRegion.addExternalId()

    private final Region _region;

    public MyRegionSource(final String countryId) {
      final SimpleRegion region = new SimpleRegion();
      final ExternalId id = ExternalId.of(ExternalSchemes.ISO_COUNTRY_ALPHA2, countryId);
      region.addExternalId(id);
      region.setUniqueId(UniqueId.of(UniqueId.EXTERNAL_SCHEME.getName(), id.getValue()));
      _regionBundle = ExternalIdBundle.of(id);
      _region = region;
    }
View Full Code Here

Examples of com.opengamma.core.security.impl.SimpleSecurity.addExternalId()

    final SimplePortfolio p = new SimplePortfolio(UniqueId.of("FOO", "BAR"), "portfolio");
    p.setRootNode(pn);
    final MockPositionSource positionSource = new MockPositionSource();
    positionSource.addPortfolio(p);
    final SimpleSecurity defSec = new SimpleSecurity("");
    defSec.addExternalId(secIdentifier);
    final InMemorySecuritySource securitySource = new InMemorySecuritySource();
    securitySource.addSecurity(defSec);
    final InMemoryFunctionRepository functionRepo = new InMemoryFunctionRepository();
    final FunctionCompilationContext functionCompilationContext = new FunctionCompilationContext();
    functionCompilationContext.setFunctionInitId(123);
View Full Code Here

Examples of com.opengamma.core.security.impl.SimpleSecurityLink.addExternalId()

    position.setUniqueId(uniqueId);
    Map<String, String> hashFields = jedis.hgetAll(redisKey);
    position.setQuantity(new BigDecimal(hashFields.get("QTY")));
    ExternalId secId = ExternalId.parse(hashFields.get("SEC"));
    SimpleSecurityLink secLink = new SimpleSecurityLink();
    secLink.addExternalId(secId);
    position.setSecurityLink(secLink);
   
    for (Map.Entry<String, String> field : hashFields.entrySet()) {
      if (!field.getKey().startsWith("ATT-")) {
        continue;
View Full Code Here

Examples of com.opengamma.financial.security.bond.GovernmentBondSecurity.addExternalId()

    ZonedDateTime zdt = ZonedDateTime.parse("2011-01-31T12:00Z[Europe/London]");
    GovernmentBondSecurity sec = new GovernmentBondSecurity("US TREASURY N/B", "issuerType", "issuerDomicile", "market",
        Currency.GBP, SimpleYieldConvention.US_TREASURY_EQUIVALANT, new Expiry(zdt),
        "couponType", 23.5d, SimpleFrequency.ANNUAL, DayCountFactory.INSTANCE.getDayCount("Act/Act"),
        zdt, zdt, zdt, 129d, 1324d, 12d, 1d, 2d, 3d);
    sec.addExternalId(ExternalId.of("abc", "def"));
    SecurityDocument addDoc = new SecurityDocument(sec);
    SecurityDocument added = _secMaster.add(addDoc);
   
    SecurityDocument loaded = _secMaster.get(added.getUniqueId());
    assertEquals(added, loaded);
View Full Code Here

Examples of com.opengamma.financial.security.capfloor.CapFloorCMSSpreadSecurity.addExternalId()

        PeriodFrequency.ANNUAL, CURRENCY, ACT_360, payer, cap);
    security.setName(CURRENCY.getCode() + " " + FORMAT.format(notional / 1000000) + (cap ? "MM cap spread " : "MM floor spread ") + "@ " + FORMAT.format(strike) +
        "%, pay " + payTenor.getPeriod().normalized().getYears() + "Y ISDA fixing" + ", receive " +
        receiveTenor.getPeriod().normalized().getYears() + "Y ISDA fixing" +
        " (" + tradeDate.toLocalDate().toString() + " - " + maturityDate.toLocalDate().toString() + ")");
    security.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    return security;
  }

  private Double getSwapRate(final Currency ccy, final LocalDate tradeDate, final Tenor maturity) {
    final HistoricalTimeSeriesSource historicalSource = getToolContext().getHistoricalTimeSeriesSource();
View Full Code Here

Examples of com.opengamma.financial.security.capfloor.CapFloorSecurity.addExternalId()

    final CapFloorSecurity security = new CapFloorSecurity(TRADE_DATE.atStartOfDay(ZoneOffset.UTC), maturityDate, notional, underlyingId, strike, PeriodFrequency.SEMI_ANNUAL,
        Currency.USD, ACT_360, payer, cap, false);
    security.setName("USD " + FORMAT.format(notional / 1000000) + (cap ? "MM cap " : "MM floor ") + "@ " + FORMAT.format(strike) +
        (payer ? "%, pay " : "%, receive ") + tenor.getPeriod().normalized().getYears() + "Y ISDA fixing" +
        " (" + TRADE_DATE.toString() + " - " + maturityDate.toLocalDate().toString() + ")");
    security.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    return security;
  }

  private SwapSecurity makeSwap(final Random random, final Tenor tenor) {
    final ZonedDateTime tradeDate = TRADE_DATE.atStartOfDay(ZoneOffset.UTC);
View Full Code Here

Examples of com.opengamma.financial.security.cash.CashSecurity.addExternalId()

                                             ZonedDateTime.now().plusYears(5),
                                             DayCountFactory.INSTANCE.getDayCount("Actual/360"),
                                             0.05,
                                             100000);
    ExternalId secId = ExternalId.of("SEC_ID", "12345");
    security.addExternalId(secId);
    document.setSecurity(security);
    _securityMaster.add(document);

    Position posn = new SimplePosition(BigDecimal.ONE, secId);
    assertEquals(_aggregator.classifyPosition(posn), "N/A");
View Full Code Here

Examples of com.opengamma.financial.security.cds.CDSSecurity.addExternalId()

                                             frequency,
                                             dayCount,
                                             businessDayConvention, 
                                             StubType.SHORT_START, 3,
                                             "US Treasury", Currency.USD, "Senior", "No Restructuring");
    cds1.addExternalId(ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "TEST_CDS_00001--US912828KY53-A"));
    cds1.setName("TEST CDS" + _counter++);
   
    return cds1;
  }
 
View Full Code Here

Examples of com.opengamma.financial.security.cds.StandardVanillaCDSSecurity.addExternalId()

                                                                    SimpleFrequency.SEMI_ANNUAL, DayCountFactory.INSTANCE.getDayCount("Actual/360"),
                                                                    BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"),
                                                                    true, true, true, new InterestRateNotional(Currency.USD, 10000000), true, true, 500,
                                                                    new InterestRateNotional(Currency.USD, 500000), 500, createZdt(2013,3,21), true);
    ExternalId secId = ExternalId.of("SEC_ID", "12345");
    cds.addExternalId(secId);
    document.setSecurity(cds);
    _securityMaster.add(document);

    Position posn = new SimplePosition(BigDecimal.ONE, secId);
View Full Code Here

Examples of com.opengamma.financial.security.equity.EquitySecurity.addExternalId()

   *
   * @return the equity security
   */
  public static EquitySecurity getEquitySecurity() {
    EquitySecurity equitySecurity = new EquitySecurity("NASDAQ/NGS (GLOBAL SELECT MARKET)", "XNGS", "APPLE INC", Currency.USD);
    equitySecurity.addExternalId(ExternalSchemes.bloombergTickerSecurityId("AAPL US Equity"));
    equitySecurity.addExternalId(ExternalSchemes.bloombergBuidSecurityId("EQ0010169500001000"));
    equitySecurity.addExternalId(ExternalSchemes.cusipSecurityId("037833100"));
    equitySecurity.addExternalId(ExternalSchemes.isinSecurityId("US0378331005"));
    equitySecurity.addExternalId(ExternalSchemes.sedol1SecurityId("2046251"));
    equitySecurity.setShortName("AAPL");
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.