From 9972c26c36c18a1ca5b636964a38ba1cf56a1208 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 23 十月 2023 17:44:55 +0800 Subject: [PATCH] 调整下单金额/调整输出/调整股价过高判断 --- code_attribute/code_nature_analyse.py | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/code_attribute/code_nature_analyse.py b/code_attribute/code_nature_analyse.py index d63d23b..bf20ad5 100644 --- a/code_attribute/code_nature_analyse.py +++ b/code_attribute/code_nature_analyse.py @@ -188,14 +188,19 @@ datas = datas[-10:] limit_ups = [] limit_up_count = 0 + max_price = datas[0]["high"] for data in datas: limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(data["pre_close"])) date = data['bob'].strftime("%Y-%m-%d") + if data["high"] > max_price: + max_price = data["high"] if abs(limit_up_price - data["high"]) < 0.01: limit_ups.append((date, True)) limit_up_count += 1 else: limit_ups.append((date, False)) + # 涓嬮檷骞呭害 + limit_down_rate = round((max_price - datas[-1]["close"]) / max_price, 3) if limit_up_count < 3: return False @@ -208,8 +213,10 @@ for t in temp_datas: if t[1]: t_count += 1 - if t_count >= 3: + if t_count >= 3 and limit_down_rate < 0.2: + # 闄嶅箙灏忎簬20% return True + return False -- Gitblit v1.8.0