Administrator
2024-11-04 65afea1ba534b51f947cbe7989d7f4d650bbc9e6
third_data/code_plate_key_manager.py
@@ -12,16 +12,16 @@
from db.redis_manager_delegate import RedisUtils
from third_data import kpl_block_util, kpl_api, kpl_util, kpl_data_constant, huaxin_l1_data_manager
from settings.trade_setting import MarketSituationManager
from third_data.history_k_data_manager import HistoryKDataManager
from third_data.history_k_data_util import HistoryKDatasUtils
from third_data.kpl_data_constant import LimitUpDataConstant
from third_data.third_blocks_manager import BlockMapManager, CodeThirdBlocksManager
from trade.buy_money_count_setting import RadicalBuyBlockCodeCountManager
from trade.order_statistic import DealAndDelegateWithBuyModeDataManager
from trade.radical_buy_data_manager import RedicalBuyDataManager
from utils import global_util, tool, buy_condition_util, init_data_util
from utils import global_util, tool, buy_condition_util
from log_module import log, async_log_util
from db import redis_manager_delegate as redis_manager
from log_module.log import logger_kpl_block_can_buy, logger_debug
from log_module.log import logger_kpl_block_can_buy, logger_debug, logger_kpl_jx_out
from third_data.kpl_util import KPLPlatManager
from trade import trade_manager, l2_trade_util, trade_constant
@@ -126,6 +126,8 @@
                        async_log_util.info(logger_kpl_block_can_buy,
                                            f"{code}:获取到精选板块-{blocks}  耗时:{int(time.time() - start_time)}s")
                        self.save_jx_blocks(code, blocks, current_limit_up_blocks)
                        # 跟随精选板块一起更新
                        self.load_jx_blocks_radical(code)
                    else:
                        # 还没涨停的需要更新精选板块 更新精选板块
                        if abs(float(buy_1_price) - float(limit_up_price)) >= 0.001:
@@ -146,6 +148,8 @@
                                async_log_util.info(logger_kpl_block_can_buy,
                                                    f"{code}:获取到精选板块(更新)-{blocks}  耗时:{int(time.time() - start_time)}s")
                                self.save_jx_blocks(code, blocks, current_limit_up_blocks)
                                # 跟随精选板块一起更新
                                self.load_jx_blocks_radical(code)
                elif price_rate > 0.03:
                    # 添加备用板块
                    if not self.get_jx_blocks_cache(code, by=True):
@@ -154,19 +158,24 @@
                        self.save_jx_blocks(code, blocks, current_limit_up_blocks, by=True)
                        async_log_util.info(logger_kpl_block_can_buy,
                                            f"{code}:获取到精选板块(备用)-{blocks}  耗时:{int(time.time() - start_time)}s")
                        # 跟随精选板块一起更新
                        self.load_jx_blocks_radical(code)
                if price_rate > 0.03:
                    if not self.__code_blocks_for_radical_buy.get(code):
                        start_time = time.time()
                        blocks = kpl_api.getCodeJingXuanBlocks(code, jx=False)
                        blocks = set([b[1] for b in blocks])
                        # fblocks = BlockMapManager().filter_blocks(blocks)
                        async_log_util.info(logger_kpl_block_can_buy,
                                            f"{code}:获取到板块(激进买) 过滤前-{blocks} 耗时:{int(time.time() - start_time)}s")
                        self.save_jx_blocks_for_radical_buy(code, list(blocks))
                        self.load_jx_blocks_radical(code)
        except Exception as e:
            logger_kpl_block_can_buy.error(f"{code} 获取板块出错")
            logger_kpl_block_can_buy.exception(e)
    def load_jx_blocks_radical(self, code):
        start_time = time.time()
        blocks = kpl_api.getCodeJingXuanBlocks(code, jx=False)
        blocks = set([b[1] for b in blocks])
        # fblocks = BlockMapManager().filter_blocks(blocks)
        async_log_util.info(logger_kpl_block_can_buy,
                            f"{code}:获取到板块(激进买) 过滤前-{blocks} 耗时:{int(time.time() - start_time)}s")
        self.save_jx_blocks_for_radical_buy(code, list(blocks))
# 禁止下单的板块
@@ -284,12 +293,6 @@
    def get_today_limit_up_reason(cls, code):
        return cls.__today_total_limit_up_reason_dict.get(code)
    # 今日涨停原因变化
    def set_today_limit_up_reason_change(self, code, from_reason, to_reason):
        RedisUtils.sadd(self.__get_redis(), f"kpl_limit_up_reason_his-{code}", from_reason)
        RedisUtils.expire(self.__get_redis(), f"kpl_limit_up_reason_his-{code}", tool.get_expire())
        self.__set_total_keys(code)
    # 设置代码的今日涨停原因
    def __set_total_keys(self, code):
        keys = set()
@@ -328,6 +331,8 @@
        return fresult
# 实时开盘啦市场数据
class RealTimeKplMarketData:
    # 精选前5
@@ -341,31 +346,54 @@
    __KPLPlateForbiddenManager = KPLPlateForbiddenManager()
    __LimitUpCodesPlateKeyManager = LimitUpCodesPlateKeyManager()
    __KPLPlatManager = KPLPlatManager()
    # 精选流入前几
    __top_jx_blocks = set()
    # 精选流出前几
    __top_jx_out_blocks = set()
    @classmethod
    def set_top_5_reasons(cls, datas):
        temp_list = []
        for d in datas:
            cls.total_reason_dict[d[1]] = d
        # 排序
        for i in range(0, len(datas)):
            if datas[i][1] not in constant.KPL_INVALID_BLOCKS:
                # (名称,净流入金额,排名)
                temp_list.append((datas[i][1], datas[i][3], len(temp_list)))
                # 只获取前10个
                if len(temp_list) > 10:
                    break
                if datas[i][3] < 3 * 10000 * 10000:
                    break
    def set_market_jingxuan_blocks(cls, datas):
        """
        设置精选流入数据
        @param datas:
        @return:
        """
        blocks = set()
        for data in datas:
            if data[3] <= 0:
                break
            blocks.add(data[1])
        cls.__top_jx_blocks = blocks
        for temp in temp_list:
            names = cls.__KPLPlatManager.get_same_plat_names_by_id(temp[0])
            for name in names:
                if name == temp[1]:
                    continue
                temp_list.append((name, temp[1], temp[2]))
        cls.top_5_reason_list = temp_list
        cls.__reset_top_5_dict()
    @classmethod
    def set_market_jingxuan_out_blocks(cls, datas):
        """
        设置精选流出数据
        @param datas:
        @return:
        """
        blocks = set()
        for i in range(0, len(datas)):
            if i >= 10 and int(tool.get_now_time_str().replace(":", "")) < int("100000"):
                # 10点前看前10,十点后不看前10
                break
            data = datas[i]
            if data[3] > 0 - 5e7:
                # 过滤5千万以上的
                break
            blocks.add(kpl_util.filter_block(data[1]))
        # 记录精选流出日志
        async_log_util.info(logger_kpl_jx_out, f"原数据:{datas[:10]} 板块:{blocks}")
        cls.__top_jx_out_blocks = blocks
    @classmethod
    def get_top_market_jingxuan_blocks(cls):
        return cls.__top_jx_blocks
    @classmethod
    def get_top_market_jingxuan_out_blocks(cls):
        return cls.__top_jx_out_blocks
    @classmethod
    def set_top_5_industry(cls, datas):
@@ -398,35 +426,6 @@
        temp_set = cls.top_5_key_dict.keys()
        return temp_set
    # 通过关键字判断能买的代码数量
    @classmethod
    def get_can_buy_codes_count(cls, code, key):
        # 判断行业涨停票数量,除开自己必须大于1个
        temp_codes = LimitUpCodesPlateKeyManager.total_key_codes_dict.get(key)
        if temp_codes is None:
            temp_codes = set()
        else:
            temp_codes = set(temp_codes)
        temp_codes.discard(code)
        if len(temp_codes) < 1:
            # 后排才能挂单
            return 0, "身位不为后排"
        forbidden_plates = cls.__KPLPlateForbiddenManager.list_all_cache()
        if key in forbidden_plates:
            return 0, "不买该板块"
        # 10:30以前可以挂2个单
        if int(tool.get_now_time_str().replace(':', '')) < int("100000"):
            return 2, "10:00以前可以挂2个单"
        # 10:30以后
        if key not in cls.top_5_key_dict:
            return 0, "净流入没在前5"
        if cls.top_5_key_dict[key][1] > 3 * 10000 * 10000:
            return 2, "净流入在前5且大于3亿"
        else:
            return 1, "净流入在前5"
    @classmethod
    def is_in_top(cls, keys):
        reasons = cls.get_can_buy_key_set()
@@ -446,6 +445,14 @@
    __history_limit_up_reason_dict = {}
    # 板块
    __blocks_dict = {}
    __instance = None
    def __new__(cls, *args, **kwargs):
        if not cls.__instance:
            cls.__instance = super(CodesHisReasonAndBlocksManager, cls).__new__(cls, *args, **kwargs)
        return cls.__instance
    def __get_redis(self):
        return self.__redisManager.getRedis()
@@ -529,6 +536,14 @@
        except:
            pass
        return set()
    def get_history_blocks_cache(self, code):
        """
        获取180天的历史涨停原因缓存
        @param code:
        @return:
        """
        return self.__history_blocks_dict_cache.get(code)
# 目标代码板块关键词管理
@@ -908,7 +923,8 @@
            current_limit_up_datas = []
        # 获取目标代码板块
        keys, k1, k11, k2, k3, k4 = cls.__TargetCodePlateKeyManager.get_plate_keys(code)
        # keys, k1, k11, k2, k3, k4 = cls.__TargetCodePlateKeyManager.get_plate_keys(code)
        keys, k1 = RadicalBuyBlockManager.get_code_blocks(code)
        # log.logger_kpl_debug.info("{}最终关键词:{}", code, keys)
@@ -917,6 +933,7 @@
        fresults = []
        if not keys:
            return fresults, set()
        code_limit_up_reasons_dict = {}
        load_code_block()
        for block in keys:
@@ -1089,7 +1106,7 @@
class RadicalBuyBlockManager:
    """
    激进买板块管理
    扫入买板块管理
    """
    __TargetCodePlateKeyManager = TargetCodePlateKeyManager()
    # 上次的涨停代码
@@ -1165,7 +1182,7 @@
        kpl_data_constant.open_limit_up_code_dict_for_radical_buy = temp_dict
    @classmethod
    def __get_current_index(cls, code, block, yesterday_limit_up_codes, exclude_codes=None):
    def __get_current_index(cls, code, block, yesterday_limit_up_codes, exclude_codes=None, limit_up_time=None):
        """
        获取当前涨停身位
        @param code:
@@ -1178,9 +1195,14 @@
        current_index = 0
        block_codes_infos = []
        timestamp_start, timestamp_end = kpl_block_util.open_limit_up_time_range
        limit_up_time = time.time()
        if limit_up_time is None:
            limit_up_time = time.time()
        for k in LimitUpDataConstant.current_limit_up_datas:
            _code = k[0]
            # 剔除4板以上的板
            if kpl_util.get_high_level_count(k[4]) >= 4:
                continue
            if _code in exclude_codes:
                continue
            blocks = LimitUpDataConstant.get_blocks_with_history(_code)
@@ -1236,6 +1258,11 @@
        limit_up_space_ge_60s_codes = set()
        for k in LimitUpDataConstant.history_limit_up_datas:
            _code = k[3]
            # 剔除4板以上的板
            if kpl_util.get_high_level_count(k[12]) >= 4:
                continue
            if _code in exclude_codes:
                continue
            blocks = LimitUpDataConstant.get_blocks_with_history(_code)
@@ -1287,9 +1314,7 @@
        """
        # 9:45点之前涨停的才能买入
        # 获取当前代码的涨停时间
        limit_up_timestamp = LimitUpDataConstant.get_first_limit_up_time(code)
        if not limit_up_timestamp:
            limit_up_timestamp = time.time()
        limit_up_timestamp = cls.__get_limit_up_timestamp(code)
        if int(tool.timestamp_format(limit_up_timestamp, "%H%M%S")) > 94500:
            return False, "超过生效时间"
        # 根据板块聚合数据
@@ -1307,7 +1332,8 @@
        # ----获取历史身位----
        history_index, history_before_codes_info = cls.__get_history_index(code, block, yesterday_limit_up_codes)
        # ----获取实时身位----
        current_index, current_before_codes_info = cls.__get_current_index(code, block, yesterday_limit_up_codes)
        current_index, current_before_codes_info = cls.__get_current_index(code, block, yesterday_limit_up_codes,
                                                                           limit_up_time=limit_up_timestamp)
        exclude_codes = set()
        if count >= 2 or (
                count == 1 and kpl_data_constant.open_limit_up_code_dict_for_radical_buy[open_limit_up_block_codes[0]][
@@ -1319,7 +1345,8 @@
            # ----获取历史身位----
            history_index, history_before_codes_info = cls.__get_history_index(code, block, set())
            # ----获取实时身位----
            current_index, current_before_codes_info = cls.__get_current_index(code, block, set())
            current_index, current_before_codes_info = cls.__get_current_index(code, block, set(),
                                                                               limit_up_time=limit_up_timestamp)
            if history_before_codes_info and current_before_codes_info and history_before_codes_info[0][0] == \
                    current_before_codes_info[0][0]:
                # 前排第一个元素无炸板
@@ -1337,17 +1364,18 @@
            return False, f"开1数量:{count},非开1首板身位不匹配:历史-{history_index + 1} 实时-{current_index + 1}"
        if history_index == 1:
            # 当前代码为老2,要判断老大是否可买
            if RedicalBuyDataManager.can_buy(history_before_codes_info[0][0])[0]:
            if RedicalBuyDataManager.can_buy(history_before_codes_info[0][0],
                                             DealAndDelegateWithBuyModeDataManager().get_deal_codes())[0]:
                return False, f"开1数量:{count},前排代码可买:{history_before_codes_info[0]}"
            return True, f"开1数量:{count},前排代码不可买:{history_before_codes_info[0]}"
        return True, f"开1数量:{count},历史-{history_index + 1} 实时-{current_index + 1}"
            return True, f"开1数量:{count},前排代码不可买:{history_before_codes_info[0]},历史前排-{history_before_codes_info},开1代码-{open_limit_up_block_codes}"
        return True, f"开1数量:{count},历史-{history_index + 1} 实时-{current_index + 1}, 前排代码-{current_before_codes_info}, 开1代码-{open_limit_up_block_codes}"
    @classmethod
    def __is_radical_buy_with_block_up(cls, code, block, yesterday_limit_up_codes):
        """
        是否激进买(板块突然涨起来)
        1.老大和老二的涨停时间相差5分钟内
        2.老三的涨停时间距离老大涨停在10分钟内就买
        1.老二和老三的涨停时间相差5分钟内
        2.老三不能买顺位到老四(老四与老三相差10分钟内)
        3.前2个票不能炸板(历史身位与现在身位一致)
        4.除开前两个代码可买老1与老2
        5.买老2的情况:老1不满足买入条件
@@ -1357,46 +1385,173 @@
        @param yesterday_limit_up_codes:
        @return:
        """
        # 获取当前代码的涨停时间
        limit_up_timestamp = cls.__get_limit_up_timestamp(code)
        # 获取当前的板块
        current_index, current_before_codes_info = cls.__get_current_index(code, block, set())
        current_index, current_before_codes_info = cls.__get_current_index(code, block, set(),
                                                                           limit_up_time=limit_up_timestamp)
        current_before_codes = [x[0] for x in current_before_codes_info]
        if len(current_before_codes_info) < 2:
            return False, f"前排代码小于2个:{current_before_codes_info}"
        if current_before_codes_info[0][1] < kpl_block_util.open_limit_up_time_range[1]:
            return False, f"有开1:{current_before_codes_info}"
        # 老大,老二必须相隔5分钟内
        if current_before_codes_info[1][1] - current_before_codes_info[0][1] >= 5 * 60:
            return False, f"老大老二涨停时间必须间隔5分钟内"
        # 当前代码开1不能买
        if limit_up_timestamp < kpl_block_util.open_limit_up_time_range[1]:
            return False, f"当前代码开1"
        # 获取当前代码的涨停时间
        limit_up_timestamp = LimitUpDataConstant.get_first_limit_up_time(code)
        if not limit_up_timestamp:
            limit_up_timestamp = time.time()
        if limit_up_timestamp - current_before_codes_info[0][1] >= 15 * 60:
            return False, f"距离老大涨停已过去10分钟({current_before_codes_info[0]})"
        if tool.trade_time_sub(tool.timestamp_format(limit_up_timestamp, '%H:%M:%S'),
                               tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 10 * 60:
            return False, f"距离上个代码涨停已过去10分钟({current_before_codes_info[0]})"
        history_index, history_before_codes_info = cls.__get_history_index(code, block, set())
        history_before_codes = [x[0] for x in history_before_codes_info]
        # 前两个代码是否有炸板
        dif_codes = set(history_before_codes[:2]) - set(current_before_codes[:2])
        if dif_codes:
            return False, f"前2代码有炸板:{dif_codes}"
        # 不计算前2的代码
        exclude_codes = set(current_before_codes[:2])
        exclude_codes = set()
        for x in current_before_codes_info:
            if x[1] < kpl_block_util.open_limit_up_time_range[1]:
                exclude_codes.add(x[0])
        # 除去前二代码与开1代码之后是否为首板老大:所有开1的视为1个
        open_count = len(exclude_codes)
        if open_count > 0 and open_count + 1 <= len(current_before_codes):
            # 前排有开1
            exclude_codes |= set(current_before_codes[open_count:open_count + 1])
        else:
            exclude_codes |= set(current_before_codes[:2])
        open_limit_up_code_dict = kpl_data_constant.open_limit_up_code_dict_for_radical_buy
        if open_limit_up_code_dict:
            exclude_codes |= set(open_limit_up_code_dict.keys())
        history_index, history_before_codes_info = cls.__get_history_index(code, block, yesterday_limit_up_codes,
                                                                           exclude_codes)
        if history_index > 1:
            return False, f"排除前2,目标代码位于历史身位-{history_index + 1},前排代码:{history_before_codes_info}"
        if history_index == 1:
            # 首板老2,判断前面的老大是否是属于不能买的范畴
            pre_code = history_before_codes_info[0][0]
            # pre_code不能买,才能买
            if RedicalBuyDataManager.can_buy(pre_code)[0]:
                return False, f"前排代码可买:{pre_code}"
        return True, "满足买入需求"
        # 获取本板块买入代码的最大数量
        max_count = RadicalBuyBlockCodeCountManager().get_block_code_count(block)
        if history_index > max_count:
            return False, f"排除前2,目标代码位于历史身位-{history_index + 1},前排代码:{history_before_codes_info}, 板块最多可买{max_count}"
        if max_count == 1:
            if history_index == 1:
                # 首板老2,判断前面的老大是否是属于不能买的范畴
                pre_code = history_before_codes_info[0][0]
                # pre_code不能买,才能买
                if RedicalBuyDataManager.can_buy(pre_code, DealAndDelegateWithBuyModeDataManager().get_deal_codes())[0]:
                    return False, f"前排代码可买:{pre_code}"
                # 距离前一个是否在10分钟内
                if tool.trade_time_sub(tool.timestamp_format(limit_up_timestamp, '%H:%M:%S'),
                                       tool.timestamp_format(history_before_codes_info[-1][1], '%H:%M:%S')) >= 10 * 60:
                    return False, f"距离上个不能买的代码涨停已过去10分钟({history_before_codes_info[0]})"
            else:
                # 距离上个代码涨停5分钟以内
                if tool.trade_time_sub(tool.timestamp_format(limit_up_timestamp, '%H:%M:%S'),
                                       tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 10 * 60:
                    return False, f"距离上个代码涨停已过去10分钟({current_before_codes_info[-1]})"
        else:
            if tool.trade_time_sub(tool.timestamp_format(limit_up_timestamp, '%H:%M:%S'),
                                   tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 10 * 60:
                return False, f"距离上个代码涨停已过去10分钟({current_before_codes_info[-1]})"
        return True, f"满足买入需求: 前排代码-{current_before_codes_info}"
    @classmethod
    def __is_re_limit_up(cls, code, block):
        """
        是否是炸板回封可买
        @param code:
        @param block:
        @return:
        """
        # 获取身位
        current_index, current_before_codes_info = cls.__get_current_index(code, block, set(),
                                                                           limit_up_time=cls.__get_limit_up_timestamp(
                                                                               code))
        history_index, history_before_codes_info = cls.__get_history_index(code, block, set())
        if current_index != history_index:
            return False, f"有其他炸板"
        if current_index > 1:
            return False, f"不是前2的板块"
        history_codes = set()
        # 获取板块炸板情况
        for k in LimitUpDataConstant.history_limit_up_datas:
            _code = k[3]
            blocks = LimitUpDataConstant.get_blocks_with_history(_code)
            blocks = BlockMapManager().filter_blocks(blocks)
            # 不是这个板块
            if block in blocks:
                history_codes.add(_code)
        if len(history_codes) <= 4:
            return False, f"板块历史涨停小于4个:{history_codes}"
        # 获取当前涨停数量
        current_codes = set()
        for k in LimitUpDataConstant.current_limit_up_datas:
            _code = k[0]
            blocks = LimitUpDataConstant.get_blocks_with_history(_code)
            if not blocks:
                blocks = set()
            blocks = BlockMapManager().filter_blocks(blocks)
            # 不是这个板块
            if block in blocks:
                current_codes.add(_code)
        current_codes.add(code)
        diff = history_codes - current_codes
        if diff:
            return False, f"板块炸板不止当前票:{diff}"
        return True, ""
    @classmethod
    def __get_limit_up_timestamp(cls, code):
        """
        获取代码的涨停时间,默认当前时间
        @param code:
        @return:
        """
        limit_up_timestamp = LimitUpDataConstant.get_first_limit_up_time(code)
        if not limit_up_timestamp:
            limit_up_timestamp = time.time()
        return limit_up_timestamp
    @classmethod
    def get_code_kpl_blocks(cls, code):
        blocks = KPLCodeJXBlockManager().get_jx_blocks_radical(code)
        if blocks is None:
            blocks = set()
        # 将获取涨停原因与涨停推荐
        keys = TargetCodePlateKeyManager().get_plate_keys(code, contains_today=True)
        if keys and keys[0]:
            blocks |= set(keys[0])
        return blocks
    @classmethod
    def get_code_blocks(cls, code):
        """
        获取目标代码的板块
        @param code:
        @return: 过滤后的板块,过滤前的板块
        """
        blocks = cls.get_code_kpl_blocks(code)
        match_blocks, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks)
        match_blocks -= constant.KPL_INVALID_BLOCKS
        fblocks = match_blocks & RealTimeKplMarketData.get_top_market_jingxuan_blocks()
        if not fblocks:
            fblocks = set()
        match_blocks_3, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks, same_count=3)
        if match_blocks_3:
            match_blocks_3 -= constant.KPL_INVALID_BLOCKS
            fblocks |= match_blocks_3
        # 获取开盘啦历史涨停原因
        kpl_history_blocks = CodesHisReasonAndBlocksManager().get_history_blocks_cache(code)
        if kpl_history_blocks:
            fblocks |= BlockMapManager().filter_blocks(kpl_history_blocks)
        jx_out_blocks = RealTimeKplMarketData.get_top_market_jingxuan_out_blocks()
        if jx_out_blocks:
            fblocks -= jx_out_blocks
        return fblocks, match_blocks
    @classmethod
    def is_radical_buy(cls, code, yesterday_limit_up_codes):
@@ -1413,14 +1568,7 @@
            for c in open_limit_up_code_dict:
                open_limit_up_blocks |= open_limit_up_code_dict[c][1]
        # 获取代码的板块
        keys_ = KPLCodeJXBlockManager().get_jx_blocks_radical(code)
        if not keys_:
            return set(), "没获取到板块"
        keys_ = BlockMapManager().filter_blocks(keys_)
        if not keys_:
            return set(), "过滤后没获取到板块"
        # 获取交集
        keys_ = CodeThirdBlocksManager().get_intersection_blocks_info(code, keys_)
        keys_, info = cls.get_code_blocks(code)
        if not keys_:
            return set(), "没获取到板块交集"
@@ -1442,8 +1590,18 @@
                result = cls.__is_radical_buy_with_block_up(code, b, yesterday_limit_up_codes)
                if result[0]:
                    can_buy_blocks.add(b)
                msges.append(f"【{b}】:{result[1]}")
            fmsges.append("板块快速启动判断##" + ",".join(msges))
        if not can_buy_blocks:
            msges.clear()
            for b in keys_:
                result = cls.__is_re_limit_up(code, b)
                if result[0]:
                    can_buy_blocks.add(b)
                    msges.append(f"【{b}】:{result[1]}")
            fmsges.append("板块回封判断##" + ",".join(msges))
        return can_buy_blocks, " **** ".join(fmsges)