Beispiel #1
0
 def OnRspAuthenticate(self, pRspAuthenticateField, pRspInfo, nRequestID,
                       bIsLast):
     logger.info('OnRspAuthenticate')
     req = ApiStructure.ReqUserLoginField(BrokerID=self.broker_id,
                                          UserID=self.investor_id,
                                          Password=self.passwd)
     self.ReqUserLogin(req, self.inc_request_id())
Beispiel #2
0
    def OnFrontConnected(self):

        req = ApiStructure.ReqUserLoginField(BrokerID=self.broker_id,
                                             UserID=self.investor_id,
                                             Password=self.password)
        self.ReqUserLogin(req, self.request_id)
        print("trader on front connection")
Beispiel #3
0
 def OnFrontConnected(self):
     """
     :return:
     """
     user_login = ApiStructure.ReqUserLoginField(BrokerID=self.broker_id,
                                                 UserID=self.investor_id,
                                                 Password=self.password)
     self.ReqUserLogin(user_login, self.request_id)
Beispiel #4
0
 def OnFrontConnected(self):
     """
     当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。
     :return:
     """
     logger.info('OnFrontConnected')
     req = ApiStructure.ReqUserLoginField(BrokerID=self.broker_id, UserID=self.investor_id, Password=self.passwd)
     self.requestid += 1
     r = self.ReqUserLogin(req, self.requestid)
Beispiel #5
0
    def OnRspAuthenticate(self, pRspAuthenticateField, pRspInfo, nRequestID,
                          bIsLast):

        print("OnRspAuthenticate")
        print("pRspInfo:", pRspInfo)
        print("nRequestID:", nRequestID)
        print("bIsLast:", bIsLast)

        if pRspInfo.ErrorID == 0:
            req = ApiStructure.ReqUserLoginField(BrokerID=self.broker_id,
                                                 UserID=self.investor_id,
                                                 Password=self.password)
            self.ReqUserLogin(req, self.request_id)
        else:
            print("auth failed")
Beispiel #6
0
 def OnFrontConnected(self):
     print('Td 前置机已连接')
     req = ApiStructure.ReqUserLoginField(BrokerID=self.broker_id,
                                          UserID=self.investor_id,
                                          Password=self.password)
     self.ReqUserLogin(req, self.request_id)