From 5908302c29d024b2d1563f32bc3e89d6779c287c Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 16 四月 2024 14:34:46 +0800 Subject: [PATCH] S快砸比例限制 --- l2/l2_transaction_data_processor.py | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/l2/l2_transaction_data_processor.py b/l2/l2_transaction_data_processor.py index 4ebc715..c3853fd 100644 --- a/l2/l2_transaction_data_processor.py +++ b/l2/l2_transaction_data_processor.py @@ -1,6 +1,7 @@ import logging import time +from code_attribute import gpcode_manager from l2 import l2_data_util, l2_data_manager, transaction_progress from l2.cancel_buy_strategy import FCancelBigNumComputer, LCancelBigNumComputer, LCancelRateManager, \ GCancelBigNumComputer, SCancelBigNumComputer, HourCancelBigNumComputer @@ -51,9 +52,11 @@ big_sell_order_info = None try: + limit_up_price = gpcode_manager.get_limit_up_price(code) + if limit_up_price: + limit_up_price = round(float(limit_up_price), 2) # 缁熻鍗栧崟 - big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas, - order_begin_pos.buy_exec_index if is_placed_order else None) + big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas, limit_up_price) need_cancel, cancel_msg = SCancelBigNumComputer().set_big_sell_order_info_for_cancel(code, big_sell_order_info, order_begin_pos) @@ -106,7 +109,14 @@ LCancelBigNumComputer().set_trade_progress(code, order_begin_pos.buy_single_index, buy_progress_index, total_datas) + if order_begin_pos and order_begin_pos.buy_exec_index and order_begin_pos.buy_exec_index > -1: + cancel_result = FCancelBigNumComputer().need_cancel_for_deal_fast(code, buy_progress_index) + if cancel_result[0]: + L2TradeDataProcessor.cancel_buy(code, f"F鎾�:{cancel_result[1]}") + + SCancelBigNumComputer().set_transaction_index(code, order_begin_pos.buy_single_index, + buy_progress_index) HourCancelBigNumComputer().set_transaction_index(code, order_begin_pos.buy_single_index, buy_progress_index) else: @@ -122,4 +132,3 @@ use_time = int((time.time() - __start_time) * 1000) if use_time > 10: async_log_util.info(hx_logger_l2_upload, f"{code}澶勭悊鎴愪氦鐢ㄦ椂锛歿use_time}") - -- Gitblit v1.8.0