if (underlyingSecurity instanceof IndexFutureSecurity) {
final IndexFutureSecurity underlyingFuture = ((IndexFutureSecurity) underlyingSecurity);
underlying = (IndexFutureDefinition) underlyingFuture.accept(_futureSecurityConverter);
} else if (underlyingSecurity instanceof EquityFutureSecurity) {
final EquityFutureSecurity underlyingFuture = ((EquityFutureSecurity) underlyingSecurity);
EquityFutureDefinition eqFut = (EquityFutureDefinition) underlyingFuture.accept(_futureSecurityConverter);
underlying = new IndexFutureDefinition(eqFut.getExpiryDate(), eqFut.getSettlementDate(), eqFut.getStrikePrice(), eqFut.getCurrency(), eqFut.getUnitAmount(), underlyingFuture.getUnderlyingId());
}
final double strike = security.getStrike();
final ExerciseDecisionType exerciseType = security.getExerciseType().accept(ExerciseTypeAnalyticsVisitorAdapter.getInstance());