Interface TradeService
- All Known Implementing Classes:
TradeServiceXChangeImplementation
public interface TradeService
Service getting information about orders and their management.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancelOrder
(long orderUid) Cancel order.createBuyLimitOrder
(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice) Creates a buy limit order.createBuyMarketOrder
(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount) Creates a buy market order.createSellLimitOrder
(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice) Creates a sell limit order.createSellMarketOrder
(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount) Creates a sell market order.Get orders from exchange.Get trades from exchange.
-
Method Details
-
createBuyMarketOrder
OrderCreationResultDTO createBuyMarketOrder(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount) Creates a buy market order.- Parameters:
strategy
- strategycurrencyPair
- currency pairamount
- amount- Returns:
- order result (order id or error)
-
createSellMarketOrder
OrderCreationResultDTO createSellMarketOrder(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount) Creates a sell market order.- Parameters:
strategy
- strategycurrencyPair
- currency pairamount
- amount- Returns:
- order result (order id or error)
-
createBuyLimitOrder
OrderCreationResultDTO createBuyLimitOrder(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice) Creates a buy limit order.- Parameters:
strategy
- strategycurrencyPair
- currency pairamount
- amountlimitPrice
- the highest acceptable price- Returns:
- order result (order id or error)
-
createSellLimitOrder
OrderCreationResultDTO createSellLimitOrder(CassandreStrategyInterface strategy, CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice) Creates a sell limit order.- Parameters:
strategy
- strategycurrencyPair
- currency pairamount
- amountlimitPrice
- the lowest acceptable price- Returns:
- order result (order id or error)
-
cancelOrder
boolean cancelOrder(long orderUid) Cancel order.- Parameters:
orderUid
- order uid- Returns:
- true if cancelled
-
getOrders
Get orders from exchange.- Returns:
- list of orders
-
getTrades
Get trades from exchange.- Returns:
- list of trades
-