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