Examples of FactorExposureData


Examples of com.opengamma.financial.sensitivities.FactorExposureData

      final YieldAndDiscountCurve curve) {
    final Collection<FactorExposureData> decodedSensitivities = RawSecurityUtils.decodeFactorExposureData(secSource, rawSecurity);
    final double[] entries = new double[curveSpec.getStrips().size()];
    int i = 0;
    for (final FixedIncomeStripWithSecurity strip : curveSpec.getStrips()) {
      final FactorExposureData swapExternalSensitivitiesData = searchForSwapTenorMatch(decodedSensitivities, strip);
      if (swapExternalSensitivitiesData != null) {
        final ComputedValue computedValue = inputs.getComputedValue(getSensitivityRequirement(swapExternalSensitivitiesData.getExposureExternalId()));
        if (computedValue != null) {
          final ManageableHistoricalTimeSeries mhts = (ManageableHistoricalTimeSeries) computedValue.getValue();
          final Double value = mhts.getTimeSeries().getLatestValue();
          entries[i] = -value; //* (qty.doubleValue() ); // we invert here because OpenGamma uses -1bp shift rather than +1.  DV01 function will invert back.
        } else {
          s_logger.warn("Value was null when getting required input data " + swapExternalSensitivitiesData.getExposureExternalId());
          entries[i] = 0d;
        }
      } else {
        entries[i] = 0d;
      }
      i++;
    }
    // Quick hack to map in bond data.
    i = 0;
    for (final FixedIncomeStripWithSecurity strip : curveSpec.getStrips()) {
      final FactorExposureData bondExternalSensitivitiesData = searchForBondTenorMatch(decodedSensitivities, strip);
      if (bondExternalSensitivitiesData != null) {
        final ComputedValue computedValue = inputs.getComputedValue(getSensitivityRequirement(bondExternalSensitivitiesData.getExposureExternalId()));
        if (computedValue != null) {
          final ManageableHistoricalTimeSeries mhts = (ManageableHistoricalTimeSeries) computedValue.getValue();
          final Double value = mhts.getTimeSeries().getLatestValue();
          entries[i] -= value; //* (qty.doubleValue() ); // we invert here because OpenGamma uses -1bp shift rather than +1.  DV01 function will invert back.
        } else {
          s_logger.warn("Value was null when getting required input data " + bondExternalSensitivitiesData.getExposureExternalId());
        }
      }
      i++;
    }
    return new DoubleMatrix1D(entries);
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.