Administrator
2023-10-23 9972c26c36c18a1ca5b636964a38ba1cf56a1208
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