From 6a533d27f5a8355bc3ad4f1910921205e7365cb6 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 11 一月 2024 17:02:33 +0800 Subject: [PATCH] 移除测试/选票规则修改 --- l2/l2_data_manager_new.py | 70 +++++++++++++++++++++++++--------- 1 files changed, 51 insertions(+), 19 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index 2ebafa6..0ffab6c 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -1006,22 +1006,20 @@ 1), buy_condition_util.get_volume_rate_by_level(2) k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) + # 鏄惁鏈夎鲸璇嗗害 + is_special = True if k_format and k_format[8][0] else False + # 涓�5涓氦鏄撴棩鏈夌偢鏉夸箣鍚� + has_open_limit_up_in_5 = True if k_format and len(k_format) >= 11 and k_format[10] else False + # 涓�5涓氦鏄撴棩鏈夎穼鍋� + has_limit_down_in_5 = True if k_format and len(k_format) >= 13 and k_format[12] else False + # 鏄惁鏄己鍔�10鍒嗛挓 + is_in_strong_time = now_timestamp <= int("094000") + if k_format and (k_format[1][0] or k_format[3][0]) and len(k_format) >= 12 and k_format[11]: # 鐮村墠楂�/鎺ヨ繎鍓嶉珮涓�30澶╁唴鏈夋定鍋� if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: return False, True, f"鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮涓�30澶╁唴鏈夋定鍋�,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" - # 涓�5涓氦鏄撴棩鏈夌偢鏉夸箣鍚� - if k_format and len(k_format) >= 11 and k_format[10]: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: - return False, True, f"涓�5涓氦鏄撴棩鐐告澘,閲忔湭杈惧埌{volume_rate_thresholds[1]}({cls.volume_rate_info[code][0]})" - - # 涓�5涓氦鏄撴棩鏈夎穼鍋� - if k_format and len(k_format) >= 13 and k_format[12]: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.29: - return False, True, f"涓�5涓氦鏄撴棩璺屽仠,閲忔湭杈惧埌{0.29}({cls.volume_rate_info[code][0]})" - - is_special = True if k_format and k_format[8][0] else False # 鑾峰彇甯傚満琛屾儏 situation = cls.__MarketSituationManager.get_situation_cache() zylt_threshold = buy_condition_util.get_zyltgb_threshold(situation) @@ -1040,8 +1038,26 @@ if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.8: return False, True, f"5澶╁唴3娆℃定鍋滐紝閲忔湭杈惧埌80%锛坽cls.volume_rate_info[code][0]}锛�" msg_list = [] - if now_timestamp <= int("094000"): + if is_in_strong_time: msg_list.append("寮哄娍10鍒嗛挓") + # 涓�5涓氦鏄撴棩鏈夌偢鏉夸箣鍚� + if has_open_limit_up_in_5: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.15: + return False, True, f"寮哄娍10鍒嗛挓,涓�5涓氦鏄撴棩鐐告澘,閲忔湭杈惧埌{0.15}({cls.volume_rate_info[code][0]})" + + # 涓�5涓氦鏄撴棩鏈夎穼鍋� + if has_limit_down_in_5: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.15: + return False, True, f"寮哄娍10鍒嗛挓,涓�5涓氦鏄撴棩璺屽仠,閲忔湭杈惧埌{0.15}({cls.volume_rate_info[code][0]})" + + + # 鑾峰彇閲忕殑鍙傝�冩棩鏈� + if code in global_util.max60_volumn: + day = global_util.max60_volumn[code][1] + if day in HistoryKDatasUtils.get_latest_trading_date_cache(5): + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.15 and not is_special: + return False, True, f"寮哄娍10鍒嗛挓锛屽弬鑰冮噺鍦ㄦ渶杩�5澶╋紝鏃犺鲸璇嗗害锛岄噺鏈揪鍒�0.15({cls.volume_rate_info[code][0]})" + # 鐙嫍 if not can_buy_result[0] and can_buy_result[1]: msg_list.append("鐙嫍") @@ -1055,7 +1071,8 @@ if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: return False, True, f"寮哄娍10鍒嗛挓锛岀嫭鑻楋紙{can_buy_result[4]}锛夛紝鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" else: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0] and not is_special: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[ + 0] and not is_special: return False, True, f"寮哄娍10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝鐙嫍锛坽can_buy_result[4]}锛�,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" else: msg_list.append("闈炵嫭鑻�") @@ -1066,7 +1083,8 @@ if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: return False, True, f"寮哄娍10鍒嗛挓锛屽悗鎺掞紝涓嶆弧瓒宠嚜鐢卞競鍊硷紝鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" else: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0] and not is_special: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[ + 0] and not is_special: return False, True, f"寮哄娍10鍒嗛挓锛屽悗鎺�,鏃犺鲸璇嗗害锛屼笉婊¤冻鑷敱甯傚�硷紝褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" else: msg_list.append("婊¤冻鑷敱娴侀��") @@ -1074,12 +1092,23 @@ return True, False, can_buy_result[2] return True, False, can_buy_result[2] else: + + # 涓�5涓氦鏄撴棩鏈夌偢鏉夸箣鍚� + if has_open_limit_up_in_5: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.29: + return False, True, f"寮哄娍10鍒嗛挓,涓�5涓氦鏄撴棩鐐告澘,閲忔湭杈惧埌{0.29}({cls.volume_rate_info[code][0]})" + + # 涓�5涓氦鏄撴棩鏈夎穼鍋� + if has_limit_down_in_5: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.29: + return False, True, f"寮哄娍10鍒嗛挓,涓�5涓氦鏄撴棩璺屽仠,閲忔湭杈惧埌{0.29}({cls.volume_rate_info[code][0]})" + # 鑾峰彇閲忕殑鍙傝�冩棩鏈� if code in global_util.max60_volumn: day = global_util.max60_volumn[code][1] if day in HistoryKDatasUtils.get_latest_trading_date_cache(5): - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1] and not is_special: - return False, True, f"鍙傝�冮噺鍦ㄦ渶杩�5澶╋紝鏃犺鲸璇嗗害锛岄噺鏈揪鍒皗volume_rate_thresholds[1]}({cls.volume_rate_info[code][0]})" + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.29 and not is_special: + return False, True, f"鍙傝�冮噺鍦ㄦ渶杩�5澶╋紝鏃犺鲸璇嗗害锛岄噺鏈揪鍒�0.29({cls.volume_rate_info[code][0]})" # 闈炲己鍔�10鍒嗛挓鍙拱涓荤嚎 if not can_buy_result[0] and can_buy_result[1]: @@ -1093,7 +1122,8 @@ if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: return False, True, f"闈炲己鍔�10鍒嗛挓锛屽己鍔夸富绾垮悗鎺掞紝涓嶆弧瓒宠嚜鐢卞競鍊硷紝鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" else: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0] and not is_special: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[ + 0] and not is_special: return False, True, f"闈炲己鍔�10鍒嗛挓锛屽己鍔夸富绾垮悗鎺�,涓嶆弧瓒宠嚜鐢卞競鍊硷紝鏃犺鲸璇嗗害锛屽綋鏃ラ噺姣�({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" else: if k_format and (k_format[1][0] or k_format[3][0]): @@ -1102,7 +1132,8 @@ else: # 闈炲己鍔夸富绾� if zyltgb < zylt_threshold[2] or zyltgb > zylt_threshold[3]: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1] and not is_special: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[ + 1] and not is_special: return False, True, f"闈炲己鍔�10鍒嗛挓锛岄潪寮哄娍涓荤嚎鍚庢帓銆愪富绾垮悗鎺掋�戯紝涓嶆弧瓒宠嚜鐢卞競鍊�,鏃犺鲸璇嗗害锛� 褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" else: if k_format and (k_format[1][0] or k_format[3][0]): @@ -1110,7 +1141,8 @@ if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: return False, True, f"闈炲己鍔�10鍒嗛挓锛岄潪寮哄娍涓荤嚎鍚庢帓銆愪富绾垮悗鎺掋�戯紝婊¤冻鑷敱甯傚�硷紝鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮, 褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" else: - if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0] and not is_special: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[ + 0] and not is_special: return False, True, f"闈炲己鍔�10鍒嗛挓锛岄潪寮哄娍涓荤嚎鍚庢帓銆愪富绾垮悗鎺掋��, 婊¤冻鑷敱甯傚�硷紝鏃犺鲸璇嗗害锛屽綋鏃ラ噺姣�({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" return True, False, can_buy_result[2] -- Gitblit v1.8.0