From 0f000922597f32bc525a3f1afa47fd160f76f22e Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 18 一月 2024 00:25:22 +0800 Subject: [PATCH] 选票策略修改 --- l2/l2_data_manager_new.py | 36 +++++++++++++++++++++++------------- 1 files changed, 23 insertions(+), 13 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index 45b2dd3..1413491 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -989,6 +989,9 @@ 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") + # 鏄惁鏄己鍔�30鍒嗛挓 + is_in_strong_time_30 = now_timestamp <= int("100000") + # 閲忓弬鑰冩槸鍚﹀湪鏈�杩�30澶� # is_refer_volume_date_in_30_days = False @@ -1006,21 +1009,28 @@ # 鑾峰彇甯傚満琛屾儏 situation = cls.__MarketSituationManager.get_situation_cache() - zylt_threshold = buy_condition_util.get_zyltgb_threshold(situation) - zyltgb = global_util.zyltgb_map.get(code) + zylt_threshold_as_yi = buy_condition_util.get_zyltgb_threshold(situation) + zyltgb_as_yi = round(global_util.zyltgb_map.get(code) / 100000000, 2) - if zyltgb >= zylt_threshold[1]: - return False, True, f"{zylt_threshold[1] // 100000000}浜夸互涓婄殑閮戒笉涔帮紙{zyltgb}锛�" + if zyltgb_as_yi >= zylt_threshold_as_yi[1]: + return False, True, f"{zylt_threshold_as_yi[1]}浜夸互涓婄殑閮戒笉涔帮紙{zyltgb_as_yi}锛�" - if zyltgb < zylt_threshold[0]: - return False, True, f"{zylt_threshold[0] // 100000000}浜夸互涓嬬殑閮戒笉涔帮紙{zyltgb}锛�" + if zyltgb_as_yi < zylt_threshold_as_yi[0]: + return False, True, f"{zylt_threshold_as_yi[0]}浜夸互涓嬬殑閮戒笉涔帮紙{zyltgb_as_yi}锛�" + + # 鏈�浼樺競鍊� + is_best_zylt = True if zylt_threshold_as_yi[4] <= zyltgb_as_yi <= zylt_threshold_as_yi[5] else False if is_special: # 鍏锋湁杈ㄨ瘑搴︼紝绠椾綔鏈�浼樺競鍊� - zyltgb = zylt_threshold[2] + 1 + zyltgb_as_yi = zylt_threshold_as_yi[2] + 1 # 鏄惁鏄渶浼樿嚜鐢辨祦閫氬競鍊� - is_best_zylt = True if zylt_threshold[2] <= zyltgb <= zylt_threshold[3] else False + is_better_zylt = True if zylt_threshold_as_yi[2] <= zyltgb_as_yi <= zylt_threshold_as_yi[3] else False + + if is_in_strong_time_30 and is_best_zylt and can_buy_result[0]: + # 寮哄娍30鍒嗛挓锛屾渶浼樺競鍊�, 鏈夊彲浠ヤ笅鍗曠殑鏉垮潡锛屼笉鐪嬮噺 + return True, False, can_buy_result[2] if HighIncreaseCodeManager().is_in(code): if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.8: @@ -1051,7 +1061,7 @@ if not is_best_zylt: # 濡傛灉娌℃湁杈ㄨ瘑搴︽墠涓嶄拱 if not is_special: - return False, True, f"寮哄娍10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝 鐙嫍锛坽can_buy_result[4]}锛変笉涓嬪崟锛坽can_buy_result[4]}锛夎嚜鐢辨祦閫氬競鍊硷紙{zyltgb}锛変笉鏄渶浼�" + return False, True, f"寮哄娍10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝 鐙嫍锛坽can_buy_result[4]}锛変笉涓嬪崟锛坽can_buy_result[4]}锛夎嚜鐢辨祦閫氬競鍊硷紙{zyltgb_as_yi}锛変笉鏄壒浼樺競鍊�" if k_format and (k_format[1][0] or k_format[3][0]): msg_list.append("鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮") # 鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮 @@ -1063,7 +1073,7 @@ return False, True, f"寮哄娍10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝鐙嫍锛坽can_buy_result[4]}锛�,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" else: msg_list.append("闈炵嫭鑻�") - if not is_best_zylt: + if not is_better_zylt: msg_list.append("涓嶆弧瓒宠嚜鐢辨祦閫�") if k_format and (k_format[1][0] or k_format[3][0]): # 鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮 @@ -1100,10 +1110,10 @@ # 闈炲己鍔�10鍒嗛挓鍙拱涓荤嚎 if not can_buy_result[0] and can_buy_result[1]: if not is_special and not is_best_zylt: - return False, True, f"闈炲己鍔�10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝闈炴渶浼樿嚜鐢辨祦閫氬競鍊�,鐙嫍锛坽can_buy_result[4]}锛変笉涓嬪崟" + return False, True, f"闈炲己鍔�10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝闈炵壒浼樺競鍊�,鐙嫍锛坽can_buy_result[4]}锛変笉涓嬪崟" if can_buy_result[3]: # 寮哄娍涓荤嚎 - if not is_best_zylt: + if not is_better_zylt: if k_format and (k_format[1][0] or k_format[3][0]): # 鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮 if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: @@ -1118,7 +1128,7 @@ return False, True, f"闈炲己鍔�10鍒嗛挓锛屽己鍔夸富绾垮悗鎺�,婊¤冻鑷敱甯傚�硷紝鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮, 褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" else: # 闈炲己鍔夸富绾� - if not is_best_zylt: + if not is_better_zylt: 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]}" -- Gitblit v1.8.0