Administrator
2023-10-30 fb47d36048e94b9a506d5c153e3dd19a01e37df1
third_data/kpl_block_util.py
@@ -129,6 +129,9 @@
    block_codes_infos = []
    limit_up_time = time.time()
    for k in limit_up_record_datas:
        if k[3] == code:
            # 获取当前代码涨停时间
            limit_up_time = int(k[5])
        if shsz and k[3].find("00") != 0 and k[3].find("60") != 0:
            continue
        # 剔除高位板
@@ -137,8 +140,7 @@
        if code_limit_up_reason_dict.get(k[3]) == block:
            if k[3] != code:
                block_codes_infos.append((k[3], int(k[5])))
            else:
                limit_up_time = int(k[5])
    block_codes_infos.append((code, limit_up_time))
    block_codes_infos.sort(key=lambda x: x[1])
    front_codes = []
@@ -147,7 +149,7 @@
            return i, front_codes
        else:
            front_codes.append(block_codes_infos[i][0])
    return 0,[]
    return 0, []
# 获取当日实时身位
@@ -157,6 +159,9 @@
    block_codes_infos = []
    limit_up_time = time.time()
    for k in current_limit_up_datas:
        if k[0] == code:
            # 获取当前代码涨停时间
            limit_up_time = int(k[2])
        if shsz and k[0].find("00") != 0 and k[0].find("60") != 0:
            continue
        # 剔除高位板
@@ -166,8 +171,6 @@
            if k[0] != code:
                # 代码.涨停时间
                block_codes_infos.append((k[0], int(k[2])))
            else:
                limit_up_time = int(k[2])
    block_codes_infos.append((code, limit_up_time))
    block_codes_infos.sort(key=lambda x: x[1])
    front_codes = []
@@ -176,7 +179,7 @@
            return i, front_codes
        else:
            front_codes.append(block_codes_infos[i][0])
    return 0,[]
    return 0, []
if __name__ == "__main__":