Package com.opengamma.financial.convention

Examples of com.opengamma.financial.convention.DeliverablePriceQuotedSwapFutureConvention$Meta


    Double price = _marketData.getDataPoint(_dataId);
    if (price == null) {
      price = 0.99;
//      throw new OpenGammaRuntimeException("Could not get market data for " + _dataId);
    }
    final DeliverablePriceQuotedSwapFutureConvention futureConvention =
        _conventionSource.getConvention(DeliverablePriceQuotedSwapFutureConvention.class, swapFuture.getFutureConvention());
    final SwapConvention underlyingSwapConvention = _conventionSource.getConvention(SwapConvention.class, swapFuture.getSwapConvention());
    final Tenor maturityTenor = swapFuture.getUnderlyingTenor();
    final Convention payLegConvention = _conventionSource.getConvention(underlyingSwapConvention.getPayLegConvention());
    if (payLegConvention == null) {
      throw new OpenGammaRuntimeException("Convention with id " + underlyingSwapConvention.getPayLegConvention() + " was null");
    }
    final Convention receiveLegConvention = _conventionSource.getConvention(underlyingSwapConvention.getReceiveLegConvention());
    if (receiveLegConvention == null) {
      throw new OpenGammaRuntimeException("Convention with id " + underlyingSwapConvention.getPayLegConvention() + " was null");
    }
    if (!(payLegConvention instanceof SwapFixedLegConvention)) {
      throw new OpenGammaRuntimeException("Convention of pay leg was not Fixed Leg for " + underlyingSwapConvention);
    }
    final SwapFixedLegConvention fixedLegConvention = (SwapFixedLegConvention) payLegConvention;
    if (!(receiveLegConvention instanceof VanillaIborLegConvention)) {
      throw new OpenGammaRuntimeException("Convention of pay leg was not Ibor Leg for " + underlyingSwapConvention);
    }
    final VanillaIborLegConvention iborLegConvention = (VanillaIborLegConvention) receiveLegConvention;
    final String expiryCalculatorName = futureConvention.getExpiryConvention().getValue();
    final ZonedDateTime startDate = _valuationTime.plus(swapFuture.getStartTenor().getPeriod());
    final Calendar calendar = CalendarUtils.getCalendar(_regionSource, _holidaySource, futureConvention.getExchangeCalendar());
    final ExchangeTradedInstrumentExpiryCalculator expiryCalculator = ExchangeTradedInstrumentExpiryCalculatorFactory.getCalculator(expiryCalculatorName);
    final LocalTime time = startDate.toLocalTime();
    final ZoneId timeZone = startDate.getZone();
    final double notional = 1.0;
    final int spotLagSwap = fixedLegConvention.getSettlementDays();
View Full Code Here


      final ExternalIdBundle externalIdBundle = deserializer.fieldValueToObject(ExternalIdBundle.class, message.getByName(EXTERNAL_ID_BUNDLE_FIELD));
      final ExternalId expiryConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(EXPIRY_CONVENTION_FIELD));
      final ExternalId exchangeCalendar = deserializer.fieldValueToObject(ExternalId.class, message.getByName(EXCHANGE_CALENDAR_FIELD));
      final ExternalId swapConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(SWAP_CONVENTION_FIELD));
      final double notional = message.getDouble(NOTIONAL_FIELD);
      final DeliverablePriceQuotedSwapFutureConvention convention = new DeliverablePriceQuotedSwapFutureConvention(name, externalIdBundle,
          expiryConvention, exchangeCalendar, swapConvention, notional);
      final FudgeField uniqueIdMsg = message.getByName(UNIQUE_ID_FIELD);
      if (uniqueIdMsg != null) {
        convention.setUniqueId(deserializer.fieldValueToObject(UniqueId.class, uniqueIdMsg));
      }
      return convention;
    }
View Full Code Here

    final Convention serialSTIRFutureConvention = new InterestRateFutureConvention(serialFutureConventionName, ExternalIdBundle.of(ExternalId.of(SCHEME_NAME, serialFutureConventionName)),
        ExternalId.of(ExchangeTradedInstrumentExpiryCalculator.SCHEME, IMMFutureAndFutureOptionMonthlyExpiryCalculator.NAME), US, liborConventionId);
   
    final Convention fedFundsConvention = new FederalFundsFutureConvention(fedFundFutureConventionName, ExternalIdBundle.of(ExternalId.of(SCHEME_NAME, FED_FUNDS_FUTURE)),
        ExternalId.of(ExchangeTradedInstrumentExpiryCalculator.SCHEME, FedFundFutureAndFutureOptionMonthlyExpiryCalculator.NAME), US, overnightConventionId, 5000000);
    final Convention cmsDeliverableSwapFutureConvention = new DeliverablePriceQuotedSwapFutureConvention(cmeDeliverableSwapFutureConventionName,
        ExternalIdBundle.of(SCHEME_NAME, CME_DELIVERABLE_SWAP_FUTURE), ExternalId.of(ExchangeTradedInstrumentExpiryCalculator.SCHEME,
            IMMFutureAndFutureOptionQuarterlyExpiryCalculator.NAME), US, liborConventionId, 100000);
    // Inflation
    final PriceIndexConvention priceIndexConvention = new PriceIndexConvention(priceIndexName, getIds(Currency.USD, PRICE_INDEX), Currency.USD, US,
        ExternalSchemes.bloombergTickerSecurityId("CPURNSA Index"));
View Full Code Here

    assertEquals(convention, cycleObject(FederalFundsFutureConvention.class, convention));
  }

  @Test
  public void testDeliverablePriceQuotedSwapFutureConvention() {
    final DeliverablePriceQuotedSwapFutureConvention convention = new DeliverablePriceQuotedSwapFutureConvention("T1U", ExternalIdBundle.of(InMemoryConventionBundleMaster.simpleNameSecurityId("T1U")),
        ExternalId.of("Test", "3rd Wednesday"), ExternalId.of("Test", "CME"), ExternalId.of("Test", "Swap"), 100000);
    convention.setUniqueId(UniqueId.of("Test", "123456"));
    assertEquals(convention, cycleObject(DeliverablePriceQuotedSwapFutureConvention.class, convention));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.convention.DeliverablePriceQuotedSwapFutureConvention$Meta

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.