Package org.knowm.xchange.okcoin.service
Class OkCoinTradeServiceRaw
java.lang.Object
org.knowm.xchange.service.BaseExchangeService
org.knowm.xchange.okcoin.service.OkCoinBaseService
org.knowm.xchange.okcoin.service.OKCoinBaseTradeService
org.knowm.xchange.okcoin.service.OkCoinTradeServiceRaw
- All Implemented Interfaces:
BaseService
- Direct Known Subclasses:
OkCoinFuturesTradeService
,OkCoinTradeService
public class OkCoinTradeServiceRaw extends OKCoinBaseTradeService
-
Field Summary
Fields Modifier and Type Field Description protected static String
BATCH_DELIMITER
Fields inherited from class org.knowm.xchange.okcoin.service.OKCoinBaseTradeService
apikey, okCoin, secretKey
Fields inherited from class org.knowm.xchange.okcoin.service.OkCoinBaseService
useIntl
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
Constructor Summary
Constructors Modifier Constructor Description protected
OkCoinTradeServiceRaw(Exchange exchange)
Constructor -
Method Summary
Methods inherited from class org.knowm.xchange.okcoin.service.OKCoinBaseTradeService
returnOrThrow, signatureCreator
Methods inherited from class org.knowm.xchange.okcoin.service.OkCoinBaseService
createDelimitedString
Methods inherited from class org.knowm.xchange.service.BaseExchangeService
verifyOrder, verifyOrder, verifyOrder
-
Field Details
-
BATCH_DELIMITER
- See Also:
- Constant Field Values
-
-
Constructor Details
-
OkCoinTradeServiceRaw
Constructor- Parameters:
exchange
-
-
-
Method Details
-
trade
public OkCoinTradeResult trade(String symbol, String type, String price, String amount) throws IOException下单交易- Parameters:
symbol
-type
-price
-amount
- (只能是整数)- Returns:
- Throws:
IOException
-
placeMarketOrderBuy
public OkCoinTradeResult placeMarketOrderBuy(String symbol, String type, String price) throws IOException- Throws:
IOException
-
placeMarketOrderSell
public OkCoinTradeResult placeMarketOrderSell(String symbol, String type, String amount) throws IOException- Throws:
IOException
-
batchTrade
public OkCoinMoreTradeResult batchTrade(String symbol, String type, String ordersData) throws IOException批量下单- Parameters:
symbol
-type
- 限价单(buy/sell)ordersData
- "[{price:3,amount:5,type:'sell'},{price:3,amount:3,type:'buy'}]" 最终买卖类型由orders_data 中type 为准,如orders_data不设定type 则由上面type设置为准。 若,上面type没有设置,orderData 必须设置type- Returns:
- Throws:
IOException
-
cancelOrder
单笔订单取消- Parameters:
orderId
-symbol
-- Returns:
- Throws:
IOException
-
cancelUpToThreeOrders
public OkCoinBatchTradeResult cancelUpToThreeOrders(Set<Long> orderIds, String symbol) throws IOException多笔订单取消 一次最多取消三个订单- Parameters:
orderIds
-symbol
-- Returns:
- Throws:
IOException
-
getOrder
获取用户的未完成的订单信息- Parameters:
symbol
-- Returns:
- Throws:
IOException
-
getOrder
获取用户的订单信息- Parameters:
orderId
-symbol
-- Returns:
- Throws:
IOException
-
getOrder
批量获取用户订单- Parameters:
symbol
-type
- 查询类型 0:未完成的订单 1:已经完成的订单orderIds
-- Returns:
- Throws:
IOException
-
getOrderHistory
public OkCoinOrderResult getOrderHistory(String symbol, String status, String currentPage, String pageLength) throws IOException获取历史订单信息,只返回最近两天的信息- Parameters:
symbol
-status
-currentPage
-pageLength
-- Returns:
- Throws:
IOException
-
futuresTrade
public OkCoinTradeResult futuresTrade(String symbol, String type, String price, String amount, FuturesContract contract, int matchPrice, int leverRate) throws IOException合约下单- Parameters:
symbol
-type
-price
-amount
-contract
-matchPrice
-leverRate
-- Returns:
- Throws:
IOException
-
futuresCancelOrder
public OkCoinTradeResult futuresCancelOrder(long orderId, String symbol, FuturesContract contract) throws IOException取消合约订单(单个取消,多个取消没有实现处理)- Parameters:
orderId
-symbol
-contract
-- Returns:
- Throws:
IOException
-
getFuturesOrder
public OkCoinFuturesOrderResult getFuturesOrder(long orderId, String symbol, String currentPage, String pageLength, FuturesContract contract) throws IOException获取合约订单信息- Parameters:
orderId
-symbol
-currentPage
-pageLength
-contract
-- Returns:
- Throws:
IOException
-
getFuturesPriceLimits
public OkCoinPriceLimit getFuturesPriceLimits(CurrencyPair currencyPair, FuturesContract prompt) throws IOException- Throws:
IOException
-
getFuturesFilledOrder
public OkCoinFuturesOrderResult getFuturesFilledOrder(long orderId, String symbol, String currentPage, String pageLength, FuturesContract contract) throws IOException- Throws:
IOException
-
getFuturesOrders
public OkCoinFuturesOrderResult getFuturesOrders(String orderIds, String symbol, FuturesContract contract) throws IOException批量获取合约订单信息- Parameters:
orderIds
-symbol
-contract
-- Returns:
- Throws:
IOException
-
getFuturesTradesHistory
public OkCoinFuturesTradeHistoryResult[] getFuturesTradesHistory(String symbol, long since, String date) throws IOException获取OKEX合约交易历史(非个人)- Parameters:
symbol
-since
-date
-- Returns:
- Throws:
IOException
-
getFuturesPosition
public OkCoinPositionResult getFuturesPosition(String symbol, FuturesContract contract) throws IOException获取用户持仓获取OKEX合约账户信息 (全仓)- Parameters:
symbol
-contract
-- Returns:
- Throws:
IOException
-
getFuturesPosition
- Throws:
IOException
-
futureBatchTrade
public OkCoinMoreTradeResult futureBatchTrade(String symbol, String contractType, String ordersData, String leverRate) throws IOException- Parameters:
symbol
-contractType
-ordersData
-leverRate
-- Throws:
IOException
-
getFuturesPositionsFixed
public OkCoinPositionResult getFuturesPositionsFixed(CurrencyPair currencyPair, FuturesContract contract) throws IOException逐仓用户持仓查询- Parameters:
currencyPair
-contract
-- Returns:
- Throws:
IOException
-
futureExplosive
public OkCoinFutureExplosiveResult futureExplosive(CurrencyPair pair, FuturesContract type, String status, Integer currentPage, Integer pageNumber, Integer pageLength)获取合约爆仓单- Parameters:
pair
-type
-status
- //状态 0:最近7天未成交 1:最近7天已成交currentPage
-pageNumber
-pageLength
- //每页获取条数,最多不超过50- Returns:
-