}
return new ArbitraryViewCycleExecutionSequence(executionSequence);
}
private MarketDataSpecification createMarketDataSpec(LocalDate previousHistoricalDate, LocalDate historicalDate, LocalDate valuationDate) {
FixedHistoricalMarketDataSpecification historicalDateSpec = new FixedHistoricalMarketDataSpecification(historicalDate);
switch (_marketDataMode) {
case HISTORICAL:
return historicalDateSpec;
case RELATIVE_SHOCK:
if (previousHistoricalDate == null) {
return null;
}
FixedHistoricalMarketDataSpecification valuationDateSpec = new FixedHistoricalMarketDataSpecification(valuationDate);
FixedHistoricalMarketDataSpecification previousHistoricalDateSpec = new FixedHistoricalMarketDataSpecification(previousHistoricalDate);
return new HistoricalShockMarketDataSpecification(ShockType.PROPORTIONAL, previousHistoricalDateSpec, historicalDateSpec, valuationDateSpec);
default:
throw new OpenGammaRuntimeException("Unsupported market data mode: " + _marketDataMode);
}
}