diff --git a/vnpy/api/okexfuture/OkexFutureApi.py b/vnpy/api/okexfuture/OkexFutureApi.py index a32b41e7..30bf7b03 100644 --- a/vnpy/api/okexfuture/OkexFutureApi.py +++ b/vnpy/api/okexfuture/OkexFutureApi.py @@ -519,6 +519,14 @@ class OkexFutureWebSocketClient(OkexFutureWebSocketBase): 'channel': 'ok_sub_futureusd_' + easySymbol + '_ticker_' + contractType }) + #---------------------------------------------------------------------- + def subscribeUserTrade(self): + # todo: 没有测试条件 + self.sendPacket({ + 'event': 'addChannel', + 'channel': 'ok_sub_futureusd_trades' + }) + #---------------------------------------------------------------------- def defaultOnPacket(self, packets): @@ -557,6 +565,8 @@ class OkexFutureWebSocketClient(OkexFutureWebSocketBase): # channel.symbol, channel.remoteContractType, *tradeInfo # )) # self.onTrades(trades) + + # todo: 没有测试条件 elif channel.type == ChannelType.UserTrade: self.onUserTrade(OkexFutureUserTradeInfo( symbol=packet['symbol'], # str # btc_usd ltc_usd eth_usd etc_usd bch_usd