Administrator
2023-08-18 98cdfdb18ec1d93b84e051b1901969adc7123ee2
third_data/code_plate_key_manager.py
@@ -439,6 +439,7 @@
        can_buy_blocks = []
        for block in keys:
            log.logger_kpl_debug.info(f"判断板块是否可买:{block}")
            is_top_8_record, top_8_record = kpl_block_util.is_record_top_block(code, block, limit_up_record_datas,
                                                                               yesterday_current_limit_up_codes, 50)
            is_top_4_current, top_4_current = kpl_block_util.is_current_top_block(code, block, current_limit_up_datas,
@@ -479,21 +480,22 @@
                            f"板块-{block}: top4涨停板块,非主板开1,不为主板龙1(实时身位-{current_shsz_rank},历史身位-{record_shsz_rank})")
                        continue
            else:
                # 是否满足行业精选流入要求
                is_in_top_input = RealTimeKplMarketData.is_in_top(set([block]))[0]
                if not is_in_top_input:
                    msg_list.append(
                        f"板块-{block}: 非top4涨停板块,不满足精选/行业流入要求")
                    continue
                else:
                    # 是否为主板龙1(实时龙1,历史龙2以内)
                    if current_shsz_rank == 0 and record_shsz_rank < 2:
                        can_buy_blocks.append((block, f"{block}:不是top4涨停板块,满足精选/行业流入要求,满足主板龙1"))
                        continue
                    else:
                        msg_list.append(
                            f"板块-{block}: 不是top4涨停板块,满足精选/行业流入要求,不为主板龙1(实时身位-{current_shsz_rank},历史身位-{record_shsz_rank})")
                        continue
                pass
                # # 是否满足行业精选流入要求
                # is_in_top_input = RealTimeKplMarketData.is_in_top(set([block]))[0]
                # if not is_in_top_input:
                #     msg_list.append(
                #         f"板块-{block}: 非top4涨停板块,不满足精选/行业流入要求")
                #     continue
                # else:
                #     # 是否为主板龙1(实时龙1,历史龙2以内)
                #     if current_shsz_rank == 0 and record_shsz_rank < 2:
                #         can_buy_blocks.append((block, f"{block}:不是top4涨停板块,满足精选/行业流入要求,满足主板龙1"))
                #         continue
                #     else:
                #         msg_list.append(
                #             f"板块-{block}: 不是top4涨停板块,满足精选/行业流入要求,不为主板龙1(实时身位-{current_shsz_rank},历史身位-{record_shsz_rank})")
                #         continue
        if len(can_buy_blocks) == len(keys):
            blocks = [x[0] for x in can_buy_blocks]
            blocks_msg = "\n".join([x[1] for x in can_buy_blocks])