Administrator
2024-10-11 c131be702b0583d3374f15e61885457ff391e0d7
third_data/code_plate_key_manager.py
@@ -14,6 +14,7 @@
from settings.trade_setting import MarketSituationManager
from third_data.kpl_data_constant import LimitUpDataConstant
from third_data.third_blocks_manager import BlockMapManager, CodeThirdBlocksManager
from trade.order_statistic import DealAndDelegateWithBuyModeDataManager
from trade.radical_buy_data_manager import RedicalBuyDataManager
from utils import global_util, tool, buy_condition_util
from log_module import log, async_log_util
@@ -1299,7 +1300,7 @@
            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}"
@@ -1348,7 +1349,7 @@
        # 不计算前2的代码
        exclude_codes = set()
        for x in current_before_codes:
        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个
@@ -1370,7 +1371,7 @@
            # 首板老2,判断前面的老大是否是属于不能买的范畴
            pre_code = history_before_codes_info[0][0]
            # pre_code不能买,才能买
            if RedicalBuyDataManager.can_buy(pre_code)[0]:
            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'),
@@ -1444,8 +1445,12 @@
        match_blocks -= constant.KPL_INVALID_BLOCKS
        fblocks = match_blocks & RealTimeKplMarketData.get_top_market_jingxuan_blocks()
        if not fblocks:
            fblocks, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks, same_count=3)
            fblocks -= constant.KPL_INVALID_BLOCKS
            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
        return fblocks, match_blocks
    @classmethod