Administrator
2023-09-14 c9130a91ba50bf2bcdb08de1a2501560285ac706
third_data/code_plate_key_manager.py
@@ -425,7 +425,7 @@
        if trade_manager.CodesTradeStateManager().get_trade_state_cache(code) != trade_manager.TRADE_STATE_NOT_TRADE:
            # 只要下过单的就不移除
            return
        l2_trade_util.forbidden_trade(code)
        l2_trade_util.forbidden_trade(code, msg=msg)
        logger_kpl_block_can_buy.info(msg)
    @classmethod
@@ -534,8 +534,8 @@
    # 返回:是否可以下单,消息,板块类型
    @classmethod
    def can_buy(cls, code):
        # if constant.TEST:
        #     return True, cls.BLOCK_TYPE_NONE
        if constant.TEST:
            return True, cls.BLOCK_TYPE_NONE
        return cls.__can_buy_compute_result_dict.get(code)
    @classmethod
@@ -610,15 +610,18 @@
                                 before_blocks_dict):
        # 加载涨停代码的目标板块
        def load_code_block():
            for d in limit_up_record_datas:
                if d[2] in constant.KPL_INVALID_BLOCKS and d[3] in before_blocks_dict:
                    code_limit_up_reason_dict[d[3]] = list(before_blocks_dict.get(d[3]))[0]
                else:
                    code_limit_up_reason_dict[d[3]] = d[2]
            if limit_up_record_datas:
                for d in limit_up_record_datas:
                    if d[2] in constant.KPL_INVALID_BLOCKS and d[3] in before_blocks_dict:
                        code_limit_up_reason_dict[d[3]] = list(before_blocks_dict.get(d[3]))[0]
                    else:
                        code_limit_up_reason_dict[d[3]] = d[2]
            return code_limit_up_reason_dict
        if current_limit_up_datas is None:
            current_limit_up_datas = []
        if limit_up_record_datas is None:
            limit_up_record_datas = []
        code_limit_up_reason_dict = {}
        load_code_block()
        can_buy, msg = cls.__is_block_can_buy(code, block, current_limit_up_datas, code_limit_up_reason_dict,