Esempio n. 1
0
 //-------------------------------------------------------------------------
 internal static EtdContractSpec sut()
 {
     return(EtdContractSpec.builder().id(EtdContractSpecId.of("test", "123")).type(EtdType.FUTURE).exchangeId(ExchangeIds.ECAG).contractCode(EtdContractCode.of("FOO")).description("A test future template").priceInfo(SecurityPriceInfo.of(Currency.GBP, 100)).build());
 }
Esempio n. 2
0
 internal static EtdContractSpec sut2()
 {
     return(EtdContractSpec.builder().type(EtdType.OPTION).exchangeId(ExchangeIds.IFEN).contractCode(EtdContractCode.of("BAR")).description("A test option template").priceInfo(SecurityPriceInfo.of(Currency.EUR, 10)).addAttribute(AttributeType.NAME, "NAME").build());
 }
Esempio n. 3
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance from a contract specification, expiry year-month, variant, version, put/call and strike price.
 /// <para>
 /// The security identifier will be automatically created using <seealso cref="EtdIdUtils"/>.
 /// The specification must be for an option.
 ///
 /// </para>
 /// </summary>
 /// <param name="spec">  the option contract specification </param>
 /// <param name="expiry">  the expiry year-month of the option </param>
 /// <param name="variant">  the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex' </param>
 /// <param name="version">  the non-negative version, zero if versioning does not apply </param>
 /// <param name="putCall">  whether the option is a put or call </param>
 /// <param name="strikePrice">  the strike price of the option </param>
 /// <returns> an option security based on this contract specification </returns>
 /// <exception cref="IllegalStateException"> if the product type of the contract specification is not {@code OPTION} </exception>
 public static EtdOptionSecurity of(EtdContractSpec spec, YearMonth expiry, EtdVariant variant, int version, PutCall putCall, double strikePrice)
 {
     return(of(spec, expiry, variant, version, putCall, strikePrice, null));
 }