From aacc6148dd43a9cffbff9a23a273a55b64bf3d8c Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期六, 12 十月 2024 17:21:42 +0800
Subject: [PATCH] bug修复

---
 code_attribute/code_nature_analyse.py |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/code_attribute/code_nature_analyse.py b/code_attribute/code_nature_analyse.py
index e299b63..0984759 100644
--- a/code_attribute/code_nature_analyse.py
+++ b/code_attribute/code_nature_analyse.py
@@ -222,8 +222,12 @@
     p12 = __has_limit_up(code, record_datas, 90)
     # 鏈�杩�5澶╂槸鍚﹁穼鍋�
     p13 = __is_latest_limit_down(code, record_datas, 5)
+    # 60涓氦鏄撴棩鏄惁鏇炬定鍋�
+    p14 = __has_limited_up(code, record_datas, 60)
+    # 鏄ㄦ棩鏄惁娑ㄥ仠杩�
+    p15 = __has_limited_up(code, record_datas, 1)
 
-    return p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13
+    return p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15
 
 
 # 鏄惁鍏锋湁K绾垮舰鎬�
@@ -614,13 +618,13 @@
 # 鏄惁娑ㄥ仠
 def __is_limit_up(code, data):
     limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, data["pre_close"]))
-    return abs(limit_up_price - data["close"]) < 0.001
+    return abs(limit_up_price - data["close"]) < 0.009
 
 
 # 鏄惁娑ㄥ仠杩�
 def __is_limited_up(code, data):
     limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, data["pre_close"]))
-    return abs(limit_up_price - data["high"]) < 0.001
+    return abs(limit_up_price - data["high"]) < 0.009
 
 
 # 澶氬皯澶╁唴鏄惁鏈夋定鍋�/鏇炬定鍋�
@@ -637,6 +641,20 @@
     return False
 
 
+# 澶氬皯澶╁唴鏄惁鏇炬定鍋�
+def __has_limited_up(code, datas, day_count):
+    datas = copy.deepcopy(datas)
+    datas.sort(key=lambda x: x["bob"])
+    if len(datas) > day_count:
+        datas = datas[0 - day_count:]
+    if len(datas) >= 1:
+        for i in range(0, len(datas)):
+            item = datas[i]
+            if __is_limited_up(code, item):
+                return True
+    return False
+
+
 # 棣栨澘娑ㄥ仠婧环鐜�
 def get_limit_up_premium_rate(code, datas):
     datas = copy.deepcopy(datas)

--
Gitblit v1.8.0