Examples of toBundle()


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

      return null;
    }
    // look up the rate timeseries identifier out of the bundle
    final ExternalId tsIdentifier = getTimeSeriesIdentifier(liborConvention);
    // look up the value on our chosen trade date
    final HistoricalTimeSeries initialRateSeries = getHistoricalSource().getHistoricalTimeSeries(MarketDataRequirementNames.MARKET_VALUE, tsIdentifier.toBundle(), null, tradeDate,
        true, tradeDate, true);
    if (initialRateSeries == null || initialRateSeries.getTimeSeries().isEmpty()) {
      s_logger.error("couldn't get series for {} on {}", tsIdentifier, tradeDate);
      return null;
    }
View Full Code Here

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

    final ExternalId swapRateForMaturityIdentifier = getSwapRateFor(ccy, tradeDate, maturity);
    if (swapRateForMaturityIdentifier == null) {
      s_logger.error("Couldn't get swap rate identifier for {} [{}] from {}", new Object[] {ccy, maturity, tradeDate });
      return null;
    }
    final HistoricalTimeSeries fixedRateSeries = getHistoricalSource().getHistoricalTimeSeries(MarketDataRequirementNames.MARKET_VALUE, swapRateForMaturityIdentifier.toBundle(),
        null, tradeDate, true,
        tradeDate, true);
    if (fixedRateSeries == null) {
      s_logger.error("can't find time series for {} on {}", swapRateForMaturityIdentifier, tradeDate);
      return null;
View Full Code Here

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

    if (swapRateForMaturityIdentifier == null) {
      throw new OpenGammaRuntimeException("Couldn't get swap rate identifier for " + ccy + " [" + maturity + "]" + " from " + tradeDate);
    }

    final HistoricalTimeSeries fixedRateSeries = historicalSource.getHistoricalTimeSeries("PX_LAST",
        swapRateForMaturityIdentifier.toBundle(), HistoricalTimeSeriesRatingFieldNames.DEFAULT_CONFIG_NAME, tradeDate.minusDays(30), true, tradeDate, true);
    if (fixedRateSeries == null) {
      throw new OpenGammaRuntimeException("can't find time series for " + swapRateForMaturityIdentifier + " on " + tradeDate);
    }
    final Double fixedRate = (fixedRateSeries.getTimeSeries().getLatestValue() + random.nextDouble()) / 100d;
    return fixedRate;
View Full Code Here

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

    } catch (Exception ex) {
      s_logger.warn("Unable to obtain underlying id for " + currency + " " + start.toLocalDate() + " " + tenor, ex);
      return null;
    }
   
    final HistoricalTimeSeries underlyingSeries = getHistoricalSource().getHistoricalTimeSeries(MarketDataRequirementNames.MARKET_VALUE, underlyingIdentifier.toBundle(), null, start.toLocalDate(),
        true, start.toLocalDate(), true);
    if ((underlyingSeries == null) || underlyingSeries.getTimeSeries().isEmpty()) {
      return null;
    }
    final double rate = underlyingSeries.getTimeSeries().getEarliestValue() * getRandom(0.5, 1.5);
View Full Code Here

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

    public CdsOptionObligorSectorExtractor(final SecuritySource securitySource, final OrganizationSource organizationSource) {
      _obligorExtractor = new CdsOptionValueExtractor<Obligor>() {
        @Override
        public Obligor extract(CreditDefaultSwapOptionSecurity cdsOption) {
          ExternalId underlyingId = cdsOption.getUnderlyingId();
          Security underlying = securitySource.getSingle(underlyingId.toBundle());
          if (underlying instanceof AbstractCreditDefaultSwapSecurity) {
            String redCode = ((CreditDefaultSwapSecurity) underlying).getReferenceEntity().getValue();
            Organization organisation = organizationSource.getOrganizationByRedCode(redCode);
            return organisation.getObligor();
          }
View Full Code Here

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

  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());
      final String redCode = ((CreditDefaultSwapSecurity) underlying).getReferenceEntity().getValue();
      final Organization organisation = _organizationSource.getOrganizationByRedCode(redCode);
      return organisation.getObligor().getObligorShortName();

    } else if (security instanceof CreditDefaultSwapIndexSecurity) {
View Full Code Here

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

  }

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

  @Test
View Full Code Here

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

  }

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

  @Test
View Full Code Here

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

  }

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

  @Test
View Full Code Here

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

  }

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

  @Test
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.