Package com.opengamma.id

Examples of com.opengamma.id.ExternalId.toBundle()


  }

  @Test
  public void apvEquityOptionsByBbgTicker() throws Exception {
    ExternalId bloombergIdentifier = getBloombergIdentifier(EXPECTED_APVL_EQUITYOPTION_SEC, ExternalSchemes.BLOOMBERG_TICKER);
    Security security = _securityProvider.getSecurity(bloombergIdentifier.toBundle());
    assertNotNull(security);
    assertAmericanVanillaEquityOptionSecurity(EXPECTED_APVL_EQUITYOPTION_SEC, security);
  }

  @Test
View Full Code Here


  }

  @Test
  public void apvEquityOptionsByBbgUnique() throws Exception {
    ExternalId bloombergIdentifier = getBloombergIdentifier(EXPECTED_APVL_EQUITYOPTION_SEC, ExternalSchemes.BLOOMBERG_BUID);
    Security security = _securityProvider.getSecurity(bloombergIdentifier.toBundle());
    assertNotNull(security);
    assertAmericanVanillaEquityOptionSecurity(EXPECTED_APVL_EQUITYOPTION_SEC, security);
  }

  @Test
View Full Code Here

  }

  @Test
  public void spxIndexOptionsByBbgTicker() throws Exception {
    ExternalId bloombergIdentifier = getBloombergIdentifier(EXPECTED_SPX_INDEXOPTION_SEC, ExternalSchemes.BLOOMBERG_TICKER);
    Security security = _securityProvider.getSecurity(bloombergIdentifier.toBundle());
    assertNotNull(security);
    assertEuropeanVanillaEquityIndexOptionSecurity(EXPECTED_SPX_INDEXOPTION_SEC, security);
  }

  @Test
View Full Code Here

      payCurrency = currencies.getSecond();
      receiveCurrency = currencies.getFirst();
    }
    final ExternalId spotRateIdentifier = getSpotRateIdentifier().execute(payCurrency, receiveCurrency);
    final Pair<LocalDate, Double> spotRate = getHistoricalSource().getLatestDataPoint(MarketDataRequirementNames.MARKET_VALUE,
        spotRateIdentifier.toBundle(), null);
    if (spotRate == null) {
      s_logger.debug("No spot rate for {}", spotRateIdentifier);
      return null;
    }
    s_logger.debug("Got spot rate {} for {}", spotRate, spotRateIdentifier);
View Full Code Here

  public String classifyPosition(final Position position) {
    final Security security = resolveSecurity(position);
    if (security instanceof CreditDefaultSwapOptionSecurity) {
      final CreditDefaultSwapOptionSecurity cdsOption = (CreditDefaultSwapOptionSecurity) security;
      final ExternalId underlyingId = cdsOption.getUnderlyingId();
      final Security underlying = _securitySource.getSingle(underlyingId.toBundle());
      return  ((CreditDefaultSwapSecurity) underlying).getDebtSeniority().toString();
    } else if (security instanceof CreditDefaultSwapSecurity) {
      final CreditDefaultSwapSecurity cds = (CreditDefaultSwapSecurity) security;
      return cds.getDebtSeniority().toString();
    }
View Full Code Here

  }

  @Test
  public void spxIndexOptionsByBbgUnique() throws Exception {
    ExternalId bloombergIdentifier = getBloombergIdentifier(EXPECTED_SPX_INDEXOPTION_SEC, ExternalSchemes.BLOOMBERG_BUID);
    Security security = _securityProvider.getSecurity(bloombergIdentifier.toBundle());
    assertNotNull(security);
    assertEuropeanVanillaEquityIndexOptionSecurity(EXPECTED_SPX_INDEXOPTION_SEC, security);
  }

  private ExternalId getBloombergIdentifier(FinancialSecurity finSec, ExternalScheme scheme) {
View Full Code Here

              final Object volatilityObject = inputs.getValue(requirement);
              if (volatilityObject != null) {
                final Double volatility = (Double) volatilityObject;
                final VolatilityPoint coordinate = new VolatilityPoint(x, y, z);
                data.put(coordinate, volatility);
                ids.put(coordinate, id.toBundle());
              }
            }
          }
        }
        final VolatilityCubeData volatilityCubeData = new VolatilityCubeData();
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.