Class LgoStreamingTradeService
- All Implemented Interfaces:
StreamingTradeService
-
Method Summary
Modifier and TypeMethodDescriptionbooleancancelOrder(String orderId) Place a cancel orderio.reactivex.rxjava3.core.Observable<OpenOrders>getOpenOrders(CurrencyPair currencyPair) Get an up-to-date view of all your open orders after each LGO batch execution.io.reactivex.rxjava3.core.Observable<Collection<Order>>getOrderBatchChanges(CurrencyPair currencyPair) Receive all updated orders, for each LGO batches.io.reactivex.rxjava3.core.Observable<Order>getOrderChanges(CurrencyPair currencyPair, Object... args) Get the changes of order state for the logged-in user.io.reactivex.rxjava3.core.Observable<LgoOrderEvent>getRawAllOrderEvents(Collection<CurrencyPair> currencyPairs) Receive all events for the selected currency pairs.io.reactivex.rxjava3.core.Observable<LgoOrderEvent>getRawBatchOrderEvents(CurrencyPair currencyPair) Get all events of your orders happened during batch execution, for a currency pair.io.reactivex.rxjava3.core.Observable<LgoOrderEvent>Get ack for your placed orders.io.reactivex.rxjava3.core.Observable<UserTrade>getUserTrades(CurrencyPair currencyPair, Object... args) Gets authenticated trades for the logged-in user.placeLimitOrder(LimitOrder limitOrder) Place a limit orderplaceMarketOrder(MarketOrder marketOrder) Place a market orderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface info.bitrich.xchangestream.core.StreamingTradeService
getOrderChanges, getUserTrades, getUserTrades
-
Method Details
-
getOrderChanges
public io.reactivex.rxjava3.core.Observable<Order> getOrderChanges(CurrencyPair currencyPair, Object... args) Get the changes of order state for the logged-in user.Warning: there are currently no guarantees that messages will arrive in order, that messages will not be skipped, or that any initial state message will be sent on connection. Most exchanges have a recommended approach for managing this, involving timestamps, sequence numbers and a separate REST API for re-sync when inconsistencies appear. You should implement these approaches, if required, by combining calls to this method with
TradeService.getOpenOrders().Emits
NotConnectedExceptionWhen not connected to the WebSocket API.Immediately throws
ExchangeSecurityExceptionif called without authentication details First sent orders will be current open orders.- Specified by:
getOrderChangesin interfaceStreamingTradeService- Parameters:
currencyPair- Currency pair of the order changes.- Returns:
Observablethat emitsOrderwhen exchange sends the update.
-
getOpenOrders
Get an up-to-date view of all your open orders after each LGO batch execution. First sending will be the actual open orders list. -
getOrderBatchChanges
public io.reactivex.rxjava3.core.Observable<Collection<Order>> getOrderBatchChanges(CurrencyPair currencyPair) Receive all updated orders, for each LGO batches. First sending will be the actual open orders list. -
getUserTrades
public io.reactivex.rxjava3.core.Observable<UserTrade> getUserTrades(CurrencyPair currencyPair, Object... args) Description copied from interface:StreamingTradeServiceGets authenticated trades for the logged-in user.Warning: there are currently no guarantees that messages will arrive in order, that messages will not be skipped, or that any initial state message will be sent on connection. Most exchanges have a recommended approach for managing this, involving timestamps, sequence numbers and a separate REST API for re-sync when inconsistencies appear. You should implement these approaches, if required, by combining calls to this method with
TradeService.getTradeHistory(org.knowm.xchange.service.trade.params.TradeHistoryParams)Emits
NotConnectedExceptionWhen not connected to the WebSocket API.Immediately throws
ExchangeSecurityExceptionif called without authentication details- Specified by:
getUserTradesin interfaceStreamingTradeService- Parameters:
currencyPair- Currency pair for which to get trades.- Returns:
Observablethat emitsUserTradewhen exchange sends the update.
-
getRawAllOrderEvents
public io.reactivex.rxjava3.core.Observable<LgoOrderEvent> getRawAllOrderEvents(Collection<CurrencyPair> currencyPairs) Receive all events for the selected currency pairs. Merges batch order events and ack (AFR) events. -
getRawReceivedOrderEvents
Get ack for your placed orders. "received" events indicate the orderId associated to your order, if you set a reference on order placement you will have it in the event. "failed" events indicate that the order could not be read or was invalid and not added to a batch. -
getRawBatchOrderEvents
public io.reactivex.rxjava3.core.Observable<LgoOrderEvent> getRawBatchOrderEvents(CurrencyPair currencyPair) Get all events of your orders happened during batch execution, for a currency pair. "pending" events indicate that the order was added to a batch and received by the execution engine. "invalid" events indicate that the order was not suitable for execution. "match" events indicate that the order did match against another order. "open" events indicate that the order entered the order book. "done" events indicate that the order was filled, canceled or rejected. -
placeMarketOrder
Place a market order- Returns:
- the order reference
- Throws:
IOException
-
placeLimitOrder
Place a limit order- Returns:
- the order reference
- Throws:
IOException
-
cancelOrder
Place a cancel order- Returns:
- true
- Throws:
IOException
-