| | |
| | | codes_sz = [] |
| | | for code in codes: |
| | | if code.find("60") == 0: |
| | | codes_sh.append(code.encode()) |
| | | codes_sh.append(code.encode("utf-8")) |
| | | elif code.find("00") == 0: |
| | | codes_sz.append(code.encode()) |
| | | codes_sz.append(code.encode("utf-8")) |
| | | return codes_sh, codes_sz |
| | | |
| | | # 订阅代码 |
| | |
| | | |
| | | def OnRspUserLogin(self, pRspUserLoginField, pRspInfoField, nRequestID): |
| | | if pRspInfoField.ErrorID == 0: |
| | | print('Login success! [%d]' % nRequestID) |
| | | logger_local_huaxin_l1.info('Login success! [%d]' % nRequestID) |
| | | |
| | | ''' |
| | | 订阅行情 |
| | |
| | | |
| | | |
| | | else: |
| | | print('Login fail!!! [%d] [%d] [%s]' |
| | | logger_local_huaxin_l1.info('Login fail!!! [%d] [%d] [%s]' |
| | | % (nRequestID, pRspInfoField.ErrorID, pRspInfoField.ErrorMsg)) |
| | | |
| | | def OnRspSubMarketData(self, pSpecificSecurityField, pRspInfoField): |
| | |
| | | logger_local_huaxin_l1.info(f"订阅:{pSpecificSecurityField['SecurityID']}") |
| | | self.__subscribed_codes.add(pSpecificSecurityField["SecurityID"]) |
| | | else: |
| | | print('OnRspSubMarketData: Error! [%d] [%s]' |
| | | % (pRspInfoField.ErrorID, pRspInfoField.ErrorMsg)) |
| | | logger_local_huaxin_l1.info('OnRspSubMarketData: Error! [%d] [%s]' |
| | | % (pRspInfoField.ErrorID, pRspInfoField.ErrorMsg)) |
| | | |
| | | def OnRspUnSubMarketData(self, pSpecificSecurityField, pRspInfoField): |
| | | if pRspInfoField.ErrorID == 0: |