Class EtdFutureTrade

    • Method Detail

      • of

        public static EtdFutureTrade of​(TradeInfo tradeInfo,
                                        EtdFutureSecurity security,
                                        double quantity,
                                        double price)
        Obtains an instance from trade information, security, quantity and price.
        Parameters:
        tradeInfo - the trade information
        security - the security that was traded
        quantity - the quantity that was traded
        price - the price that was traded
        Returns:
        the trade
      • getSecurityId

        public SecurityId getSecurityId()
        Description copied from interface: SecurityQuantity
        Gets the security identifier.

        This identifier uniquely identifies the security within the system.

        Specified by:
        getSecurityId in interface SecurityQuantity
        Returns:
        the security identifier
      • getCurrency

        public Currency getCurrency()
        Gets the currency of the trade.

        This is typically the same as the currency of the product.

        Returns:
        the trading currency
      • meta

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

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

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

        public TradeInfo getInfo()
        Gets the additional trade information, defaulted to an empty instance.

        This allows additional information to be attached to the trade.

        Specified by:
        getInfo in interface PortfolioItem
        Specified by:
        getInfo in interface Trade
        Returns:
        the value of the property, not null
      • getSecurity

        public EtdFutureSecurity getSecurity()
        Gets the security that was traded.
        Returns:
        the value of the property, not null
      • getQuantity

        public double getQuantity()
        Gets the quantity that was traded.

        This is the number of contracts that were traded. This will be positive if buying and negative if selling.

        Specified by:
        getQuantity in interface SecurityQuantity
        Returns:
        the value of the property
      • getPrice

        public double getPrice()
        Gets the price that was traded, in decimal form.

        This is the price agreed when the trade occurred.

        Specified by:
        getPrice in interface SecurityQuantityTrade
        Returns:
        the value of the property
      • toBuilder

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object