From 81f328532e366eef171b71810b221a9294dda78f Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 21 十二月 2023 14:31:58 +0800
Subject: [PATCH] 买入条件调整/L撤调整

---
 third_data/kpl_data_manager.py |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/third_data/kpl_data_manager.py b/third_data/kpl_data_manager.py
index e4fec08..5b0f2e8 100644
--- a/third_data/kpl_data_manager.py
+++ b/third_data/kpl_data_manager.py
@@ -161,7 +161,6 @@
         mysqldb = mysql_data.Mysqldb()
         return mysqldb.select_all(f"select * from kpl_limit_up_record where _code='{code}' and _day='{day}'")
 
-
     @staticmethod
     def list_by_block(block_name, day):
         mysqldb = mysql_data.Mysqldb()
@@ -278,8 +277,6 @@
             cls.__file_content_cache[key] = fdata
         return fdata
 
-
-
     @classmethod
     # 鑾峰彇鏈�杩戝嚑澶╃殑鏁版嵁锛屾牴鎹棩鏈熷�掑簭杩斿洖
     def get_latest_from_file(cls, type, count):
@@ -352,7 +349,7 @@
         datas = __limit_up_list_records_dict[day]
     else:
         logger_debug.info("浠庢枃浠朵腑鑾峰彇鍓嶅嚑澶╃殑瀹炴椂娑ㄥ仠鏁版嵁")
-        datas = KPLDataManager().get_latest_from_file(KPLDataType.LIMIT_UP, 10)
+        datas = KPLDataManager().get_latest_from_file(KPLDataType.LIMIT_UP, count + 2)
         if datas:
             # 淇濆瓨鏁版嵁
             __limit_up_list_records_dict[day] = datas
@@ -374,6 +371,18 @@
 def get_yesterday_current_limit_up_records():
     yesterday_limit_up_data_records = get_current_limit_up_data_records(1)[0][1]
     return yesterday_limit_up_data_records
+
+
+# 鑾峰彇鏈�杩戝嚑澶╂定鍋滃師鍥�
+__latest_current_limit_up_records = {}
+
+
+def get_latest_current_limit_up_records():
+    day = tool.get_now_date_str()
+    if day not in __latest_current_limit_up_records:
+        fdatas = get_current_limit_up_data_records(15)
+        __latest_current_limit_up_records[day] = fdatas
+    return __latest_current_limit_up_records.get(day)
 
 
 # 杩愯鎷夊彇浠诲姟
@@ -444,5 +453,6 @@
 
 
 if __name__ == "__main__":
-    run_pull_task()
+    print(get_latest_current_limit_up_records())
+    print(get_latest_current_limit_up_records())
     input()

--
Gitblit v1.8.0