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
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionbatchTrade
(String symbol, String type, String ordersData) 批量下单cancelOrder
(long orderId, String symbol) 单笔订单取消cancelUpToThreeOrders
(Set<Long> orderIds, String symbol) 多笔订单取消 一次最多取消三个订单futureBatchTrade
(String symbol, String contractType, String ordersData, String leverRate) futureExplosive
(CurrencyPair pair, FuturesContract type, String status, Integer currentPage, Integer pageNumber, Integer pageLength) 获取合约爆仓单futuresCancelOrder
(long orderId, String symbol, FuturesContract contract) 取消合约订单(单个取消,多个取消没有实现处理)futuresTrade
(String symbol, String type, String price, String amount, FuturesContract contract, int matchPrice, int leverRate) 合约下单getFuturesFilledOrder
(long orderId, String symbol, String currentPage, String pageLength, FuturesContract contract) getFuturesOrder
(long orderId, String symbol, String currentPage, String pageLength, FuturesContract contract) 获取合约订单信息getFuturesOrders
(String orderIds, String symbol, FuturesContract contract) 批量获取合约订单信息getFuturesPosition
(String symbol, String contract) getFuturesPosition
(String symbol, FuturesContract contract) 获取用户持仓获取OKEX合约账户信息 (全仓)getFuturesPositionsFixed
(CurrencyPair currencyPair, FuturesContract contract) 逐仓用户持仓查询getFuturesPriceLimits
(CurrencyPair currencyPair, FuturesContract prompt) getFuturesTradesHistory
(String symbol, long since, String date) 获取OKEX合约交易历史(非个人)获取用户的订单信息获取用户的未完成的订单信息批量获取用户订单getOrderHistory
(String symbol, String status, String currentPage, String pageLength) 获取历史订单信息,只返回最近两天的信息placeMarketOrderBuy
(String symbol, String type, String price) placeMarketOrderSell
(String symbol, String type, String amount) 下单交易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:
-
-
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:
-