From 78852a0c52a1c18b263adaf53ca3e418669534b9 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Wed, 24 Jul 2019 22:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=A4=E6=98=93=E6=97=A5?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index 9e0fc781..9b7a83b0 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -1158,6 +1158,8 @@ class CtpTdApi(TdApi): account.closeProfit = data['CloseProfit'] account.positionProfit = data['PositionProfit'] account.tradingDay = str(data['TradingDay']) + if '-' not in account.tradingDay and len(account.tradingDay)== 8: + account.tradingDay = account.tradingDay[0:4] + '-' + account.tradingDay[4:6] + '-' + account.tradingDay[6:8] # 这里的balance和快期中的账户不确定是否一样,需要测试 account.balance = (data['PreBalance'] - data['PreCredit'] - data['PreMortgage'] + data['Mortgage'] - data['Withdraw'] + data['Deposit'] +