Class BybitTradeService
- All Implemented Interfaces:
BaseService,TradeService
-
Field Summary
Fields inherited from class org.knowm.xchange.bybit.service.BybitBaseService
apiKey, bybit, bybitAuthenticated, signatureCreatorFields inherited from class org.knowm.xchange.service.BaseResilientExchangeService
resilienceRegistriesFields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange -
Constructor Summary
ConstructorsConstructorDescriptionBybitTradeService(BybitExchange exchange, ResilienceRegistries resilienceRegistries) -
Method Summary
Modifier and TypeMethodDescriptioncancelAllOrders(CancelAllOrders params) booleancancelOrder(CancelOrderParams params) cancels order with matching orderParamschangeOrder(LimitOrder order) Modify or cancel/replace an existing limit ordergetOpenOrders(OpenOrdersParams params) Gets the open ordersget's the latest order form the order book that with matching orderIdClass[]Returns required cancel order parameter as classesplaceLimitOrder(LimitOrder limitOrder) Place a limit orderplaceMarketOrder(MarketOrder marketOrder) Place a market orderMethods inherited from class org.knowm.xchange.bybit.service.BybitBaseService
getAmendOrderRateLimiter, getBatchAmendOrderRateLimiter, getBatchCancelOrderRateLimiter, getCancelOrderRateLimiter, getCreateOrderRateLimiterMethods inherited from class org.knowm.xchange.service.BaseResilientExchangeService
decorateApiCall, rateLimiter, rateLimiter, retry, retryMethods inherited from class org.knowm.xchange.service.BaseExchangeService
verifyOrder, verifyOrder, verifyOrderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.knowm.xchange.service.trade.TradeService
cancelOrder, createOpenOrdersParams, createTradeHistoryParams, getOpenOrders, getOpenPositions, getOrder, getRequiredOrderQueryParamClass, getTradeHistory, placeStopOrder, verifyOrder, verifyOrder
-
Constructor Details
-
BybitTradeService
-
-
Method Details
-
placeMarketOrder
Description copied from interface:TradeServicePlace a market orderIf your orders amount does to meet the restrictions dictated by
InstrumentMetaDatathen the exchange will reject your order. UseOrderValuesHelperto validate and / or adjust it while you'r building an order.- Specified by:
placeMarketOrderin interfaceTradeService- Parameters:
marketOrder-- Returns:
- the order ID
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data- See Also:
-
placeLimitOrder
Description copied from interface:TradeServicePlace a limit orderIf your orders amount or limit price does to meet the restrictions dictated by
InstrumentMetaDatathen the exchange will reject your order. UseOrderValuesHelperto validate and / or adjust those values while you'r building an order.- Specified by:
placeLimitOrderin interfaceTradeService- Parameters:
limitOrder-- Returns:
- the order ID
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data- See Also:
-
getOrder
Description copied from interface:TradeServiceget's the latest order form the order book that with matching orderId- Specified by:
getOrderin interfaceTradeService- Returns:
- the order as it is on the exchange.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
getOpenOrders
Description copied from interface:TradeServiceGets the open orders- Specified by:
getOpenOrdersin interfaceTradeService- Parameters:
params- The parameters describing the filter. Note thatOpenOrdersParamsis an empty interface. Exchanges should implement its own params object. Params should be create withTradeService.createOpenOrdersParams().- Returns:
- the open orders, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
changeOrder
Description copied from interface:TradeServiceModify or cancel/replace an existing limit order- Specified by:
changeOrderin interfaceTradeService- Parameters:
order- Order's data to change- Returns:
- Order ID
- Throws:
IOException- Indication that a networking error occurred while fetching JSON data
-
getRequiredCancelOrderParamClasses
Description copied from interface:TradeServiceReturns required cancel order parameter as classesDifferent trading services requires different parameters for order cancellation. To provide generic operation of the trade service interface. This method returns
Classof the parameter objects as an array. This class information can be utilized by the caller ofTradeService.cancelOrder(CancelOrderParams)to create instances of the required parameters such asCancelOrderByIdParams,CancelOrderByInstrumentetc...- Specified by:
getRequiredCancelOrderParamClassesin interfaceTradeService- Returns:
- Class types for the required parameter classes. Default implementation returns an array
with a single
CancelOrderByIdParamselement
-
cancelOrder
Description copied from interface:TradeServicecancels order with matching orderParams- Specified by:
cancelOrderin interfaceTradeService- Parameters:
params-- Returns:
- true if order was successfully cancelled, false otherwise.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
cancelAllOrders
- Specified by:
cancelAllOrdersin interfaceTradeService- Throws:
IOException
-