| | |
| | | data = json.loads(value) |
| | | _type = data["type"] |
| | | if _type == "l2_cmd": |
| | | huaxin_l2_log.info(logger_local_huaxin_l2_subscript, f"订阅代码:{data}") |
| | | __start_time = time.time() |
| | | # 线程池 |
| | | __l2_cmd_thread_pool.submit( |
| | |
| | | data_callback_distribute_manager = CodeDataCallbackDistributeManager(data_callbacks) |
| | | l2_data_upload_manager = L2DataUploadManager(data_callback_distribute_manager) |
| | | __init_l2(l2_data_upload_manager) |
| | | |
| | | threading.Thread(target=huaxin_l2_log.run_sync, daemon=True).start() |
| | | # TODO 测试 |
| | | # threading.Thread(target=lambda: test_add_codes(queue_r), daemon=True).start() |
| | | global l2CommandManager |
| | |
| | | """ |
| | | 华鑫交易数据更新 |
| | | """ |
| | | import json |
| | | import queue |
| | | import threading |
| | | import time |
| | |
| | | gpcode_manager.request_price_pre(need_update_codes) |
| | | queue_l1_trade_r_strategy_w.put_nowait( |
| | | {"type": "set_target_codes", "data": list(position_codes)}) |
| | | queue_strategy_w_l2_r.put_nowait( |
| | | {"type": "l2_cmd", "data": list(position_codes)}) |
| | | queue_strategy_w_l2_r.put_nowait(json.dumps( |
| | | {"type": "l2_cmd", "data": list(position_codes)})) |
| | | # 9点25之前需要订阅持仓票 |
| | | __process_thread_pool.submit(huaxin_trade_record_manager.PositionManager.add, datas) |
| | | async_log_util.info(hx_logger_trade_debug, f"获取交易数据成功:{type_}") |