From 306f896df9ad1a51dd30b291284a22c12e16597f Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 11 六月 2024 23:32:01 +0800
Subject: [PATCH] 更改板上放量不足规则/L前囊括规则修改

---
 cancel_strategy/s_l_h_cancel_strategy.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cancel_strategy/s_l_h_cancel_strategy.py b/cancel_strategy/s_l_h_cancel_strategy.py
index 9cbae71..95436d6 100644
--- a/cancel_strategy/s_l_h_cancel_strategy.py
+++ b/cancel_strategy/s_l_h_cancel_strategy.py
@@ -1014,11 +1014,16 @@
                     break
 
         changed = True
-        if code in self.__last_l_up_compute_info:
-            if self.__last_l_up_compute_info[code] == watch_indexes:
+        __last_l_up_compute_info = self.__last_l_up_compute_info.get(code)
+        if __last_l_up_compute_info:
+            if __last_l_up_compute_info == watch_indexes:
                 changed = False
         # 淇濆瓨鏁版嵁
         if changed:
+            threshold_time = 1 if tool.is_sz_code(code) else 2
+            if  time.time() - __last_l_up_compute_info[0] < threshold_time:
+                l2_log.l_cancel_debug(code, f"L鍓嶇洃鎺ф洿鏂板お棰戠箒锛歿threshold_time}")
+                return
             l2_log.l_cancel_debug(code, f"L鍓嶇洃鎺ц寖鍥达細{watch_indexes} 璁$畻鑼冨洿锛歿start_index}-{end_index}")
             self.__set_near_by_trade_progress_indexes(code, buy_single_index, watch_indexes)
         self.__last_l_up_compute_info[code] = (time.time(), watch_indexes)

--
Gitblit v1.8.0