Class Trade

    • Field Detail

      • type

        protected final Order.OrderType type
        Did this trade result from the execution of a bid or a ask?
      • originalAmount

        protected final BigDecimal originalAmount
        Amount that was traded
      • instrument

        protected final Instrument instrument
        The instrument
      • price

        protected final BigDecimal price
        The price
      • timestamp

        protected final Date timestamp
        The timestamp of the trade according to the exchange's server, null if not provided
      • id

        protected final String id
        The trade id
      • makerOrderId

        protected final String makerOrderId
      • takerOrderId

        protected final String takerOrderId
    • Constructor Detail

      • Trade

        public Trade​(Order.OrderType type,
                     BigDecimal originalAmount,
                     Instrument instrument,
                     BigDecimal price,
                     Date timestamp,
                     String id,
                     String makerOrderId,
                     String takerOrderId)
        This constructor is called to create a public Trade object in MarketDataService.getTrades(org.knowm.xchange.currency.CurrencyPair, Object...) implementations) since it's missing the orderId and fee parameters.
        Parameters:
        type - The trade type (BID side or ASK side)
        originalAmount - The depth of this trade
        price - The price (either the bid or the ask)
        timestamp - The timestamp of the trade according to the exchange's server, null if not provided
        id - The id of the trade
        makerOrderId - The orderId of the maker in the trade
        takerOrderId - The orderId of the taker in the trade