| | |
| | | from log_module import log, async_log_util |
| | | from log_module.async_log_util import huaxin_l2_log |
| | | from log_module.log import logger_local_huaxin_l2_subscript, logger_system, logger_l2_codes_subscript, \ |
| | | logger_local_huaxin_l2_transaction, logger_local_huaxin_l2_upload |
| | | logger_local_huaxin_l2_transaction, logger_local_huaxin_l2_upload, logger_local_huaxin_l2_error |
| | | from utils import tool |
| | | |
| | | ###B类### |
| | |
| | | self.set_codes_data(self.codes) |
| | | |
| | | def OnRspSubTransaction(self, pSpecificSecurity, pRspInfo, nRequestID, bIsLast): |
| | | logger_local_huaxin_l2_subscript.info(f"订阅:{pSpecificSecurity['SecurityID']}") |
| | | |
| | | if pRspInfo["ErrorID"] == 0: |
| | | self.subscripted_codes.add(pSpecificSecurity['SecurityID']) |
| | | if bIsLast == 1: |
| | | l2_data_manager.add_subscript_codes(self.subscripted_codes) |
| | | logger_local_huaxin_l2_subscript.info(f"订阅成功:{len(self.subscripted_codes)}") |
| | | |
| | | def OnRspUnSubTransaction(self, pSpecificSecurity, pRspInfo, nRequestID, bIsLast): |
| | | try: |
| | |
| | | logging.exception(e) |
| | | |
| | | def OnRtnTransaction(self, pTransaction): |
| | | try: |
| | | # 输出逐笔成交数据 |
| | | if pTransaction['ExecType'] == b"2": |
| | | # 撤单 |
| | |
| | | self.__is_limit_up_dict[pTransaction['SecurityID']] = True |
| | | else: |
| | | self.__is_limit_up_dict[pTransaction['SecurityID']] = False |
| | | except Exception as e: |
| | | logger_local_huaxin_l2_error.exception(e) |
| | | |
| | | |
| | | class MyL2ActionCallback(L2ActionCallback): |