public void test_weekly() { EtdVariant test = EtdVariant.ofWeekly(2); assertEquals(test.getType(), EtdExpiryType.WEEKLY); assertEquals(test.getDateCode().getAsInt(), 2); assertEquals(test.getSettlementType().isPresent(), false); assertEquals(test.getOptionType().isPresent(), false); assertEquals(test.isFlex(), false); assertEquals(test.getCode(), "W2"); }
return Pair.of(yearMonth, EtdVariant.ofMonthly()); } else { return Pair.of(yearMonth, EtdVariant.ofWeekly(week));
public void test_optionId_weekly() { SecurityId test = EtdIdUtils.optionId( ExchangeIds.ECAG, FGBS, YearMonth.of(2017, 6), EtdVariant.ofWeekly(3), 0, PutCall.CALL, -1.45); assertEquals(test.getStandardId(), StandardId.of("OG-ETD", "O-ECAG-FGBS-201706W3-CM1.45")); }
public void test_futureId_weekly() { SecurityId test = EtdIdUtils.futureId(ExchangeIds.ECAG, FGBS, YearMonth.of(2017, 6), EtdVariant.ofWeekly(2)); assertEquals(test.getStandardId(), StandardId.of("OG-ETD", "F-ECAG-FGBS-201706W2")); }
public void test_optionIdUnderlying_weekly() { SecurityId test = EtdIdUtils.optionId( ExchangeIds.ECAG, FGBS, YearMonth.of(2017, 6), EtdVariant.ofWeekly(3), 0, PutCall.CALL, -1.45, YearMonth.of(2017, 9)); assertEquals(test.getStandardId(), StandardId.of("OG-ETD", "O-ECAG-FGBS-201706W3-CM1.45-U201709")); }
static EtdFutureSecurity sut2() { return EtdFutureSecurity.builder() .info(SecurityInfo.of(SecurityId.of("B", "C"), SecurityPriceInfo.of(Currency.EUR, 10))) .contractSpecId(EtdContractSpecId.of("test", "234")) .expiry(YearMonth.of(2017, 9)) .variant(EtdVariant.ofWeekly(2)) .build(); }
static EtdOptionSecurity sut2() { return EtdOptionSecurity.builder() .info(SecurityInfo.of(SecurityId.of("B", "C"), SecurityPriceInfo.of(Currency.EUR, 10))) .contractSpecId(EtdContractSpecId.of("test", "234")) .expiry(YearMonth.of(2017, 9)) .variant(EtdVariant.ofWeekly(2)) .version(4) .putCall(PutCall.CALL) .strikePrice(3) .underlyingExpiryMonth(YearMonth.of(2017, 12)) .build(); }
.id(StandardId.of("OG", "123423")) .build()) .securityId(EtdIdUtils.futureId(ExchangeIds.ECAG, FGBL, YearMonth.of(2017, 6), EtdVariant.ofWeekly(2))) .longQuantity(0d) .shortQuantity(20d) .build()) .securityId(EtdIdUtils.optionId( ExchangeIds.ECAG, OGBL, YearMonth.of(2017, 6), EtdVariant.ofWeekly(2), 0, PutCall.PUT, 5.1d)) .longQuantity(0d) .shortQuantity(20d)
.id(StandardId.of("OG", "123433")) .build()) .security(EtdOptionSecurity.of(contract, YearMonth.of(2017, 6), EtdVariant.ofWeekly(2), 0, PutCall.PUT, 5.1d)) .longQuantity(0d) .shortQuantity(20d)
.id(StandardId.of("OG", "123423")) .build()) .security(EtdFutureSecurity.of(contract, YearMonth.of(2017, 6), EtdVariant.ofWeekly(2))) .longQuantity(0d) .shortQuantity(20d)