This commit is contained in:
msincenselee 2017-06-03 20:13:19 +08:00
parent 5143e952db
commit 80acffd28d

View File

@ -324,12 +324,10 @@ class CtpMdApi(MdApi):
if error['ErrorID'] == 0:
self.loginStatus = True
self.gateway.mdConnected = True
self.writeLog(text.DATA_SERVER_LOGIN)
# 重新订阅之前订阅的合约
if len(self.subscribedSymbols) > 0:
print u'Resubscribe'
print u'ctpMdApi.onRspUserLoginResubscribe Symbols:{0}'.format(self.subscribedSymbols)
for subscribeReq in self.subscribedSymbols:
self.subscribe(subscribeReq)
@ -571,10 +569,9 @@ class CtpTdApi(TdApi):
self.sessionID = str(data['SessionID'])
self.loginStatus = True
self.gateway.tdConnected = True
self.gateway.mdConnected = True
self.writeLog(text.TRADING_SERVER_LOGIN)
# 确认结算信息
req = {}
req['BrokerID'] = self.brokerID