From 7de28c45eb5fc393bfed07ffbefb69dc63eeaa4d Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 09 一月 2025 15:36:04 +0800 Subject: [PATCH] BUG修复 --- third_data/kpl_limit_up_data_manager.py | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/third_data/kpl_limit_up_data_manager.py b/third_data/kpl_limit_up_data_manager.py index 3ffb3a1..526ed5d 100644 --- a/third_data/kpl_limit_up_data_manager.py +++ b/third_data/kpl_limit_up_data_manager.py @@ -126,8 +126,8 @@ """ 鏈�杩戞定鍋滅殑鏉垮潡绠$悊 """ - # 鐪嬫渶杩�3澶╋紝涓嶅寘鍚粖澶� - __LATEST_DAY_COUNT = 3 + # 鐪嬫渶杩�2澶╋紝涓嶅寘鍚粖澶� + __LATEST_DAY_COUNT = 2 __days = [] # 鐩墠娑ㄥ仠 @@ -242,9 +242,9 @@ block_codes_dict[b] = set() block_count_dict[b].add(day) block_codes_dict[b] |= self.__block_day_datas[day][b][2] - + # [(鏉垮潡,娑ㄥ仠鏃ユ湡闆嗗悎)] block_count_list = [(k, block_count_dict[k]) for k in block_count_dict] - block_count_list.sort(key=lambda x: x[1], reverse=True) + block_count_list.sort(key=lambda x: len(x[1]), reverse=True) block_count_list = block_count_list[:50] # [(娑ㄥ仠鍘熷洜,绱娑ㄥ仠娆℃暟,杩炵画娆℃暟)] fdatas = [] @@ -257,6 +257,11 @@ if day not in self.__block_day_datas: continue if b in self.__block_day_datas[day]: + total_limit_up_count = self.__block_day_datas[day][b][0] + self.__block_day_datas[day][b][1] + else: + total_limit_up_count = 0 + if b in self.__block_day_datas[day] and total_limit_up_count >= 3: + # 鏉垮潡浠g爜鏁伴噺>=3涓� temp.append(day) else: c = len(temp) @@ -308,10 +313,10 @@ if cls.__days: volumes_data = HistoryKDataManager().get_history_bars(code, cls.__days[1]) if volumes_data: - volumes_data = volumes_data[:cls.__LATEST_DAY_COUNT - 1] + volumes_data = volumes_data[:cls.__LATEST_DAY_COUNT] cls.__k_datas[code] = volumes_data if not volumes_data: - volumes_data = init_data_util.get_volumns_by_code(code, cls.__LATEST_DAY_COUNT - 1) + volumes_data = init_data_util.get_volumns_by_code(code, cls.__LATEST_DAY_COUNT) if volumes_data: cls.__k_datas[code] = volumes_data # 鑾峰彇鏈�澶ф定骞� -- Gitblit v1.8.0