Package com.opengamma.financial.currency

Examples of com.opengamma.financial.currency.CurrencyPairs


    }
    if (includeStart == null || curveExposures == null) {
      return null;
    }
    //TODO how should this be done?
    final CurrencyPairs pairs = OpenGammaCompilationContext.getCurrencyPairsSource(context).getCurrencyPairs(CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    final FinancialSecurity security = (FinancialSecurity) target.getPosition().getSecurity();
    final Currency payCurrency = security.accept(ForexVisitors.getPayCurrencyVisitor());
    final Currency receiveCurrency = security.accept(ForexVisitors.getReceiveCurrencyVisitor());
    final CurrencyPair currencyPair = pairs.getCurrencyPair(payCurrency, receiveCurrency);
    final Currency currencyBase = currencyPair.getBase();
    final ValueProperties properties = createValueProperties()
        .with(INCLUDE_START_PROPERTY, includeStart)
        .with(INCLUDE_END_PROPERTY, includeEnd)
        .with(START_DATE_PROPERTY, startDate)
View Full Code Here


    final String daysForward = desiredValue.getConstraint(PROPERTY_DAYS_TO_MOVE_FORWARD);
    final Object baseQuotePairsObject = inputs.getValue(ValueRequirementNames.CURRENCY_PAIRS);
    if (baseQuotePairsObject == null) {
      throw new OpenGammaRuntimeException("Could not get base/quote pair data");
    }
    final CurrencyPairs baseQuotePairs = (CurrencyPairs) baseQuotePairsObject;
    final CurrencyPair baseQuotePair = baseQuotePairs.getCurrencyPair(putCurrency, callCurrency);
    if (baseQuotePair == null) {
      throw new OpenGammaRuntimeException("Could not get base/quote pair for currency pair (" + putCurrency + ", " + callCurrency + ")");
    }
    final Integer daysFwdOrBackward;
    if (daysForward.equalsIgnoreCase("-1")) {
View Full Code Here

    final Currency ccy2;
    final Object baseQuotePairsObject = inputs.getValue(ValueRequirementNames.CURRENCY_PAIRS);
    if (baseQuotePairsObject == null) {
      throw new OpenGammaRuntimeException("Could not get base/quote pair data");
    }
    final CurrencyPairs baseQuotePairs = (CurrencyPairs) baseQuotePairsObject;
    final CurrencyPair baseQuotePair = baseQuotePairs.getCurrencyPair(putCurrency, callCurrency);
    if (baseQuotePair == null) {
      throw new OpenGammaRuntimeException("Could not get base/quote pair for currency pair (" + putCurrency + ", " + callCurrency + ")");
    }
    if (baseQuotePair.getBase().equals(putCurrency)) { // To get Base/quote in market standard order.
      ccy1 = putCurrency;
View Full Code Here

    }
    final ForwardCurve forwardCurve = (ForwardCurve) forwardCurveObject;
    final ValueRequirement volDataRequirement = getUnderlyingVolatilityDataRequirement(surfaceName, id);
    final SmileSurfaceDataBundle data = getData(inputs, volDataRequirement, forwardCurveRequirement);
    final FXOptionSecurity fxOption = (FXOptionSecurity) security;
    final CurrencyPairs currencyPairs = OpenGammaExecutionContext.getCurrencyPairsSource(executionContext).getCurrencyPairs(CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    final CurrencyPair currencyPair = currencyPairs.getCurrencyPair(fxOption.getPutCurrency(), fxOption.getCallCurrency());
    final EuropeanVanillaOption option = getOption(security, now, currencyPair);
    return Collections.singleton(new ComputedValue(spec, getResult(calculator, localVolatilitySurface, forwardCurve, data, option)));
  }
View Full Code Here

          .withAny(CURVE_EXPOSURES);
      if (isWithCurrency()) {
        final FinancialSecurity security = (FinancialSecurity) target.getTrade().getSecurity();
        final Currency putCurrency = security.accept(ForexVisitors.getPutCurrencyVisitor());
        final Currency callCurrency = security.accept(ForexVisitors.getCallCurrencyVisitor());
        final CurrencyPairs baseQuotePairs = getCurrencyPairs(context);
        final CurrencyPair baseQuotePair = baseQuotePairs.getCurrencyPair(putCurrency, callCurrency);
        final String currency = getResultCurrency(target, baseQuotePair);
        properties.with(CURRENCY, currency);
        return properties;
      }
      return properties;
View Full Code Here

  public CompiledFunctionDefinition compile(final FunctionCompilationContext context, final Instant atInstant) {
    final HolidaySource holidaySource = OpenGammaCompilationContext.getHolidaySource(context);
    final RegionSource regionSource = OpenGammaCompilationContext.getRegionSource(context);
    final ConventionBundleSource conventionSource = OpenGammaCompilationContext.getConventionBundleSource(context);
    final HistoricalTimeSeriesResolver timeSeriesResolver = OpenGammaCompilationContext.getHistoricalTimeSeriesResolver(context);
    final CurrencyPairs baseQuotePairs = OpenGammaCompilationContext.getCurrencyPairsSource(context).getCurrencyPairs(CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    final CashSecurityConverter cashConverter = new CashSecurityConverter(holidaySource, regionSource);
    final FRASecurityConverterDeprecated fraConverter = new FRASecurityConverterDeprecated(holidaySource, regionSource, conventionSource);
    final SwapSecurityConverterDeprecated swapConverter = new SwapSecurityConverterDeprecated(holidaySource, conventionSource, regionSource, false);
    final BondSecurityConverter bondConverter = new BondSecurityConverter(holidaySource, conventionSource, regionSource);
    final InterestRateFutureSecurityConverterDeprecated irFutureConverter = new InterestRateFutureSecurityConverterDeprecated(holidaySource, conventionSource, regionSource);
View Full Code Here

  public CompiledFunctionDefinition compile(final FunctionCompilationContext context, final Instant atInstant) {
    final HolidaySource holidaySource = OpenGammaCompilationContext.getHolidaySource(context);
    final RegionSource regionSource = OpenGammaCompilationContext.getRegionSource(context);
    final ConventionBundleSource conventionSource = OpenGammaCompilationContext.getConventionBundleSource(context);
    final HistoricalTimeSeriesResolver timeSeriesResolver = OpenGammaCompilationContext.getHistoricalTimeSeriesResolver(context);
    final CurrencyPairs baseQuotePairs = OpenGammaCompilationContext.getCurrencyPairsSource(context).getCurrencyPairs(CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    final CashSecurityConverter cashConverter = new CashSecurityConverter(holidaySource, regionSource);
    final FRASecurityConverterDeprecated fraConverter = new FRASecurityConverterDeprecated(holidaySource, regionSource, conventionSource);
    final SwapSecurityConverterDeprecated swapConverter = new SwapSecurityConverterDeprecated(holidaySource, conventionSource, regionSource, false);
    final BondSecurityConverter bondConverter = new BondSecurityConverter(holidaySource, conventionSource, regionSource);
    final InterestRateFutureSecurityConverterDeprecated irFutureConverter = new InterestRateFutureSecurityConverterDeprecated(holidaySource, conventionSource, regionSource);
View Full Code Here

      final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
    final ValueRequirement desiredValue = Iterables.getOnlyElement(desiredValues);
    final String name = desiredValue.getConstraint(CURRENCY_PAIRS_NAME);
    @SuppressWarnings("deprecation")
    final CurrencyPairsSource ccyPairsSource = OpenGammaExecutionContext.getCurrencyPairsSource(executionContext);
    final CurrencyPairs currencyPairs = ccyPairsSource.getCurrencyPairs(name);
    if (currencyPairs == null) {
      throw new OpenGammaRuntimeException("Could not get CurrencyPairs called " + CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    }
    return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.CURRENCY_PAIRS, ComputationTargetSpecification.NULL,
        createValueProperties().with(CURRENCY_PAIRS_NAME, name).get()), currencyPairs));
View Full Code Here

  public CompiledFunctionDefinition compile(final FunctionCompilationContext context, final Instant atInstant) {
    final HolidaySource holidaySource = OpenGammaCompilationContext.getHolidaySource(context);
    final RegionSource regionSource = OpenGammaCompilationContext.getRegionSource(context);
    final ConventionBundleSource conventionSource = OpenGammaCompilationContext.getConventionBundleSource(context);
    final HistoricalTimeSeriesResolver timeSeriesResolver = OpenGammaCompilationContext.getHistoricalTimeSeriesResolver(context);
    final CurrencyPairs baseQuotePairs = OpenGammaCompilationContext.getCurrencyPairsSource(context).getCurrencyPairs(CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    final CashSecurityConverter cashConverter = new CashSecurityConverter(holidaySource, regionSource);
    final FRASecurityConverterDeprecated fraConverter = new FRASecurityConverterDeprecated(holidaySource, regionSource, conventionSource);
    final SwapSecurityConverterDeprecated swapConverter = new SwapSecurityConverterDeprecated(holidaySource, conventionSource, regionSource, false);
    final BondSecurityConverter bondConverter = new BondSecurityConverter(holidaySource, conventionSource, regionSource);
    final InterestRateFutureSecurityConverterDeprecated irFutureConverter = new InterestRateFutureSecurityConverterDeprecated(holidaySource, conventionSource, regionSource);
View Full Code Here

    _convention = currencyPairsConvention;
  }

  @Override
  public CompiledFunctionDefinition compile(final FunctionCompilationContext context, final Instant atInstant) {
    final CurrencyPairs currencyPairs = OpenGammaCompilationContext.getCurrencyPairsSource(context).getCurrencyPairs(_convention);
    if (currencyPairs == null) {
      throw new UnsupportedOperationException("No convention called " + _convention + " found");
    }
    return new Compiled(currencyPairs);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.currency.CurrencyPairs

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.