From cd1a41fffb929d22423833b8197e9a1b7d69271c Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 27 二月 2024 18:14:00 +0800 Subject: [PATCH] 新版L2数据传输协议测试 --- huaxin_client/l2_client.py | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/huaxin_client/l2_client.py b/huaxin_client/l2_client.py index b55c574..5baf643 100644 --- a/huaxin_client/l2_client.py +++ b/huaxin_client/l2_client.py @@ -587,21 +587,22 @@ queue_r.put_nowait(json.dumps({"type": "l2_cmd", "data": [demo_datas[0]]})) time.sleep(1) - - spi.l2_data_upload_manager.add_l2_order_detail( - {'SecurityID': '603002', 'Price': 6.35, 'Volume': 275000, 'Side': "1", 'OrderType': '0', - 'OrderTime': '13000015', - 'MainSeq': 2, 'SubSeq': 6739147, 'OrderNO': 5512466, 'OrderStatus': 'D'}, 0) - spi.l2_data_upload_manager.add_l2_order_detail( - {'SecurityID': '603002', 'Price': 6.35, 'Volume': 200, 'Side': "1", 'OrderType': '0', - 'OrderTime': '13000015', - 'MainSeq': 2, 'SubSeq': 6739148, 'OrderNO': 5512467, 'OrderStatus': 'D'}, 0) - queue_r.put_nowait(json.dumps({"type": "listen_volume", "data": {"code": "603002", "volume": 100}})) - time.sleep(0.1) - spi.l2_data_upload_manager.add_l2_order_detail( - {'SecurityID': '603002', 'Price': 6.35, 'Volume': 100, 'Side': "1", 'OrderType': '0', - 'OrderTime': '13000015', - 'MainSeq': 2, 'SubSeq': 6739148, 'OrderNO': 5512467, 'OrderStatus': 'D'}, 0) + while True: + spi.l2_data_upload_manager.add_l2_order_detail( + {'SecurityID': '603002', 'Price': 6.35, 'Volume': 275000, 'Side': "1", 'OrderType': '0', + 'OrderTime': '13000015', + 'MainSeq': 2, 'SubSeq': 6739147, 'OrderNO': 5512466, 'OrderStatus': 'D'}, 0) + spi.l2_data_upload_manager.add_l2_order_detail( + {'SecurityID': '603002', 'Price': 6.35, 'Volume': 200, 'Side': "1", 'OrderType': '0', + 'OrderTime': '13000015', + 'MainSeq': 2, 'SubSeq': 6739148, 'OrderNO': 5512467, 'OrderStatus': 'D'}, 0) + queue_r.put_nowait(json.dumps({"type": "listen_volume", "data": {"code": "603002", "volume": 100}})) + time.sleep(0.1) + spi.l2_data_upload_manager.add_l2_order_detail( + {'SecurityID': '603002', 'Price': 6.35, 'Volume': 100, 'Side': "1", 'OrderType': '0', + 'OrderTime': '13000015', + 'MainSeq': 2, 'SubSeq': 6739148, 'OrderNO': 5512467, 'OrderStatus': 'D'}, 0) + time.sleep(10) def run(queue_r: multiprocessing.Queue, order_queues: List[multiprocessing.Queue], -- Gitblit v1.8.0