Package org.knowm.xchange.huobi.service
Class HuobiTradeService
java.lang.Object
org.knowm.xchange.service.BaseExchangeService
org.knowm.xchange.huobi.service.HuobiBaseService
org.knowm.xchange.huobi.service.HuobiTradeServiceRaw
org.knowm.xchange.huobi.service.HuobiTradeService
- All Implemented Interfaces:
BaseService,TradeService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Order.IOrderFlagsstatic Order.IOrderFlagsstatic Order.IOrderFlagsFields inherited from class org.knowm.xchange.huobi.service.HuobiBaseService
huobi, signatureCreatorFields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancancelOrder(String orderId) cancels order with matching orderId (conveniance method, typical just delegate to cancelOrder(CancelOrderByIdParams))booleancancelOrder(CancelOrderParams cancelOrderParams) cancels order with matching orderParamsCreateOpenOrdersParamsobject specific to this exchange.CreateTradeHistoryParamsobject specific to this exchange.Gets the open ordersgetOpenOrders(OpenOrdersParams openOrdersParams) Gets the open ordersgetOrder(OrderQueryParams... orderQueryParams) get's the latest order form the order book that with matching orderQueryParamsgetTradeHistory(TradeHistoryParams tradeHistoryParams) Huobi trade history only goes back 48h - a new API was promised in 2019-Q1placeLimitOrder(LimitOrder limitOrder) Place a limit orderplaceMarketOrder(MarketOrder marketOrder) Place a market orderplaceStopOrder(StopOrder stopOrder) Place a stop orderMethods inherited from class org.knowm.xchange.huobi.service.HuobiTradeServiceRaw
cancelHuobiOrder, getHuobiMatchResults, getHuobiOpenOrders, getHuobiOrder, getHuobiOrderHistory, getHuobiTradeHistory, placeHuobiLimitOrder, placeHuobiMarketOrderMethods inherited from class org.knowm.xchange.huobi.service.HuobiBaseService
checkResult, checkResult, getHuobiAssetsMethods 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
cancelAllOrders, changeOrder, getOpenPositions, getOrder, getRequiredCancelOrderParamClasses, getRequiredOrderQueryParamClass, verifyOrder, verifyOrder
-
Field Details
-
FOK
-
IOC
-
POST_ONLY
-
-
Constructor Details
-
HuobiTradeService
-
-
Method Details
-
getTradeHistory
Huobi trade history only goes back 48h - a new API was promised in 2019-Q1- Specified by:
getTradeHistoryin interfaceTradeService- Parameters:
tradeHistoryParams- The parameters describing the filter. Note thatTradeHistoryParamsis an empty interface. Exact set of interfaces that are required or supported by this method is described by the type of object returned fromTradeService.createTradeHistoryParams()and the javadoc of the method.- Returns:
- UserTrades as returned by the exchange API
- 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 orderQueryParams- 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
-
createOpenOrdersParams
Description copied from interface:TradeServiceCreateOpenOrdersParamsobject specific to this exchange. Object created by this method may be used to discover supported and requiredTradeService.getOpenOrders(OpenOrdersParams)parameters and should be passed only to the method in the same class as the createOpenOrdersParams that created the object.- Specified by:
createOpenOrdersParamsin interfaceTradeService
-
createTradeHistoryParams
Description copied from interface:TradeServiceCreateTradeHistoryParamsobject specific to this exchange. Object created by this method may be used to discover supported and requiredTradeService.getTradeHistory(TradeHistoryParams)parameters and should be passed only to the method in the same class as the createTradeHistoryParams that created the object.- Specified by:
createTradeHistoryParamsin interfaceTradeService
-
cancelOrder
Description copied from interface:TradeServicecancels order with matching orderId (conveniance method, typical just delegate to cancelOrder(CancelOrderByIdParams))- Specified by:
cancelOrderin interfaceTradeService- Returns:
- true if order was successfully cancelled, false otherwise.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
cancelOrder
Description copied from interface:TradeServicecancels order with matching orderParams- Specified by:
cancelOrderin interfaceTradeService- Returns:
- true if order was successfully cancelled, false otherwise.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
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- Returns:
- the order ID
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data- See Also:
-
getOpenOrders
Description copied from interface:TradeServiceGets the open orders- Specified by:
getOpenOrdersin interfaceTradeService- 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
-
getOpenOrders
Description copied from interface:TradeServiceGets the open orders- Specified by:
getOpenOrdersin interfaceTradeService- Parameters:
openOrdersParams- 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
-
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- Returns:
- the order ID
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data- See Also:
-
placeStopOrder
Description copied from interface:TradeServicePlace a stop orderIf your orders amount or spot 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:
placeStopOrderin interfaceTradeService- Returns:
- the order ID
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data- See Also:
-