Administrator
2023-12-15 3da5d1ef00cf7665c2d37f837e6845c92d22e31c
前日炸板策略修改
3个文件已修改
30 ■■■■ 已修改文件
code_attribute/code_nature_analyse.py 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/test_code_attribute.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code_attribute/code_nature_analyse.py
@@ -198,7 +198,7 @@
# 获取K线形态
# 返回 (15个交易日涨幅是否大于24.9%,是否破前高,是否超跌,是否接近前高,是否N,是否V,是否有形态,天量大阳信息,是否具有辨识度)
# 返回 (15个交易日涨幅是否大于24.9%,是否破前高,是否超跌,是否接近前高,是否N,是否V,是否有形态,天量大阳信息,是否具有辨识度,近2天有10天内最大量,上个交易日是否炸板)
def get_k_format(limit_up_price, record_datas):
    p1_data = get_lowest_price_rate(record_datas)
    p1 = p1_data[0] >= 0.249, p1_data[1]
@@ -218,13 +218,14 @@
    # 是否具有辨识度
    p9 = is_special(record_datas)
    p10 = is_latest_10d_max_volume_at_latest_2d(record_datas)
    p11 = __is_yesterday_open_limit_up(record_datas)
    return p1, p2, p3, p4, p5, p6, p7, p8, p9, p10
    return p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
# 是否具有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, has_format, volume_info, is_special, has_max_volume = get_k_format(
    is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v, has_format, volume_info, is_special, has_max_volume, open_limit_up = get_k_format(
        float(limit_up_price), record_datas)
    if not has_format:
        return False, "不满足K线形态"
@@ -469,6 +470,18 @@
    return False, ''
# 昨天是否炸板
def __is_yesterday_open_limit_up(datas):
    datas = copy.deepcopy(datas)
    datas.sort(key=lambda x: x["bob"])
    item = datas[-1]
    limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"]))
    if abs(limit_up_price - item["high"]) < 0.001 and abs(limit_up_price - item["close"]) > 0.001:
        # 炸板
        return True
    return False
# V字形
def __is_v_model(datas):
    datas = copy.deepcopy(datas)
l2/l2_data_manager_new.py
@@ -976,6 +976,12 @@
        k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code)
        now_timestamp = int(tool.get_now_time_str().replace(":", ""))
        # 前一天炸板之后,今日10:00之前才能下单
        if k_format and len(k_format) >= 11 and k_format[10]:
            if now_timestamp > int("100000"):
                return False, True, f"上个交易日炸板,当日量10点以后不下单"
        if can_buy_result[3] and now_timestamp <= int("094000"):
            # 强势主线与强势10分钟不看量
            pass
test/test_code_attribute.py
@@ -10,15 +10,14 @@
if __name__ == "__main__":
    code_str = "600148"
    code_str = "600748"
    codes = code_str.split(",")
    for code in codes:
        if not tool.is_shsz_code(code):
            continue
        try:
            datas = init_data_util.get_volumns_by_code(code, 120)
            datas = datas[0:]
            result = is_too_high(datas)
            result = code_nature_analyse.__is_yesterday_open_limit_up(datas)
            if result:
                print(code, result)
        except: