Package org.knowm.xchange.dto.marketdata
Class Trade
java.lang.Object
org.knowm.xchange.dto.marketdata.Trade
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UserTrade
Data object representing a Trade
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe trade idprotected final InstrumentThe instrumentprotected final Stringprotected final BigDecimalAmount that was tradedprotected final BigDecimalThe priceprotected final Stringprotected final DateThe timestamp of the trade according to the exchange's server, null if not providedprotected final Order.OrderTypeDid this trade result from the execution of a bid or a ask? -
Constructor Summary
ConstructorsConstructorDescriptionTrade(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 inMarketDataService.getTrades(org.knowm.xchange.currency.CurrencyPair, Object...)implementations) since it's missing the orderId and fee parameters. -
Method Summary
-
Field Details
-
type
Did this trade result from the execution of a bid or a ask? -
originalAmount
Amount that was traded -
instrument
The instrument -
price
The price -
timestamp
The timestamp of the trade according to the exchange's server, null if not provided -
id
The trade id -
makerOrderId
-
takerOrderId
-
-
Constructor Details
-
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 inMarketDataService.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 tradeprice- The price (either the bid or the ask)timestamp- The timestamp of the trade according to the exchange's server, null if not providedid- The id of the trademakerOrderId- The orderId of the maker in the tradetakerOrderId- The orderId of the taker in the trade
-
-
Method Details
-
getType
-
getOriginalAmount
-
getInstrument
-
getCurrencyPair
Deprecated.CurrencyPair is a subtype of Instrument - this method will throw an exception if the order was for a derivativeuse
getInstrument()instead -
getPrice
-
getTimestamp
-
getId
-
getMakerOrderId
-
getTakerOrderId
-
equals
-
hashCode
public int hashCode() -
toString
-