Examples of toBundle()


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("Time series for " + swapRateForMaturityIdentifier + " was null");
    }
    if (fixedRateSeries.getTimeSeries().isEmpty()) {
      throw new OpenGammaRuntimeException("Time series for " + swapRateForMaturityIdentifier + " was empty");
View Full Code Here

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

  public CdsOptionReferenceNameAggregationFunction(final SecuritySource securitySource, final OrganizationSource organizationSource) {
    super(NAME, securitySource, 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();
        } else {
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("Time series for " + swapRateForMaturityIdentifier + " was null");
    }
    if (fixedRateSeries.getTimeSeries().isEmpty()) {
      throw new OpenGammaRuntimeException("Time series for " + swapRateForMaturityIdentifier + " was empty");
View Full Code Here

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

    final DayCount dayCount = convention.getDayCount();
    final ExternalId cashRate = getCashRate(currency, start.toLocalDate(), Tenor.ofMonths(length));
    if (cashRate == null) {
      return null;
    }
    final HistoricalTimeSeries timeSeries = getHistoricalSource().getHistoricalTimeSeries(MarketDataRequirementNames.MARKET_VALUE, cashRate.toBundle(), null, start.toLocalDate(), true,
        start.toLocalDate(), true);
    if ((timeSeries == null) || timeSeries.getTimeSeries().isEmpty()) {
      return null;
    }
    final double rate = timeSeries.getTimeSeries().getEarliestValue() * getRandom(0.8, 1.2);
View Full Code Here

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.toLocalDate(),
        true, tradeDate.toLocalDate(), 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.toLocalDate(), maturity, forward);
    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.toLocalDate(), true,
        tradeDate.toLocalDate(), 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 (target.getValue() instanceof ExternalIdentifiable) {
              final ExternalId identifier = ((ExternalIdentifiable) target.getValue()).getExternalId();
              if (identifier == null) {
                identifiers = ExternalIdBundle.EMPTY;
              } else {
                identifiers = identifier.toBundle();
              }
            } else if (target.getValue() instanceof ExternalBundleIdentifiable) {
              identifiers = ((ExternalBundleIdentifiable) target.getValue()).getExternalIdBundle();
            } else if (target.getValue() == null) {
              // Null - special case
View Full Code Here

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

        if (((ManageableSecurity) security).propertyNames().contains("underlyingId")) {
          ExternalId id = (ExternalId) ((ManageableSecurity) security).property("underlyingId").get();

          Security underlying;
          try {
            underlying = getToolContext().getSecuritySource().getSingle(id.toBundle());
            if (underlying != null) {
              return new ObjectsPair<ManageablePosition, ManageableSecurity[]>(
                  position,
                  new ManageableSecurity[] {(ManageableSecurity) security, (ManageableSecurity) underlying });
            } else {
View Full Code Here

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

        if (((ManageableSecurity) security).propertyNames().contains("underlyingId")) {
          ExternalId id = (ExternalId) ((ManageableSecurity) security).property("underlyingId").get();
       
          Security underlying;
          try {
            underlying = _securitySource.getSingle(id.toBundle());
            if (underlying != null) {
              return new ObjectsPair<ManageablePosition, ManageableSecurity[]>(
                  position,
                  new ManageableSecurity[] {(ManageableSecurity) security, (ManageableSecurity) underlying});
            } else {
View Full Code Here

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

  private ExternalIdBundle getBundle(final ManageableSecurity security) {
    final ExternalIdBundle bundle = security.getExternalIdBundle();
    final ExternalId identifier = bundle.getExternalId(_security);
    if (identifier != null) {
      return identifier.toBundle();
    } else {
      return bundle;
    }
  }
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.