Record Class Trade
java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.core.Trade
- Record Components:
id- exchange-assigned trade identifierinstrument- the traded instrumentside- BUY or SELLamount- base amount tradedprice- execution pricefeeCurrency- fee currency (may be null if not reported)fee- fee amount (may be null if not reported)timestamp- execution timestamp in epoch milliseconds
public record Trade(String id, Instrument instrument, OrderSide side, BigDecimal amount, BigDecimal price, Asset feeCurrency, BigDecimal fee, long timestamp)
extends Record
Canonical trade record for the engine domain (replaces XChange
UserTrade in domain code).-
Constructor Summary
ConstructorsConstructorDescriptionTrade(String id, Instrument instrument, OrderSide side, BigDecimal amount, BigDecimal price, Asset feeCurrency, BigDecimal fee, long timestamp) Creates an instance of aTraderecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.fee()Returns the value of thefeerecord component.Returns the value of thefeeCurrencyrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theinstrumentrecord component.price()Returns the value of thepricerecord component.side()Returns the value of thesiderecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Trade
public Trade(String id, Instrument instrument, OrderSide side, BigDecimal amount, BigDecimal price, Asset feeCurrency, BigDecimal fee, long timestamp) Creates an instance of aTraderecord class.- Parameters:
id- the value for theidrecord componentinstrument- the value for theinstrumentrecord componentside- the value for thesiderecord componentamount- the value for theamountrecord componentprice- the value for thepricerecord componentfeeCurrency- the value for thefeeCurrencyrecord componentfee- the value for thefeerecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
instrument
Returns the value of theinstrumentrecord component.- Returns:
- the value of the
instrumentrecord component
-
side
-
amount
-
price
-
feeCurrency
Returns the value of thefeeCurrencyrecord component.- Returns:
- the value of the
feeCurrencyrecord component
-
fee
-
timestamp
-