Class EtdOptionSecurity

  • All Implemented Interfaces:
    EtdSecurity, Product, SecuritizedProduct, Security, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class EtdOptionSecurity
    extends Object
    implements EtdSecurity, org.joda.beans.ImmutableBean, Serializable
    An instrument representing an exchange traded derivative (ETD) option.

    A security representing a standardized contract that gives the buyer the right but not the obligation to buy or sell an underlying asset at an agreed price.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static EtdOptionSecurity of​(EtdContractSpec spec,
                                           YearMonth expiry,
                                           EtdVariant variant,
                                           int version,
                                           PutCall putCall,
                                           double strikePrice)
        Obtains an instance from a contract specification, expiry year-month, variant, version, put/call and strike price.

        The security identifier will be automatically created using EtdIdUtils. The specification must be for an option.

        Parameters:
        spec - the option contract specification
        expiry - the expiry year-month of the option
        variant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'
        version - the non-negative version, zero if versioning does not apply
        putCall - whether the option is a put or call
        strikePrice - the strike price of the option
        Returns:
        an option security based on this contract specification
        Throws:
        IllegalStateException - if the product type of the contract specification is not OPTION
      • of

        public static EtdOptionSecurity of​(EtdContractSpec spec,
                                           YearMonth expiry,
                                           EtdVariant variant,
                                           int version,
                                           PutCall putCall,
                                           double strikePrice,
                                           YearMonth underlyingExpiryMonth)
        Obtains an instance from a contract specification, expiry year-month, variant, version, put/call, strike price and underlying expiry.

        The security identifier will be automatically created using EtdIdUtils. The specification must be for an option.

        Parameters:
        spec - the option contract specification
        expiry - the expiry year-month of the option
        variant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'
        version - the non-negative version, zero if versioning does not apply
        putCall - whether the option is a put or call
        strikePrice - the strike price of the option
        underlyingExpiryMonth - the expiry of the underlying instrument, such as a future, may be null
        Returns:
        an option security based on this contract specification
        Throws:
        IllegalStateException - if the product type of the contract specification is not OPTION
      • getType

        public EtdType getType()
        Description copied from interface: EtdSecurity
        Gets the type of the contract - future or option.
        Specified by:
        getType in interface EtdSecurity
        Returns:
        the type, future or option
      • createProduct

        public EtdOptionSecurity createProduct​(ReferenceData refData)
        Description copied from interface: Security
        Creates the product associated with this security.

        The product of a security is distinct from the security. The product includes the financial details from this security, but excludes the additional information. The product also includes the products of any underlying securities.

        Specified by:
        createProduct in interface Security
        Parameters:
        refData - the reference data used to find underlying securities
        Returns:
        the product
      • createTrade

        public EtdOptionTrade createTrade​(TradeInfo tradeInfo,
                                          double quantity,
                                          double tradePrice,
                                          ReferenceData refData)
        Description copied from interface: Security
        Creates a trade based on this security.

        This creates a trade of a suitable type for this security.

        Specified by:
        createTrade in interface Security
        Parameters:
        tradeInfo - the trade information
        quantity - the number of contracts in the trade
        tradePrice - the price agreed when the trade occurred
        refData - the reference data used to find underlying securities
        Returns:
        the trade
      • createPosition

        public EtdOptionPosition createPosition​(PositionInfo positionInfo,
                                                double quantity,
                                                ReferenceData refData)
        Description copied from interface: Security
        Creates a position based on this security from a net quantity.

        This creates a position of a suitable type for this security.

        Specified by:
        createPosition in interface Security
        Parameters:
        positionInfo - the position information
        quantity - the number of contracts in the position
        refData - the reference data used to find underlying securities
        Returns:
        the position
      • createPosition

        public EtdOptionPosition createPosition​(PositionInfo positionInfo,
                                                double longQuantity,
                                                double shortQuantity,
                                                ReferenceData refData)
        Description copied from interface: Security
        Creates a position based on this security from a long and short quantity.

        This creates a position of a suitable type for this security.

        The long quantity and short quantity must be zero or positive, not negative.

        Specified by:
        createPosition in interface Security
        Parameters:
        positionInfo - the position information
        longQuantity - the long quantity in the position
        shortQuantity - the short quantity in the position
        refData - the reference data used to find underlying securities
        Returns:
        the position
      • summaryDescription

        public String summaryDescription()
        Summarizes this ETD option into string form.
        Returns:
        the summary description
      • meta

        public static EtdOptionSecurity.Meta meta()
        The meta-bean for EtdOptionSecurity.
        Returns:
        the meta-bean, not null
      • builder

        public static EtdOptionSecurity.Builder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • metaBean

        public EtdOptionSecurity.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getInfo

        public SecurityInfo getInfo()
        Gets the standard security information.

        This includes the security identifier.

        Specified by:
        getInfo in interface Security
        Returns:
        the value of the property, not null
      • getContractSpecId

        public EtdContractSpecId getContractSpecId()
        Gets the ID of the contract specification from which this security is derived.
        Specified by:
        getContractSpecId in interface EtdSecurity
        Returns:
        the value of the property, not null
      • getExpiry

        public YearMonth getExpiry()
        Gets the year-month of the expiry.

        Expiry will occur on a date implied by the variant of the ETD.

        Specified by:
        getExpiry in interface EtdSecurity
        Returns:
        the value of the property, not null
      • getVariant

        public EtdVariant getVariant()
        Gets the variant of ETD.

        This captures the variant of the ETD. The most common variant is 'Monthly'. Other variants are 'Weekly', 'Daily' and 'Flex'.

        When building, this defaults to 'Monthly'.

        Specified by:
        getVariant in interface EtdSecurity
        Returns:
        the value of the property, not null
      • getVersion

        public int getVersion()
        Gets the version of the option, defaulted to zero.

        Some options can have multiple versions, representing some kind of change over time. Version zero is the baseline, version one and later indicates some kind of change occurred.

        Returns:
        the value of the property
      • getPutCall

        public PutCall getPutCall()
        Gets whether the option is a put or call.
        Returns:
        the value of the property, not null
      • getStrikePrice

        public double getStrikePrice()
        Gets the strike price, in decimal form, may be negative.
        Returns:
        the value of the property
      • getUnderlyingExpiryMonth

        public Optional<YearMonth> getUnderlyingExpiryMonth()
        Gets the expiry year-month of the underlying instrument.

        If an option has an underlying instrument, the expiry of that instrument can be specified here. For example, you can have an option expiring in March on the underlying March future, or on the underlying June future. Not all options have an underlying instrument, thus the property is optional.

        In many cases, the expiry of the underlying instrument is the same as the expiry of the option. In this case, the expiry is often omitted, even though it probably should not be.

        Returns:
        the optional value of the property, not null
      • toBuilder

        public EtdOptionSecurity.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object