Class OrderDTO
- java.lang.Object
-
- tech.cassandre.trading.bot.dto.trade.OrderDTO
-
public final class OrderDTO extends Object
DTO representing an order. A market order is a request by an investor to buy or sell in the current market.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OrderDTO.OrderDTOBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OrderDTO.OrderDTOBuilder
builder()
boolean
equals(Object o)
CurrencyAmountDTO
getAmount()
Amount that was ordered.CurrencyAmountDTO
getAveragePrice()
Weighted Average price of the fills in the order.CurrencyAmountDTO
getCumulativeAmount()
Amount to be ordered / amount that has been matched against order on the order book/filled.CurrencyPairDTO
getCurrencyPair()
Currency pair.Long
getId()
Technical id.String
getLeverage()
The leverage to use for margin related to this order.CurrencyAmountDTO
getLimitPrice()
Limit price.String
getOrderId()
An identifier set by the exchange that uniquely identifies the order.OrderStatusDTO
getStatus()
Order status.StrategyDTO
getStrategy()
The strategy that created the order.ZonedDateTime
getTimestamp()
The timestamp of the order.Optional<TradeDTO>
getTrade(String tradeId)
Returns trade from its id.Set<TradeDTO>
getTrades()
All trades related to order.OrderTypeDTO
getType()
Order type i.e. bid or ask.String
getUserReference()
An identifier provided by the user on placement that uniquely identifies the order.int
hashCode()
String
toString()
-
-
-
Method Detail
-
getTrade
public final Optional<TradeDTO> getTrade(String tradeId)
Returns trade from its id.- Parameters:
tradeId
- trade id- Returns:
- trade
-
builder
public static OrderDTO.OrderDTOBuilder builder()
-
getId
public Long getId()
Technical id.
-
getOrderId
public String getOrderId()
An identifier set by the exchange that uniquely identifies the order.
-
getType
public OrderTypeDTO getType()
Order type i.e. bid or ask.
-
getStrategy
public StrategyDTO getStrategy()
The strategy that created the order.
-
getCurrencyPair
public CurrencyPairDTO getCurrencyPair()
Currency pair.
-
getAmount
public CurrencyAmountDTO getAmount()
Amount that was ordered.
-
getAveragePrice
public CurrencyAmountDTO getAveragePrice()
Weighted Average price of the fills in the order.
-
getLimitPrice
public CurrencyAmountDTO getLimitPrice()
Limit price.
-
getLeverage
public String getLeverage()
The leverage to use for margin related to this order.
-
getStatus
public OrderStatusDTO getStatus()
Order status.
-
getCumulativeAmount
public CurrencyAmountDTO getCumulativeAmount()
Amount to be ordered / amount that has been matched against order on the order book/filled.
-
getUserReference
public String getUserReference()
An identifier provided by the user on placement that uniquely identifies the order.
-
getTimestamp
public ZonedDateTime getTimestamp()
The timestamp of the order.
-
-