Esempio n. 1
0
    def OnRspUserLogin(self, rsp: ctp.CThostFtdcRspUserLoginField, info: ctp.CThostFtdcRspInfoField, req: int, last: bool):
        print(info.getErrorMsg())

        if info.getErrorID() == 0:
            self.Session = rsp.getSessionID()
            self.t.ReqSettlementInfoConfirm(BrokerID=self.broker, InvestorID=self.investor)
        else:
            self.RelogEnable = False
Esempio n. 2
0
 def _OnRspUserLogin(self, pRspUserLogin: CThostFtdcRspUserLoginField(), pRspInfo: CThostFtdcRspInfoField, nRequestID: int, bIsLast: bool):
     """"""
     if pRspInfo.getErrorID() == 0:
         self.session = pRspUserLogin.getSessionID()
         self.tradingday = pRspUserLogin.getTradingDay()
         self.t.ReqSettlementInfoConfirm(self.broker, self.investor)
     elif self.logined:
         _thread.start_new_thread(self._relogin, ())
     else:
         info = InfoField()
         info.ErrorID = pRspInfo.getErrorID()
         info.ErrorMsg = pRspInfo.getErrorMsg()
         _thread.start_new_thread(self.OnUserLogin, (self, info))