Administrator
2025-01-13 4646c44858e83949f8fb7a3e381c9ec40b64d73b
third_data/kpl_data_constant.py
@@ -113,6 +113,8 @@
                kpl_block_dict[code] = []
            kpl_block_dict[code].append((r[2], r[1]))  # (板块, 日期)
        for code in kpl_block_dict:
            if code =='002361':
                print("")
            block_infos = kpl_block_dict.get(code)
            cls.__radical_buy_reasons_dict[code] = cls.__compute_limit_up_reasons(code, block_infos)
@@ -129,9 +131,13 @@
        # {"板块":[(出现次数, 最近出现日期)]}
        temp_dict = {}
        for b in block_infos:
            if b[0] in constant.KPL_INVALID_BLOCKS:
                continue
            if b[0] not in temp_dict:
                temp_dict[b[0]] = [0, b[1]]
            temp_dict[b[0]][0] += 1
        if not temp_dict:
            return set()
        temp_list = [(k, temp_dict[k][0], temp_dict[k][1]) for k in temp_dict]
        # 按照涨停次数与最近涨停时间排序
        temp_list.sort(key=lambda x: (x[1], x[2]), reverse=True)