From dc6097632b647f3797f086b7d93e1ae32260de4f Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 10 十月 2024 18:34:19 +0800
Subject: [PATCH] 增加接口/加绿规则更改

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

diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py
index 67bb17a..7120a91 100644
--- a/l2/l2_data_manager_new.py
+++ b/l2/l2_data_manager_new.py
@@ -992,7 +992,7 @@
         # ------------鎸傚崟鏃堕棿绾︽潫----------
         order_begin_pos = cls.__get_order_begin_pos(
             code)
-        if not trade_result_manager.can_place_order_for_cancel_time(code, total_data[order_begin_pos.buy_exec_index]):
+        if not trade_result_manager.can_place_order_for_cancel_time(code, total_data[order_begin_pos.buy_exec_index]) and not gpcode_manager.GreenListCodeManager().is_in_cache(code):
             return False, True, f"璺濈涓婃鎸傚崟灏忎簬鏃堕棿闄愬埗", True
 
         # ------------鏉垮潡绾︽潫-------------
@@ -1346,8 +1346,13 @@
         # 鎵叆涓嬪崟鍙湁L鎾よ兘鎾ゅ崟
         if order_begin_pos and order_begin_pos.mode == OrderBeginPosInfo.MODE_RADICAL and cancel_type not in {
             trade_constant.CANCEL_TYPE_L, trade_constant.CANCEL_TYPE_L_UP, trade_constant.CANCEL_TYPE_L_DOWN}:
+            l2_log.cancel_debug(code, "鎾ゅ崟涓柇锛屽師鍥狅細{}", "鎵叆涓嬪崟涓嶆槸L鎾�")
             return False
-
+        # 鍔犵豢鍙湁L鎾ょ敓鏁�
+        if gpcode_manager.GreenListCodeManager().is_in_cache(code):
+            if cancel_type not in { trade_constant.CANCEL_TYPE_L, trade_constant.CANCEL_TYPE_L_UP, trade_constant.CANCEL_TYPE_L_DOWN}:
+                l2_log.cancel_debug(code, "鎾ゅ崟涓柇锛屽師鍥狅細{}", "鍔犵豢涓嶆槸L鎾�")
+                return False
         total_datas = local_today_datas.get(code)
         if not total_datas:
             return False

--
Gitblit v1.8.0