Administrator
2024-10-31 b855b811e3753ffcb35f145c985bb32f4b550038
third_data/code_plate_key_manager.py
@@ -378,7 +378,7 @@
        """
        blocks = set()
        for i in range(0, len(datas)):
            if i >= 10 and int(tool.get_now_time_str().replace(":","")) < int("100000"):
            if i >= 10 and int(tool.get_now_time_str().replace(":", "")) < int("100000"):
                # 10点前看前10,十点后不看前10
                break
            data = datas[i]
@@ -927,7 +927,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)
@@ -936,10 +937,6 @@
        fresults = []
        if not keys:
            return fresults, set()
        # 获取精选流出板块
        jx_out_blocks = RealTimeKplMarketData.get_top_market_jingxuan_out_blocks()
        if jx_out_blocks:
            keys -= jx_out_blocks
        code_limit_up_reasons_dict = {}
        load_code_block()
@@ -1206,6 +1203,10 @@
            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)
@@ -1261,6 +1262,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)
@@ -1447,12 +1453,12 @@
            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')) >= 5 * 60:
                    return False, f"距离上个代码涨停已过去5分钟({current_before_codes_info[-1]})"
                                       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')) >= 5 * 60:
                return False, f"距离上个代码涨停已过去5分钟({current_before_codes_info[-1]})"
                                   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}"
@@ -1547,7 +1553,7 @@
            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
            fblocks -= jx_out_blocks
        return fblocks, match_blocks