From d5cfa6434b6650c9bbc2a08bea06b83edd6b7398 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 18 四月 2024 23:49:43 +0800 Subject: [PATCH] L2市场行情单独订阅 --- huaxin_client/l2_data_manager.py | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/huaxin_client/l2_data_manager.py b/huaxin_client/l2_data_manager.py index 8ae8055..801925a 100644 --- a/huaxin_client/l2_data_manager.py +++ b/huaxin_client/l2_data_manager.py @@ -6,10 +6,13 @@ import time # 娲诲姩鏃堕棿 +from code_atrribute import gpcode_manager from huaxin_client.code_queue_distribute_manager import CodeDataCallbackDistributeManager from log_module.async_log_util import huaxin_l2_log from log_module.log import logger_local_huaxin_l2_error import collections + +from utils import middle_api_protocol order_detail_upload_active_time_dict = {} transaction_upload_active_time_dict = {} @@ -177,4 +180,16 @@ def add_subscript_codes(codes): # 鍔犲叆涓婁紶闃熷垪 - common_queue.put(('', "l2_subscript_codes", list(codes))) + # common_queue.put(('', "l2_subscript_codes", list(codes))) + # 涓婁紶鏁版嵁 + if codes: + fresults = [] + for code in codes: + code_name = gpcode_manager.CodesNameManager.get_code_name(code) + fresults.append((code, code_name)) + fdata = middle_api_protocol.load_l2_position_subscript_codes(fresults) + middle_api_protocol.request(fdata) + + +if __name__ == "__main__": + add_subscript_codes(["000333"]) -- Gitblit v1.8.0