From 4f768a335ab9f61e8b63d1e7bba88ea00a6c4315 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 18 十二月 2023 16:24:21 +0800 Subject: [PATCH] 买入规则修改 --- l2/l2_data_manager_new.py | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index 3bce2ae..ef73366 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -919,10 +919,10 @@ return False, True, f"鑷敱娴侀��200浜夸互涓婏紝涔�1鍓╀綑妗f暟澶т簬10妗o紝涔颁竴锛坽buy1_price}锛夋定鍋滐紙{limit_up_price}锛�" open_limit_up_lowest_price = cls.__Buy1PriceManager.get_open_limit_up_lowest_price(code) - price_pre_close = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code) - if open_limit_up_lowest_price and ( - float(open_limit_up_lowest_price) - price_pre_close) / price_pre_close < 0.05: - return False, True, f"鐐告澘鍚庢渶浣庝环璺岃嚦5%浠ヤ笅" + # price_pre_close = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code) + # if open_limit_up_lowest_price and ( + # float(open_limit_up_lowest_price) - price_pre_close) / price_pre_close < 0.05: + # return False, True, f"鐐告澘鍚庢渶浣庝环璺岃嚦5%浠ヤ笅" # 鍥炲皝鐨勭エ锛屼笅13:15涔板叆闇�瑕佸垽鏂澘鍧楁槸鍚︿负鐙嫍 if open_limit_up_lowest_price and int(total_data[-1]["val"]["time"].replace(":", "")) > 131500: @@ -963,19 +963,22 @@ @classmethod def can_buy_first(cls, code, limit_up_price): + now_timestamp = int(tool.get_now_time_str().replace(":", "")) # 鍒ゆ柇鏉垮潡 can_buy_result = cls.__get_can_buy_block(code) l2_log.debug(code, "鑾峰彇鍒扮殑鏉垮潡淇℃伅锛歿}", can_buy_result) if can_buy_result is None: return False, True, "灏氭湭鑾峰彇鍒版澘鍧椾俊鎭�" if not can_buy_result[0] and can_buy_result[1]: + zyltgb = global_util.zyltgb_map.get(code) # 鐙嫍 - return False, True, f"鐙嫍涓嶄笅鍗曪紙{can_buy_result[4]}锛�" + if now_timestamp > int("100000"): + return False, True, f"鐙嫍涓嶄笅鍗曪紙{can_buy_result[4]}锛� 10鐐瑰悗涓嶄笅鍗�" + elif zyltgb < 10 * 100000000 or zyltgb > 20 * 100000000: + return False, True, f"鐙嫍涓嶄笅鍗曪紙{can_buy_result[4]}锛夎嚜鐢辨祦閫氬競鍊硷紙{zyltgb}锛変笉婊¤冻鏉′欢" # -------閲忕殑绾︽潫-------- k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) - - now_timestamp = int(tool.get_now_time_str().replace(":", "")) # 鍓嶄竴澶╃偢鏉夸箣鍚庯紝浠婃棩10:00涔嬪墠鎵嶈兘涓嬪崟 if k_format and len(k_format) >= 11 and k_format[10]: @@ -1038,6 +1041,10 @@ # else: if can_buy_result[0]: return True, False, can_buy_result[2] + + if can_buy_result[1]: + return True, False, "涔扮嫭鑻�" + return False, True, can_buy_result[2] @classmethod -- Gitblit v1.8.0