From e8981a97c8fbb44a55170d03ff5fc1d141c349e2 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 5 Dec 2017 10:13:58 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E5=A2=9E=E5=8A=A0ctpGateway=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8A=A5=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat | 2 +- examples/ServerClient/VT_setting.json | 6 ++++-- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat b/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat index 8d62ccfc..dff3957f 100644 --- a/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat +++ b/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat @@ -1 +1 @@ -rGu69UiZhQTMFXCkVHH1kg== \ No newline at end of file +tBr8RMewRABqiW7HBOkrkg== \ No newline at end of file diff --git a/examples/ServerClient/VT_setting.json b/examples/ServerClient/VT_setting.json index ef3bb771..a00ff35e 100644 --- a/examples/ServerClient/VT_setting.json +++ b/examples/ServerClient/VT_setting.json @@ -9,8 +9,10 @@ "darkStyle": true, "language": "chinese", - "logActive": false, + "logActive": true, "logLevel": "debug", "logConsole": true, - "logFile": true + "logFile": true, + + "tdPenalty": ["IF", "IH", "IC"] } \ No newline at end of file diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index edea15e8..20f98c79 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -542,6 +542,12 @@ class CtpTdApi(TdApi): self.writeLog(text.TRADING_SERVER_AUTHENTICATED) self.login() + else: + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) #---------------------------------------------------------------------- def onRspUserLogin(self, data, error, n, last):