From fb47d36048e94b9a506d5c153e3dd19a01e37df1 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 30 十月 2023 16:30:27 +0800
Subject: [PATCH] bug修复

---
 code_attribute/code_nature_analyse.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/code_attribute/code_nature_analyse.py b/code_attribute/code_nature_analyse.py
index d63d23b..dca8f78 100644
--- a/code_attribute/code_nature_analyse.py
+++ b/code_attribute/code_nature_analyse.py
@@ -5,6 +5,8 @@
 # 鏄惁鏈夋定鍋�
 import copy
 import json
+import random
+import time
 
 from code_attribute import gpcode_manager
 
@@ -188,14 +190,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 +215,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