Interface TradeService
-
- All Known Implementing Classes:
TradeServiceXChangeImplementation
public interface TradeService
Service getting information about orders and allowing you to create new ones.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cancelOrder(String orderId)
Cancel order.OrderCreationResultDTO
createBuyLimitOrder(GenericCassandreStrategy strategy, CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice)
Creates a buy limit order.OrderCreationResultDTO
createBuyMarketOrder(GenericCassandreStrategy strategy, CurrencyPairDTO currencyPair, BigDecimal amount)
Creates a buy market order.OrderCreationResultDTO
createSellLimitOrder(GenericCassandreStrategy strategy, CurrencyPairDTO currencyPair, BigDecimal amount, BigDecimal limitPrice)
Creates a sell limit order.OrderCreationResultDTO
createSellMarketOrder(GenericCassandreStrategy strategy, CurrencyPairDTO currencyPair, BigDecimal amount)
Creates a sell market order.Set<OrderDTO>
getOrders()
Get orders from exchange.Set<TradeDTO>
getTrades()
Get trades from exchange.
-
-
-
Method Detail
-
createBuyMarketOrder
OrderCreationResultDTO createBuyMarketOrder(GenericCassandreStrategy 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(GenericCassandreStrategy 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(GenericCassandreStrategy 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(GenericCassandreStrategy 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(String orderId)
Cancel order.- Parameters:
orderId
- order id- Returns:
- true if cancelled
-
-