From 1a548140ff25cc88b8bae67e4df6caefe0dadb74 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 09 四月 2024 14:10:14 +0800
Subject: [PATCH] 重新启用F撤

---
 l2/l2_transaction_data_processor.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/l2/l2_transaction_data_processor.py b/l2/l2_transaction_data_processor.py
index 4b4854c..81a52c0 100644
--- a/l2/l2_transaction_data_processor.py
+++ b/l2/l2_transaction_data_processor.py
@@ -3,7 +3,7 @@
 
 from l2 import l2_data_util, l2_data_manager, transaction_progress
 from l2.cancel_buy_strategy import FCancelBigNumComputer, LCancelBigNumComputer, LCancelRateManager, \
-    GCancelBigNumComputer, SCancelBigNumComputer, HourCancelBigNumComputer, DCancelBigNumComputer
+    GCancelBigNumComputer, SCancelBigNumComputer, HourCancelBigNumComputer
 from l2.l2_data_manager_new import L2TradeDataProcessor
 from l2.l2_data_util import L2DataUtil
 from l2.l2_transaction_data_manager import HuaXinBuyOrderManager, HuaXinSellOrderStatisticManager
@@ -46,11 +46,14 @@
                 buyno_map = {}
 
             order_begin_pos = l2_data_manager.TradePointManager().get_buy_compute_start_data_cache(code)
+            # 鏄惁宸茬粡涓嬪崟
+            is_placed_order = l2_data_manager.TradePointManager.is_placed_order(order_begin_pos)
 
             big_sell_order_info = None
             try:
                 # 缁熻鍗栧崟
-                big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas)
+                big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas,
+                                                                                            order_begin_pos.buy_exec_index if is_placed_order else None)
                 need_cancel, cancel_msg = SCancelBigNumComputer().set_big_sell_order_info_for_cancel(code,
                                                                                                      big_sell_order_info,
                                                                                                      order_begin_pos)
@@ -103,7 +106,11 @@
 
                 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, cancel_result[1])
                     HourCancelBigNumComputer().set_transaction_index(code, order_begin_pos.buy_single_index,
                                                                      buy_progress_index)
             else:
@@ -119,3 +126,4 @@
             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