final Map<UnderlyingType, DoubleTimeSeries<?>> tsReturns = new HashMap<UnderlyingType, DoubleTimeSeries<?>>();
final Period samplingPeriod = getSamplingPeriod(samplingPeriodName);
final LocalDate startDate = now.minus(samplingPeriod);
final Schedule scheduleCalculator = getScheduleCalculator(scheduleCalculatorName);
final TimeSeriesSamplingFunction samplingFunction = getSamplingFunction(samplingFunctionName);
final TimeSeriesReturnCalculator returnCalculator = getTimeSeriesReturnCalculator(returnCalculatorName);
final LocalDate[] schedule = HOLIDAY_REMOVER.getStrippedSchedule(scheduleCalculator.getSchedule(startDate, now, true, false), WEEKEND_CALENDAR); //REVIEW emcleod should "fromEnd" be hard-coded?
final LocalDateDoubleTimeSeries sampledTS = samplingFunction.getSampledTimeSeries(timeSeries.getTimeSeries(), schedule);
for (final UnderlyingType underlyingType : valueGreek.getUnderlyingGreek().getUnderlying().getUnderlyings()) {
if (underlyingType != UnderlyingType.SPOT_PRICE) {
throw new OpenGammaRuntimeException("Have hard-coded to only use delta; should not have anything with " + underlyingType + " as the underlying type");
}
tsReturns.put(underlyingType, returnCalculator.evaluate(sampledTS));
}
dataBundleArray[0] = new SensitivityAndReturnDataBundle(sensitivity, value, tsReturns);
final DoubleTimeSeries<?> result = PNL_CALCULATOR.evaluate(dataBundleArray);
// Please see http://jira.opengamma.com/browse/PLAT-2330 for information about the PROPERTY_PNL_CONTRIBUTIONS constant
final ValueProperties properties = createValueProperties()