| | |
| | | from huaxin_client.client_network import SendResponseSkManager |
| | | |
| | | # 活动时间 |
| | | from log_module.log import logger_local_huaxin_l2_error, logger_local_huaxin_l2_upload |
| | | from log_module import log_export |
| | | from log_module.log import logger_local_huaxin_l2_error, logger_local_huaxin_l2_upload, logger_local_huaxin_l2_buy_no |
| | | |
| | | order_detail_upload_active_time_dict = {} |
| | | transaction_upload_active_time_dict = {} |
| | |
| | | target_codes = set() |
| | | common_queue = queue.Queue() |
| | | trading_canceled_queue = queue.Queue() |
| | | log_buy_no_queue = queue.Queue() |
| | | # 买入订单号的字典 |
| | | buy_order_nos_dict = {} |
| | | # 最近的大单成交单号 |
| | |
| | | if data['SecurityID'] not in buy_order_nos_dict: |
| | | buy_order_nos_dict[data['SecurityID']] = set() |
| | | buy_order_nos_dict[data['SecurityID']].add(data['OrderNO']) |
| | | # 买入订单号需要记录日志 |
| | | log_buy_no_queue.put_nowait((data['SecurityID'], data['OrderNO'])) |
| | | |
| | | tmep_order_detail_queue_dict[code].put( |
| | | (data['SecurityID'], data['Price'], data['Volume'], data['Side'], data['OrderType'], data['OrderTime'], |
| | |
| | | logger_local_huaxin_l2_error.error(f"上传普通数据出错:{str(e)}") |
| | | |
| | | |
| | | def __run_log(): |
| | | print("__run_log") |
| | | while True: |
| | | try: |
| | | temp = log_buy_no_queue.get() |
| | | if temp: |
| | | logger_local_huaxin_l2_buy_no.info(f"{temp[0]}#{temp[1]}") |
| | | except: |
| | | pass |
| | | |
| | | |
| | | # 运行上传任务 |
| | | def run_upload_task(code): |
| | | # 如果代码没有在目标代码中就不需要运行 |
| | |
| | | t.start() |
| | | |
| | | |
| | | def run_log(): |
| | | fdatas = log_export.load_huaxin_local_buy_no() |
| | | global buy_order_nos_dict |
| | | buy_order_nos_dict = fdatas |
| | | t = threading.Thread(target=lambda: __run_log(), daemon=True) |
| | | t.start() |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | code = "603809" |
| | | target_codes.add(code) |