Administrator
2023-03-28 c7b6f5be3e5850bbf66db5363e634c57ff9ca876
code_nature_analyse.py
@@ -63,37 +63,29 @@
    p4 = __is_near_new_top(limit_up_price, record_datas)
    p5 = __is_n_model(record_datas)
    p6 = __is_v_model(record_datas)
    # N字型包含了N字型
    if p5:
        p6 = False, ''
    return (p1, p2, p3, p4, p5, p6)
    # # N字型包含了N字型
    # if p5:
    #     p6 = False, ''
    p7 = (p1[0] or p2[0] or p3[0] or p4[0] or p5[0] or p6[0], '')
    return p1, p2, p3, p4, p5, p6, p7
# 是否具有K线形态
def is_has_k_format(limit_up_price, record_datas):
    is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v = get_k_format(float(limit_up_price), record_datas)
    # if is_too_high:
    #     return False, "15个交易日涨幅大于24.9%"
    # if is_near_new_top:
    #     return False, "逼近前高"
    if is_new_top:
        return True, "破前高"
    if is_lowest:
        return True, "超跌补涨"
    if is_n:
        return True, "N字型"
    if is_v:
        return True, "V字形"
    return False, "不满足K线形态"
    is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v, has_format = get_k_format(float(limit_up_price), record_datas)
    if not has_format:
        return False, "不满足K线形态"
    return True, "有形态"
# 获取股性
# 返回(是否涨停,首板溢价率是否大于0.6)
def get_nature(record_datas):
    limit_up = is_have_limit_up(record_datas)
    premium_rate = get_limit_up_premium_rate(record_datas)
    result = (limit_up, premium_rate >= 0.6,premium_rate)
    result = (limit_up, premium_rate >= 0.6, premium_rate)
    return result