From 89f860904270b6cdc20b5e7e90a7c12b5b2bf8e3 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 25 四月 2025 09:53:15 +0800 Subject: [PATCH] bug修复 --- code_attribute/code_nature_analyse.py | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code_attribute/code_nature_analyse.py b/code_attribute/code_nature_analyse.py index e259959..bedeea1 100644 --- a/code_attribute/code_nature_analyse.py +++ b/code_attribute/code_nature_analyse.py @@ -404,7 +404,7 @@ # if max_price > float(limit_up_price): # return False rate = (float(limit_up_price) - min_price_info[1]["close"]) / min_price_info[1]["close"] - THRESHOLD_RATE = 0.319*2 if tool.is_ge_code(code) else 0.319 + THRESHOLD_RATE = 0.319 * 2 if tool.is_ge_code(code) else 0.319 if rate >= THRESHOLD_RATE: return True, rate return False, rate @@ -560,8 +560,9 @@ items = datas[0 - day_count:] for item in items: limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, item["pre_close"])) - if abs(limit_up_price - item["high"]) < 0.001 and abs(limit_up_price - item["close"]) > 0.001: - # 鐐告澘 + limit_down_price = float(gpcode_manager.get_limit_down_price_by_preprice(code, item["pre_close"])) + if abs(limit_up_price - item["high"]) < 0.001 or abs(limit_down_price - item["close"]) < 0.001: + # 鐐告澘 # 鎴栨定鍋� # 鎴栬�呰穼鍋� return True return False @@ -592,8 +593,8 @@ for item in items: # 鏄惁鏈夎穼鍋� # 鑾峰彇褰撴棩娑ㄥ箙 - rate = (item["close"] - item["pre_close"])/item["pre_close"] - threshold_rate_ = round(0 - ((1 - tool.get_limit_down_rate(code))*0.9), 2) + rate = (item["close"] - item["pre_close"]) / item["pre_close"] + threshold_rate_ = round(0 - ((1 - tool.get_limit_down_rate(code)) * 0.9), 2) if rate < threshold_rate_: return True return False -- Gitblit v1.8.0