Administrator
2024-05-06 cbd003e5040e2a471f1e49410e5a116a25b71918
添加身位输出
1个文件已修改
31 ■■■■ 已修改文件
third_data/code_plate_key_manager.py 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/code_plate_key_manager.py
@@ -699,10 +699,10 @@
        if not block_codes:
            # 高位板泛化板块中无板块
            if not high_level_block_codes.get(block):
                return False, True, f"{block}:板块无涨停", False, False
                return False, True, f"{block}:板块无涨停", False, False, 0
        elif len(block_codes) == 1 and code in block_codes:
            if not high_level_block_codes.get(block):
                return False, True, f"{block}:板块只有当前代码涨停", False, False
                return False, True, f"{block}:板块只有当前代码涨停", False, False, 0
        # 可以买的最大排名
        # open_limit_up_codes = kpl_block_util.get_shsz_open_limit_up_codes(code, block, limit_up_record_datas,
        #                                                                   code_limit_up_reason_dict)
@@ -752,9 +752,9 @@
        is_active_buy = cls.__is_need_active_buy(code, block, current_shsz_rank, len(current_open_limit_up_codes))
        if current_shsz_rank < len(current_open_limit_up_codes) + max_rank:
            return True, False, f"【{block}】前排代码:{current_shsz_rank}", is_strong_block, is_active_buy
            return True, False, f"【{block}】前排代码:{current_shsz_rank}", is_strong_block, is_active_buy, current_shsz_rank
        else:
            return False, False, f"【{block}】前排代码:{front_current_shsz_rank_codes} 超过{len(current_open_limit_up_codes) + max_rank}个", is_strong_block, is_active_buy
            return False, False, f"【{block}】前排代码:{front_current_shsz_rank_codes} 超过{len(current_open_limit_up_codes) + max_rank}个", is_strong_block, is_active_buy, current_shsz_rank
    # 获取可以买的板块
    # current_limit_up_datas: 今日实时涨停
@@ -797,15 +797,15 @@
        code_limit_up_reasons_dict = {}
        load_code_block()
        for block in keys:
            can_buy, unique, msg, is_strong, is_active_buy = cls.__is_block_can_buy_new(code, block,
                                                                                        current_limit_up_datas,
                                                                                        code_limit_up_reasons_dict,
                                                                                        yesterday_current_limit_up_codes,
                                                                                        limit_up_record_datas,
                                                                                        current_limit_up_block_codes_dict,
                                                                                        high_level_code_blocks=high_level_general_code_blocks,
                                                                                        high_level_block_codes=high_level_general_block_codes)
            fresults.append((block, can_buy, unique, msg, is_strong, is_active_buy))
            can_buy, unique, msg, is_strong, is_active_buy, current_rank = cls.__is_block_can_buy_new(code, block,
                                                                                                      current_limit_up_datas,
                                                                                                      code_limit_up_reasons_dict,
                                                                                                      yesterday_current_limit_up_codes,
                                                                                                      limit_up_record_datas,
                                                                                                      current_limit_up_block_codes_dict,
                                                                                                      high_level_code_blocks=high_level_general_code_blocks,
                                                                                                      high_level_block_codes=high_level_general_block_codes)
            fresults.append((block, can_buy, unique, msg, is_strong, is_active_buy, current_rank))
        return fresults, keys
    # 是否可以下单
@@ -897,7 +897,10 @@
                if r[0] in trade_delegate_blocks_count and len(trade_delegate_blocks_count[r[0]]) >= MAX_DELEGATE_COUNT:
                    msg_list.append(f"【{r[0]}】已挂单:{trade_delegate_blocks_count[r[0]]}")
                    continue
                can_buy_blocks.append(r[0])
                if len(r)>6:
                    can_buy_blocks.append(f"{r[0]}-{r[6]}")
                else:
                    can_buy_blocks.append(f"{r[0]}")
                if r[4]:
                    can_buy_strong_blocks.append(r[0])
                if r[3]: