From 3cb848d1805f6587abeed8978a0d76a282e1ba04 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期三, 11 十二月 2024 17:13:03 +0800
Subject: [PATCH] 如果某板块涨停个数≥5个(所有涨停股),则目标票回封可以买

---
 third_data/kpl_data_constant.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/third_data/kpl_data_constant.py b/third_data/kpl_data_constant.py
index 7a1b30e..2612917 100644
--- a/third_data/kpl_data_constant.py
+++ b/third_data/kpl_data_constant.py
@@ -219,10 +219,25 @@
     __history_code_data_dict = {}
     history_limit_up_datas = []
     current_limit_up_datas = []
+    __current_limit_up_block_codes = {}
 
     @classmethod
     def set_current_limit_up_datas(cls, current_limit_up_datas):
         cls.current_limit_up_datas = current_limit_up_datas
+        # 缁熻鏉垮潡褰撳墠娑ㄥ仠鏁伴噺
+        block_codes = {}
+        for d in current_limit_up_datas:
+            code = d[0]
+            blocks = LimitUpCodesBlockRecordManager().get_radical_buy_blocks(code)
+            if blocks:
+                for b in blocks:
+                    if b not in block_codes:
+                        block_codes[b] = set()
+                    block_codes[b].add(code)
+        cls.__current_limit_up_block_codes = block_codes
+
+
+
 
     @classmethod
     def set_history_limit_up_datas(cls, history_limit_up_datas_):
@@ -272,6 +287,10 @@
             return int(cls.__history_code_data_dict[code][5])
         return None
 
+    @classmethod
+    def get_current_limit_up_block_codes(cls, block):
+        return cls.__current_limit_up_block_codes.get(block)
+
 
 if __name__ == "__main__":
     ContainsLimitupCodesBlocksManager()

--
Gitblit v1.8.0