Interface TradeService
-
- All Known Implementing Classes:
TradeServiceInDryMode
,TradeServiceXChangeImplementation
public interface TradeService
Service giving information about orders and allowing you to create new orders.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cancelOrder(String orderId)
Cancel order.OrderCreationResultDTO
createBuyLimitOrder(CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice)
Creates a buy limit order.OrderCreationResultDTO
createBuyMarketOrder(CurrencyPairDTO currencyPair, BigDecimal amount)
Creates a buy market order.OrderCreationResultDTO
createSellLimitOrder(CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice)
Creates a sell limit order.OrderCreationResultDTO
createSellMarketOrder(CurrencyPairDTO currencyPair, BigDecimal amount)
Creates a sell market order.Optional<OrderDTO>
getOpenOrderByOrderId(String orderId)
Get an open order by its id.Set<OrderDTO>
getOpenOrders()
Get open orders.Set<TradeDTO>
getTrades()
Get last week trades.
-
-
-
Method Detail
-
createBuyMarketOrder
OrderCreationResultDTO createBuyMarketOrder(CurrencyPairDTO currencyPair, BigDecimal amount)
Creates a buy market order.- Parameters:
currencyPair
- currency pairamount
- amount- Returns:
- order result (order id or error)
-
createSellMarketOrder
OrderCreationResultDTO createSellMarketOrder(CurrencyPairDTO currencyPair, BigDecimal amount)
Creates a sell market order.- Parameters:
currencyPair
- currency pairamount
- amount- Returns:
- order result (order id or error)
-
createBuyLimitOrder
OrderCreationResultDTO createBuyLimitOrder(CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice)
Creates a buy limit order.- Parameters:
currencyPair
- currency pairamount
- amountlimitPrice
- the highest acceptable price- Returns:
- order result (order id or error)
-
createSellLimitOrder
OrderCreationResultDTO createSellLimitOrder(CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice)
Creates a sell limit order.- Parameters:
currencyPair
- currency pairamount
- amountlimitPrice
- the lowest acceptable price- Returns:
- order result (order id or error)
-
getOpenOrderByOrderId
Optional<OrderDTO> getOpenOrderByOrderId(String orderId)
Get an open order by its id.- Parameters:
orderId
- order id- Returns:
- order
-
cancelOrder
boolean cancelOrder(String orderId)
Cancel order.- Parameters:
orderId
- order id- Returns:
- true if cancelled
-
-