Class TradeDTO
java.lang.Object
tech.cassandre.trading.bot.dto.trade.TradeDTO
DTO representing a trade.
A trade is the action of buying and selling goods and services.
This is how it works: - Received ticker - It means 1 Ether can be bought with 0.034797 Bitcoin currencyPair=ETH/BTC last=0.034797 (Last trade field is the price set during the last trade).
- Account before buying BTC: 0.99963006 ETH: 10
- Buying 0.004 Bitcoin (should cost 0.05748 ether). TradeDTO{currencyPair=ETH/BTC, originalAmount=0.004, price=0.034797}
- Account after buying BTC: 0.99949078 ETH: 10.004 It cost me 0.00013928 BTC (0.99949078 - 0.99963006). price * amount = 0.034797 * 0.004
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TradeDTO.TradeDTOBuilder
builder()
boolean
Amount of the trade.Returns amount value.Currency pair.getFee()
The fee that was charged by the exchange for this order.Returns fee value.getOrder()
The order object responsible for this trade.The order id of the order responsible for this trade.getPrice()
The price.Returns price value.The timestamp of the trade.An identifier set by the exchange that uniquely identifies the trade.getType()
Trade type i.e.getUid()
Technical id.An identifier provided by the user on placement that uniquely identifies the order.int
hashCode()
toString()
-
Method Details
-
getAmountValue
Returns amount value.- Returns:
- amount value
-
getPriceValue
Returns price value.- Returns:
- price value
-
getFeeValue
Returns fee value.- Returns:
- fee value
-
equals
-
hashCode
public int hashCode() -
builder
-
getUid
Technical id. -
getTradeId
An identifier set by the exchange that uniquely identifies the trade. -
getType
Trade type i.e. bid (buy) or ask (sell). -
getOrderId
The order id of the order responsible for this trade. -
getOrder
The order object responsible for this trade. -
getCurrencyPair
Currency pair. -
getAmount
Amount of the trade. -
getPrice
The price. -
getFee
The fee that was charged by the exchange for this order. -
getUserReference
An identifier provided by the user on placement that uniquely identifies the order. -
getTimestamp
The timestamp of the trade. -
toString
-