Package com.opengamma.timeseries.date.localdate

Examples of com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries.multiply()


    final Set<String> returnCalculatorNames = desiredValue.getConstraints().getValues(ValuePropertyNames.RETURN_CALCULATOR);
    final TimeSeriesReturnCalculator returnCalculator = getTimeSeriesReturnCalculator(returnCalculatorNames);
    final LocalDateDoubleTimeSeries returnSeries = (LocalDateDoubleTimeSeries) returnCalculator.evaluate((LocalDateDoubleTimeSeries) priceSeriesObj);
    final ValueSpecification resultSpec = new ValueSpecification(ValueRequirementNames.PNL_SERIES, target.toSpecification(), desiredValue.getConstraints());
    //final Object result = returnSeries.multiply(fairValue);
    final Object result = returnSeries.multiply(fairValue).multiply(target.getPosition().getQuantity().doubleValue());
    return Collections.singleton(new ComputedValue(resultSpec, result));
  }

  private TimeSeriesReturnCalculator getTimeSeriesReturnCalculator(final Set<String> calculatorNames) {
    if (calculatorNames == null || calculatorNames.isEmpty() || calculatorNames.size() != 1) {
View Full Code Here


      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)
        .with(CURRENCY, currency)
View Full Code Here

        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)
        .with(CURRENCY, currency)
View Full Code Here

        throw new OpenGammaRuntimeException("No time-series for strip with tenor " + tenor);
      }
      final LocalDateDoubleTimeSeries nodeTimeSeries = samplingFunction.getSampledTimeSeries(dbNodeTimeSeries.getTimeSeries(), schedule);
      LocalDateDoubleTimeSeries returnSeries = getReturnSeries(nodeTimeSeries, desiredValue);
      if (sensitivityToRate) {
        returnSeries = returnSeries.multiply(-1);
      }

      // Clip the time-series to the range originally asked for
      returnSeries = returnSeries.subSeries(startDate, includeStart, returnSeries.getLatestTime(), true);
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.