private IRFutureOptionTrade createIRFutureOptionTrade() { String exchange = "TestExchange"; ExerciseType exerciseType = new EuropeanExerciseType(); double pointValue = Double.NaN; boolean margined = true; double strike = 0.99; OptionType optionType = OptionType.PUT; ExternalId irFutureId = Iterables.getOnlyElement(_irFuture.getExternalIdBundle()); IRFutureOptionSecurity irFutureOption = new IRFutureOptionSecurity( exchange, _irFuture.getExpiry(), exerciseType, irFutureId, pointValue, margined, _irFuture.getCurrency(), strike, optionType); // Need this for time series lookup irFutureOption.setExternalIdBundle( ExternalSchemes.syntheticSecurityId("Test future option").toBundle()); Counterparty counterparty = new SimpleCounterparty(ExternalId.of(Counterparty.DEFAULT_SCHEME, "COUNTERPARTY")); BigDecimal tradeQuantity = BigDecimal.valueOf(1); SimpleTrade trade = new SimpleTrade(irFutureOption, tradeQuantity, counterparty, TRADE_DATE, TRADE_TIME); trade.setPremium(10.0); trade.setPremiumCurrency(Currency.USD); return new IRFutureOptionTrade(trade); }
private static MarketDataEnvironment createSuppliedData() { LocalDateDoubleTimeSeries optionPrice = ImmutableLocalDateDoubleTimeSeries.of(VALUATION_TIME.toLocalDate(), 0.975); RawId<Double> optionRawId = RawId.of(ExternalSchemes.syntheticSecurityId("Test future option").toBundle()); MarketDataEnvironmentBuilder builder = new MarketDataEnvironmentBuilder(); builder.add(optionRawId, optionPrice); builder.add(VolatilitySurfaceId.of("TestExchange"), new VolatilitySurface(TEST_SURFACE)); builder.valuationTime(VALUATION_TIME); return builder.build(); }
private InterestRateFutureSecurity createIRFuture() { Expiry expiry = new Expiry(ZonedDateTime.of(LocalDate.of(2014, 6, 18), LocalTime.of(0, 0), ZoneOffset.UTC)); String tradingExchange = ""; String settlementExchange = ""; Currency currency = Currency.USD; double unitAmount = 1000; ExternalId underlyingId = InterestRateMockSources.getLiborIndexId(); String category = ""; InterestRateFutureSecurity irFuture = new InterestRateFutureSecurity( expiry, tradingExchange, settlementExchange, currency, unitAmount, underlyingId, category); // Need this for time series lookup ExternalId irFutureId = ExternalSchemes.syntheticSecurityId("Test future"); irFuture.setExternalIdBundle(irFutureId.toBundle()); return irFuture; }