Double price = _marketData.getDataPoint(_dataId);
if (price == null) {
price = 0.99;
// throw new OpenGammaRuntimeException("Could not get market data for " + _dataId);
}
final DeliverablePriceQuotedSwapFutureConvention futureConvention =
_conventionSource.getConvention(DeliverablePriceQuotedSwapFutureConvention.class, swapFuture.getFutureConvention());
final SwapConvention underlyingSwapConvention = _conventionSource.getConvention(SwapConvention.class, swapFuture.getSwapConvention());
final Tenor maturityTenor = swapFuture.getUnderlyingTenor();
final Convention payLegConvention = _conventionSource.getConvention(underlyingSwapConvention.getPayLegConvention());
if (payLegConvention == null) {
throw new OpenGammaRuntimeException("Convention with id " + underlyingSwapConvention.getPayLegConvention() + " was null");
}
final Convention receiveLegConvention = _conventionSource.getConvention(underlyingSwapConvention.getReceiveLegConvention());
if (receiveLegConvention == null) {
throw new OpenGammaRuntimeException("Convention with id " + underlyingSwapConvention.getPayLegConvention() + " was null");
}
if (!(payLegConvention instanceof SwapFixedLegConvention)) {
throw new OpenGammaRuntimeException("Convention of pay leg was not Fixed Leg for " + underlyingSwapConvention);
}
final SwapFixedLegConvention fixedLegConvention = (SwapFixedLegConvention) payLegConvention;
if (!(receiveLegConvention instanceof VanillaIborLegConvention)) {
throw new OpenGammaRuntimeException("Convention of pay leg was not Ibor Leg for " + underlyingSwapConvention);
}
final VanillaIborLegConvention iborLegConvention = (VanillaIborLegConvention) receiveLegConvention;
final String expiryCalculatorName = futureConvention.getExpiryConvention().getValue();
final ZonedDateTime startDate = _valuationTime.plus(swapFuture.getStartTenor().getPeriod());
final Calendar calendar = CalendarUtils.getCalendar(_regionSource, _holidaySource, futureConvention.getExchangeCalendar());
final ExchangeTradedInstrumentExpiryCalculator expiryCalculator = ExchangeTradedInstrumentExpiryCalculatorFactory.getCalculator(expiryCalculatorName);
final LocalTime time = startDate.toLocalTime();
final ZoneId timeZone = startDate.getZone();
final double notional = 1.0;
final int spotLagSwap = fixedLegConvention.getSettlementDays();