public class OkCoinFuturesTradeService extends OkCoinTradeServiceRaw implements PollingTradeService
Modifier and Type | Class and Description |
---|---|
static class |
OkCoinFuturesTradeService.OkCoinFuturesTradeHistoryParams |
static interface |
OkCoinFuturesTradeService.TradeHistoryParamFuturesContract |
apikey, okCoin, secretKey, signatureCreator
useIntl
exchange
Constructor and Description |
---|
OkCoinFuturesTradeService(Exchange exchange,
FuturesContract futuresContract,
int leverRate)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancelOrder(String orderId)
cancels order with matching orderId
|
OkCoinFuturesTradeService.OkCoinFuturesTradeHistoryParams |
createTradeHistoryParams()
Create
TradeHistoryParams object specific to this exchange. |
List<FuturesContract> |
getExchangeContracts() |
OpenOrders |
getOpenOrders()
Gets the open orders
|
UserTrades |
getTradeHistory(Object... arguments)
gets trade history for user's account
|
UserTrades |
getTradeHistory(TradeHistoryParams params)
Parameters: see
OkCoinFuturesTradeService.OkCoinFuturesTradeHistoryParams |
String |
liquidateLimitOrder(LimitOrder limitOrder)
Liquidate long or short contract using a limit order
|
String |
liquidateMarketOrder(MarketOrder marketOrder)
Liquidate long or short contract (depending on market order order type) using a market order
|
String |
placeLimitOrder(LimitOrder limitOrder)
Place a limit order
|
String |
placeMarketOrder(MarketOrder marketOrder)
Place a market order
|
cancelOrder, futuresCancelOrder, futuresTrade, getFuturesOrder, getFuturesPosition, getOrder, getOrderHistory, trade
returnOrThrow
getExchangeSymbols, verifyOrder, verifyOrder, verifyOrder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
verifyOrder, verifyOrder
getExchangeSymbols
public OkCoinFuturesTradeService(Exchange exchange, FuturesContract futuresContract, int leverRate)
exchange
- public OpenOrders getOpenOrders() throws IOException
PollingTradeService
getOpenOrders
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON datapublic String placeMarketOrder(MarketOrder marketOrder) throws IOException
PollingTradeService
placeMarketOrder
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON datapublic String liquidateMarketOrder(MarketOrder marketOrder) throws IOException
IOException
public String placeLimitOrder(LimitOrder limitOrder) throws IOException
PollingTradeService
placeLimitOrder
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON datapublic String liquidateLimitOrder(LimitOrder limitOrder) throws IOException
IOException
public boolean cancelOrder(String orderId) throws IOException
PollingTradeService
cancelOrder
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON datapublic UserTrades getTradeHistory(Object... arguments) throws IOException
PollingTradeService
getTradeHistory
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON datapublic UserTrades getTradeHistory(TradeHistoryParams params) throws IOException
OkCoinFuturesTradeService.OkCoinFuturesTradeHistoryParams
getTradeHistory
in interface PollingTradeService
params
- The parameters describing the filter. Note that TradeHistoryParams
is an empty interface. Exact set of interfaces that are
required or supported by this method is described by the type of object returned from PollingTradeService.createTradeHistoryParams()
and the javadoc
of the method.IOException
- - Indication that a networking error occurred while fetching JSON dataPollingTradeService.getTradeHistory(Object...)
,
PollingTradeService.createTradeHistoryParams()
,
TradeHistoryParamsAll
public List<FuturesContract> getExchangeContracts()
public OkCoinFuturesTradeService.OkCoinFuturesTradeHistoryParams createTradeHistoryParams()
PollingTradeService
TradeHistoryParams
object specific to this exchange. Object created by this method may be used to discover supported and required
PollingTradeService.getTradeHistory(TradeHistoryParams)
parameters and should be passed only to the method in the same class as the createTradeHistoryParams
that created the object.createTradeHistoryParams
in interface PollingTradeService
Copyright © 2012–2016 Xeiam, LLC. All rights reserved.