From cc5c85f1ba1600373dd4e0c7ffae4b9c64801cec Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 2 Dec 2017 21:56:10 +0800 Subject: [PATCH] [Add]Close #561 --- examples/VnTrader/CTP_connect.json | 4 ++-- .../{CTP_connect.json.test => CTP_connect_带客户端认证.json} | 4 +++- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) rename examples/VnTrader/{CTP_connect.json.test => CTP_connect_带客户端认证.json} (58%) diff --git a/examples/VnTrader/CTP_connect.json b/examples/VnTrader/CTP_connect.json index 1b4d5a42..e4bfa6b8 100644 --- a/examples/VnTrader/CTP_connect.json +++ b/examples/VnTrader/CTP_connect.json @@ -2,6 +2,6 @@ "brokerID": "9999", "mdAddress": "tcp://180.168.146.187:10011", "tdAddress": "tcp://180.168.146.187:10001", - "userID": "000300", - "password": "19890624" + "userID": "simnow申请", + "password": "simnow申请" } \ No newline at end of file diff --git a/examples/VnTrader/CTP_connect.json.test b/examples/VnTrader/CTP_connect_带客户端认证.json similarity index 58% rename from examples/VnTrader/CTP_connect.json.test rename to examples/VnTrader/CTP_connect_带客户端认证.json index e4bfa6b8..7e20c312 100644 --- a/examples/VnTrader/CTP_connect.json.test +++ b/examples/VnTrader/CTP_connect_带客户端认证.json @@ -3,5 +3,7 @@ "mdAddress": "tcp://180.168.146.187:10011", "tdAddress": "tcp://180.168.146.187:10001", "userID": "simnow申请", - "password": "simnow申请" + "password": "simnow申请", + "userProductInfo": "客户端名称", + "authCode": "客户端认证码" } \ No newline at end of file diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index dfe34f78..edea15e8 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -142,7 +142,7 @@ class CtpGateway(VtGateway): # 创建行情和交易接口对象 self.mdApi.connect(userID, password, brokerID, mdAddress) - self.tdApi.connect(userID, password, brokerID, tdAddress,authCode, userProductInfo) + self.tdApi.connect(userID, password, brokerID, tdAddress, authCode, userProductInfo) # 初始化并启动查询 self.initQuery()