更新交易日格式

This commit is contained in:
msincenselee 2019-07-24 22:20:15 +08:00
parent 7b1549a55e
commit 78852a0c52

View File

@ -1158,6 +1158,8 @@ class CtpTdApi(TdApi):
account.closeProfit = data['CloseProfit'] account.closeProfit = data['CloseProfit']
account.positionProfit = data['PositionProfit'] account.positionProfit = data['PositionProfit']
account.tradingDay = str(data['TradingDay']) 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和快期中的账户不确定是否一样需要测试 # 这里的balance和快期中的账户不确定是否一样需要测试
account.balance = (data['PreBalance'] - data['PreCredit'] - data['PreMortgage'] + account.balance = (data['PreBalance'] - data['PreCredit'] - data['PreMortgage'] +
data['Mortgage'] - data['Withdraw'] + data['Deposit'] + data['Mortgage'] - data['Withdraw'] + data['Deposit'] +