From d6b3b0c7c13c8b59b8fca277de6dbb3d47fe6c91 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 8 Nov 2017 21:58:46 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E4=BF=AE=E6=94=B9=E5=AF=8C=E9=80=94?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E6=89=80=E6=9C=89=E5=A7=94=E6=89=98=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/futuGateway/futuGateway.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vnpy/trader/gateway/futuGateway/futuGateway.py b/vnpy/trader/gateway/futuGateway/futuGateway.py index c0921483..91ca527d 100644 --- a/vnpy/trader/gateway/futuGateway/futuGateway.py +++ b/vnpy/trader/gateway/futuGateway/futuGateway.py @@ -211,6 +211,11 @@ class FutuGateway(VtGateway): # 启动交易接口 self.tradeCtx.start() + # 订阅委托推送 + self.tradeCtx.subscribe_order_deal_push([], + order_deal_push=True, + envtype=self.env) + self.writeLog(u'交易接口连接成功') #---------------------------------------------------------------------- @@ -338,7 +343,7 @@ class FutuGateway(VtGateway): self.writeError(code, u'查询委托失败:%s' %data) return - self.processOrder(data, qry=True) + self.processOrder(data) self.writeLog(u'委托查询成功') #---------------------------------------------------------------------- @@ -456,7 +461,7 @@ class FutuGateway(VtGateway): self.onTick(tick) #---------------------------------------------------------------------- - def processOrder(self, data, qry=False): + def processOrder(self, data): """处理委托推送""" for ix, row in data.iterrows(): # 如果状态是已经删除,则直接忽略 @@ -482,11 +487,6 @@ class FutuGateway(VtGateway): order.status = statusMapReverse.get(str(row['status']), STATUS_UNKNOWN) order.direction = directionMapReverse[str(row['order_side'])] self.onOrder(order) - - if qry: - self.tradeCtx.subscribe_order_deal_push(row['orderid'], - order_deal_push=True, - envtype=self.env) #---------------------------------------------------------------------- def processDeal(self, data):