Examples of FXMatrix


Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

  public MulticurveProviderDiscount() {
    // TODO: Do we need a LinkedHashMap or a more efficient Map could be used?
    _discountingCurves = new LinkedHashMap<>();
    _forwardIborCurves = new LinkedHashMap<>();
    _forwardONCurves = new LinkedHashMap<>();
    _fxMatrix = new FXMatrix();
    setAllCurves();
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

  @Override
  public MulticurveProviderDiscount copy() {
    final LinkedHashMap<Currency, YieldAndDiscountCurve> discountingCurves = new LinkedHashMap<>(_discountingCurves);
    final LinkedHashMap<IborIndex, YieldAndDiscountCurve> forwardIborCurves = new LinkedHashMap<>(_forwardIborCurves);
    final LinkedHashMap<IndexON, YieldAndDiscountCurve> forwardONCurves = new LinkedHashMap<>(_forwardONCurves);
    final FXMatrix fxMatrix = new FXMatrix(_fxMatrix);
    return new MulticurveProviderDiscount(discountingCurves, forwardIborCurves, forwardONCurves, fxMatrix);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

      for (int i = 0; i < entries.size(); i++) {
        final FudgeMsg msg = (FudgeMsg) arrays.get(i).getValue();
        final double[] row = deserializer.fieldValueToObject(double[].class, msg.getByName(ROW_FIELD));
        fxRates[i] = row;
      }
      return new FXMatrix(map, fxRates);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

      for (int i = 0; i < currencyFields.size(); i++) {
        final IndexON index = deserializer.fudgeMsgToObject(IndexON.class, (FudgeMsg) indexONFields.get(i).getValue());
        final YieldAndDiscountCurve curve = deserializer.fudgeMsgToObject(YieldAndDiscountCurve.class, (FudgeMsg) forwardONCurveFields.get(i).getValue());
        forwardONCurves.put(index, curve);
      }
      final FXMatrix fxMatrix = deserializer.fieldValueToObject(FXMatrix.class, message.getByName(FX_MATRIX_FIELD));
      return new MulticurveProviderDiscount(discountingCurves, forwardIborCurves, forwardONCurves, fxMatrix);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

      for (int i = 0; i < currencyFields.size(); i++) {
        final IndexON index = deserializer.fudgeMsgToObject(IndexON.class, (FudgeMsg) indexONFields.get(i).getValue());
        final YieldAndDiscountCurve curve = deserializer.fudgeMsgToObject(YieldAndDiscountCurve.class, (FudgeMsg) forwardONCurveFields.get(i).getValue());
        forwardONCurves.put(index, curve);
      }
      final FXMatrix fxMatrix = deserializer.fieldValueToObject(FXMatrix.class, message.getByName(FX_MATRIX_FIELD));
      return new MulticurveProviderForward(discountingCurves, forwardIborCurves, forwardONCurves, fxMatrix);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

    final List<FudgeField> curveNameFields = message.getAllByName(CURVES_NAME_FIELD_NAME);
    final List<FudgeField> ccyFields = message.getAllByName(CURRENCY_FIELD_NAME);
    final List<FudgeField> ccyCurveFields = message.getAllByName(CURRENCY_CURVE_FIELD_NAME);
    final Map<String, YieldAndDiscountCurve> curves = new LinkedHashMap<>(curveFields.size());
    final Map<String, Currency> curveCurrencys = Maps.newHashMapWithExpectedSize(ccyFields.size());
    final FXMatrix fxMatrix = deserializer.fieldValueToObject(FXMatrix.class, message.getByName(FX_MATRIX_FIELD_NAME));
    for (int i = 0; i < curveFields.size(); i++) {
      final YieldAndDiscountCurve curve = deserializer.fieldValueToObject(YieldAndDiscountCurve.class, curveFields.get(i));
      final String name = deserializer.fieldValueToObject(String.class, curveNameFields.get(i));
      curves.put(name, curve);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

    final ValueRequirement fxVolatilitySurfaceRequirement = getSurfaceRequirement(surfaceName, putCurrency, callCurrency, interpolatorName, leftExtrapolatorName, rightExtrapolatorName);
    final Object volatilitySurfaceObject = inputs.getValue(fxVolatilitySurfaceRequirement);
    if (volatilitySurfaceObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + fxVolatilitySurfaceRequirement);
    }
    final FXMatrix fxMatrix = new FXMatrix(ccy1, ccy2, spot);
    final ValueProperties.Builder properties = getResultProperties(target, desiredValue, baseQuotePair);
    final ValueSpecification spec = new ValueSpecification(_valueRequirementName, target.toSpecification(), properties.get());
    final YieldCurveBundle curvesWithFX = new YieldCurveBundle(fxMatrix, curveCurrency, yieldCurves.getCurvesMap());
    final ObjectsPair<Currency, Currency> currencyPair = Pair.of(ccy1, ccy2);
    BlackForexTermStructureParameters termStructure;
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

    final YieldCurveBundle yieldCurves = new YieldCurveBundle(allCurveNames, curves);
    final Object volatilitySurfaceObject = inputs.getValue(ValueRequirementNames.STANDARD_VOLATILITY_SURFACE_DATA);
    if (volatilitySurfaceObject == null) {
      throw new OpenGammaRuntimeException("Could not get volatility surface data");
    }
    final FXMatrix fxMatrix = new FXMatrix(ccy1, ccy2, spot);
    final YieldCurveBundle curvesWithFX = new YieldCurveBundle(fxMatrix, curveCurrency, yieldCurves.getCurvesMap());
    final Pair<Currency, Currency> currencyPair = Pair.of(ccy1, ccy2);
    if (volatilitySurfaceObject instanceof SmileDeltaTermStructureParametersStrikeInterpolation) {
      final SmileDeltaTermStructureParametersStrikeInterpolation smiles = (SmileDeltaTermStructureParametersStrikeInterpolation) volatilitySurfaceObject;
      final SmileDeltaTermStructureDataBundle smileBundle = new SmileDeltaTermStructureDataBundle(curvesWithFX, smiles, currencyPair);
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

  @Test
  public void converted() {
    final Currency ccy1 = Currency.EUR;
    final Currency ccy2 = Currency.USD;
    final FXMatrix fxMatrix = new FXMatrix(ccy1, ccy2, 1.25);
    final InflationSensitivity cs = InflationSensitivity.of(SENSI_11, SENSI_FWD_11, SENSI_33);
    final MultipleCurrencyInflationSensitivity mcs = MultipleCurrencyInflationSensitivity.of(ccy1, cs);
    final MultipleCurrencyInflationSensitivity mcsConverted = mcs.converted(ccy2, fxMatrix);
    final MultipleCurrencyInflationSensitivity mcsExpected = MultipleCurrencyInflationSensitivity.of(ccy2, cs.multipliedBy(fxMatrix.getFxRate(ccy1, ccy2)));
    AssertSensivityObjects.assertEquals("MultipleCurrencyCurveSensitivityMarket: converted", mcsExpected.cleaned(), mcsConverted.cleaned(), TOLERANCE);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.forex.method.FXMatrix

  @Test
  public void converted() {
    final Currency ccy1 = Currency.EUR;
    final Currency ccy2 = Currency.USD;
    final FXMatrix fxMatrix = new FXMatrix(ccy1, ccy2, 1.25);
    final MulticurveSensitivity cs = MulticurveSensitivity.of(SENSI_11, SENSI_FWD_11);
    final MultipleCurrencyMulticurveSensitivity mcs = MultipleCurrencyMulticurveSensitivity.of(ccy1, cs);
    final MultipleCurrencyMulticurveSensitivity mcsConverted = mcs.converted(ccy2, fxMatrix);
    final MultipleCurrencyMulticurveSensitivity mcsExpected = MultipleCurrencyMulticurveSensitivity.of(ccy2, cs.multipliedBy(fxMatrix.getFxRate(ccy1, ccy2)));
    AssertSensivityObjects.assertEquals("MultipleCurrencyCurveSensitivityMarket: converted", mcsExpected.cleaned(), mcsConverted.cleaned(), TOLERANCE);
  }
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.