Package com.opengamma.financial.analytics.ircurve.strips

Examples of com.opengamma.financial.analytics.ircurve.strips.CurveNodeWithIdentifier


    public CurveNodeWithIdentifier buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final CurveNode curveStrip = (CurveNode) deserializer.fieldValueToObject(message.getByName(CURVE_STRIP_FIELD));
      final ExternalId id = deserializer.fieldValueToObject(ExternalId.class, message.getByName(ID_FIELD));
      final String dataField = message.getString(DATA_FIELD);
      final DataFieldType fieldType = DataFieldType.valueOf(message.getString(TYPE_FIELD));
      return new CurveNodeWithIdentifier(curveStrip, id, dataField, fieldType);
    }
View Full Code Here


    final LocalDateDoubleTimeSeries[] returnSeries = new LocalDateDoubleTimeSeries[n];
    final HistoricalTimeSeriesBundle tsBundle = (HistoricalTimeSeriesBundle) inputs.getValue(CURVE_HISTORICAL_TIME_SERIES);
    final Iterator<CurveNodeWithIdentifier> iterator = curveSpec.getNodes().iterator();
    for (int i = 0; i < n; i++) {
      final double sensitivity = ycns[i];
      final CurveNodeWithIdentifier curveNode = iterator.next();
      final HistoricalTimeSeries ts = tsBundle.get(curveNode.getDataField(), curveNode.getIdentifier());
      if (ts == null) {
        throw new OpenGammaRuntimeException("Could not get time series for id " + curveNode.getIdentifier() + " and data field " + curveNode.getDataField());
      }
      final LocalDateDoubleTimeSeries pnlSeries = getReturnSeries(ts.getTimeSeries(), desiredValue, executionContext);
      tenors[i] = curveNode.getCurveNode().getResolvedMaturity();
      returnSeries[i] = pnlSeries.multiply(sensitivity * position.getQuantity().doubleValue());
    }
    final TenorLabelledLocalDateDoubleTimeSeriesMatrix1D matrix = new TenorLabelledLocalDateDoubleTimeSeriesMatrix1D(tenors, labels, returnSeries);
    final ValueProperties properties = desiredValue.getConstraints().copy()
        .withoutAny(CURRENCY)
View Full Code Here

    final LocalDateDoubleTimeSeries[] returnSeries = new LocalDateDoubleTimeSeries[n];
    final HistoricalTimeSeriesBundle tsBundle = (HistoricalTimeSeriesBundle) inputs.getValue(CURVE_HISTORICAL_TIME_SERIES);
    final Iterator<CurveNodeWithIdentifier> iterator = curveSpec.getNodes().iterator();
    for (int i = 0; i < n; i++) {
      final double sensitivity = fcns[i];
      final CurveNodeWithIdentifier curveNode = iterator.next();
      final HistoricalTimeSeries ts = tsBundle.get(curveNode.getDataField(), curveNode.getIdentifier());
      if (ts == null) {
        throw new OpenGammaRuntimeException("Could not get time series for id " + curveNode.getIdentifier() + " and data field " + curveNode.getDataField());
      }
      LocalDateDoubleTimeSeries pnlSeries;
      if (curveNode instanceof PointsCurveNodeWithIdentifier) {
        final PointsCurveNodeWithIdentifier pointsCurveNode = (PointsCurveNodeWithIdentifier) curveNode;
        final HistoricalTimeSeries underlyingSeries = tsBundle.get(pointsCurveNode.getUnderlyingDataField(), pointsCurveNode.getUnderlyingIdentifier());
        if (underlyingSeries == null) {
          throw new OpenGammaRuntimeException("Could not get time series for id " + pointsCurveNode.getUnderlyingIdentifier() + " and data field " + pointsCurveNode.getUnderlyingDataField());
        }
        pnlSeries = getReturnSeries(ts.getTimeSeries().add(underlyingSeries.getTimeSeries()), desiredValue, executionContext);
      } else {
        pnlSeries = getReturnSeries(ts.getTimeSeries(), desiredValue, executionContext);
      }
      tenors[i] = curveNode.getCurveNode().getResolvedMaturity();
      returnSeries[i] = pnlSeries.multiply(sensitivity * position.getQuantity().doubleValue());
    }
    final TenorLabelledLocalDateDoubleTimeSeriesMatrix1D matrix = new TenorLabelledLocalDateDoubleTimeSeriesMatrix1D(tenors, labels, returnSeries);
    final ValueProperties properties = desiredValue.getConstraints().copy()
        .withoutAny(CURRENCY)
View Full Code Here

  public CurveNodeWithIdentifier visitCashNode(final CashNode node) {
    final Tenor tenor = node.getMaturityTenor();
    final ExternalId identifier = _nodeIdMapper.getCashNodeId(_curveDate, tenor);
    final String dataField = _nodeIdMapper.getCashNodeDataField(tenor);
    final DataFieldType fieldType = _nodeIdMapper.getCashNodeDataFieldType(tenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

  public CurveNodeWithIdentifier visitContinuouslyCompoundedRateNode(final ContinuouslyCompoundedRateNode node) {
    final Tenor tenor = node.getTenor();
    final ExternalId identifier = _nodeIdMapper.getContinuouslyCompoundedRateNodeId(_curveDate, tenor);
    final String dataField = _nodeIdMapper.getContinuouslyCompoundedRateNodeDataField(tenor);
    final DataFieldType fieldType = _nodeIdMapper.getContinuouslyCompoundedRateDataFieldType(tenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

  public CurveNodeWithIdentifier visitCreditSpreadNode(final CreditSpreadNode node) {
    final Tenor tenor = node.getTenor();
    final ExternalId identifier = _nodeIdMapper.getCreditSpreadNodeId(_curveDate, tenor);
    final String dataField = _nodeIdMapper.getCreditSpreadNodeDataField(tenor);
    final DataFieldType fieldType = _nodeIdMapper.getCreditSpreadNodeDataFieldType(tenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

    final Tenor startTenor = node.getStartTenor();
    final ExternalId identifier = _nodeIdMapper.getDeliverableSwapFutureNodeId(_curveDate, startTenor,
        node.getFutureTenor(), node.getFutureNumber());
    final String dataField = _nodeIdMapper.getDeliverableSwapFutureNodeDataField(startTenor);
    final DataFieldType fieldType = _nodeIdMapper.getDeliverableSwapFutureNodeDataFieldType(startTenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

  public CurveNodeWithIdentifier visitDiscountFactorNode(final DiscountFactorNode node) {
    final Tenor tenor = node.getTenor();
    final ExternalId identifier = _nodeIdMapper.getDiscountFactorNodeId(_curveDate, tenor);
    final String dataField = _nodeIdMapper.getDiscountFactorNodeDataField(tenor);
    final DataFieldType fieldType = _nodeIdMapper.getDiscountFactorNodeDataFieldType(tenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

  public CurveNodeWithIdentifier visitFRANode(final FRANode node) {
    final Tenor tenor = node.getFixingEnd();
    final ExternalId identifier = _nodeIdMapper.getFRANodeId(_curveDate, tenor);
    final String dataField = _nodeIdMapper.getFRANodeDataField(tenor);
    final DataFieldType fieldType = _nodeIdMapper.getFRANodeDataFieldType(tenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

      return new PointsCurveNodeWithIdentifier(node, identifier, dataField, fieldType, underlyingId, underlyingField);
    }
    final ExternalId identifier = _nodeIdMapper.getFXForwardNodeId(_curveDate, tenor);
    final String dataField = _nodeIdMapper.getFXForwardNodeDataField(tenor);
    final DataFieldType fieldType = _nodeIdMapper.getFXForwardNodeDataFieldType(tenor);
    return new CurveNodeWithIdentifier(node, identifier, dataField, fieldType);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.analytics.ircurve.strips.CurveNodeWithIdentifier

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.