Administrator
2025-02-26 77874e3405bedfcbbef2ebc9649197b27de649a7
订阅修改/买入均线条件修改/每次上板大单修改
5个文件已修改
89 ■■■■ 已修改文件
l2/l2_data_manager_new.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
servers/data_server.py 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/history_k_data_util.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/buy_radical/radical_buy_data_manager.py 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/current_price_process_manager.py 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -822,11 +822,11 @@
        average_rate = cls.__Buy1PriceManager.get_average_rate(code)
        if average_rate:
            if tool.is_ge_code(code):
                if average_rate <= 0.1:
                    return False, True, f"均价涨幅({average_rate})小于10%", True
                if average_rate < 0.8:
                    return False, True, f"均价涨幅({average_rate})小于8%", True
            else:
                if average_rate <= 0.05:
                    return False, True, f"均价涨幅({average_rate})小于5%", True
                if average_rate < 0.04:
                    return False, True, f"均价涨幅({average_rate})小于4%", True
        return True, False, f"", False
    @classmethod
servers/data_server.py
@@ -928,7 +928,10 @@
                            th_temp_buy_info = BeforeSubDealBigOrderManager().get_temp_deal_big_order_threshold_info(
                                code)
                            th_buy, th_buy_default = BeforeSubDealBigOrderManager().get_big_order_threshold(code)
                            th_sell = BeforeSubDealBigOrderManager().get_big_sell_order_threshold(code)
                            try:
                                th_sell = BeforeSubDealBigOrderManager().get_big_sell_order_threshold(code)
                            except:
                                th_sell = 0
                            deal_big_money_info = radical_buy_data_manager.get_total_deal_big_order_info(
                                code, gpcode_manager.get_limit_up_price_as_num(code))
                            big_money_rate = radical_buy_data_manager.TotalDealBigOrderInfoManager.get_big_order_rate(
@@ -937,10 +940,10 @@
                                big_money_rate = 0
                            # 大单成交信息
                            deal_big_order_info = [
                                (output_util.money_desc(th_temp_buy_info[0] if th_temp_buy_info else 0), # 临时买大单阈值
                                 output_util.money_desc(th_buy), # 买大单阈值
                                 output_util.money_desc(th_sell), # 卖单阈值
                                 big_money_rate*100 # 大单成交比
                                (output_util.money_desc(th_temp_buy_info[0] if th_temp_buy_info else 0),  # 临时买大单阈值
                                 output_util.money_desc(th_buy),  # 买大单阈值
                                 output_util.money_desc(th_sell),  # 卖单阈值
                                 big_money_rate * 100  # 大单成交比
                                 ),
                                output_util.money_desc(deal_big_money_info[1]),
                                output_util.money_desc(deal_big_money_info[2])]
@@ -959,7 +962,7 @@
                        except Exception as e:
                            logger_debug.error(f"可能没有获取到涨停价:{code}")
                            logger_debug.exception(e)
                            # logger_debug.exception(e)
                            deal_big_order_info = None
                        code_name = gpcode_manager.get_code_name(code)
                        fresults.append((code, code_name, deal_big_order_info, deal_big_order_detail_info))
third_data/history_k_data_util.py
@@ -252,7 +252,10 @@
        if constant.is_windows():
            return JueJinApi.get_previous_trading_date(date)
        else:
            return hx_qc_value_util.get_previous_trading_date(date)
            try:
                return hx_qc_value_util.get_previous_trading_date(date)
            except:
                return JueJinApi.get_previous_trading_date(date)
    @classmethod
    def get_previous_trading_date_cache(cls, date):
trade/buy_radical/radical_buy_data_manager.py
@@ -1615,9 +1615,12 @@
    if not is_first_limit_up_buy(code):
        # 如果是回封下单阈值就采用均大单
        THRESHOLD_MONEY, is_temp_threshold_money = BeforeSubDealBigOrderManager().get_big_order_threshold_info(code)
        if THRESHOLD_MONEY < 600e4 and current_threshold_count < 3:
            # 均大单金额≤600万,则就需要加倍大单数
            current_threshold_count *= 2
        current_threshold_money = current_threshold_count * THRESHOLD_MONEY
    else:
        current_threshold_money = current_threshold_count * 2990000
        THRESHOLD_MONEY = 2990000
        if is_almost_open_limit_up:
            THRESHOLD_MONEY, is_default = BeforeSubDealBigOrderManager().get_big_order_threshold(code)
            if is_default:
@@ -1625,7 +1628,10 @@
                temp_info = BeforeSubDealBigOrderManager().get_temp_deal_big_order_threshold_info(code)
                if temp_info:
                    THRESHOLD_MONEY = temp_info[0]
            current_threshold_money = current_threshold_count * THRESHOLD_MONEY
        if THRESHOLD_MONEY < 600e4 and current_threshold_count < 3:
            # 均大单金额≤600万,则就需要加倍大单数
            current_threshold_count *= 2
        current_threshold_money = current_threshold_count * THRESHOLD_MONEY
    # ==========判断总大单成交================
    total_lack_money_info = get_total_deal_big_order_info(code, limit_up_price, is_for_buy=for_buy)
trade/current_price_process_manager.py
@@ -85,37 +85,30 @@
        # 涨停过的代码才会计算板块身位
        for b in blocks:
            index = None
            # 如果当前板块不能买则不订阅
            if not radical_buy_data_manager.is_can_buy_for_forbidden_plate(code, b, yesterday_limit_up_codes):
                continue
            if b in top_in_blocks:
                index = top_in_blocks.index(b)
            else:
                if RadicalBuyBlockManager.is_block_can_buy_with_block_in(code, b,
                                                                         yesterday_limit_up_codes=yesterday_limit_up_codes)[
                    0]:
                    index = 100
            if index is None:
                continue
            # 查询在板块中的排序
            info = RadicalBuyBlockManager().get_history_index(code, b, yesterday_limit_up_codes)
            if info[0] > 0:
                info = RadicalBuyBlockManager().filter_before_codes(code, b, info[0], info[1],
                                                                    yesterday_limit_up_codes)
            if info[0] < 3:
                return index + 1
            else:
                # 判断是否具有辨识度
                special_codes = BlockSpecialCodesManager().get_block_codes(b)
                if special_codes and code in special_codes:
            # 只订阅有辨识度的票和新板块前3
            special_codes = BlockSpecialCodesManager().get_block_codes(b)
            if special_codes and code in special_codes:
                # 有辨识度在净流入中则订阅
                if b in top_in_blocks:
                    index = top_in_blocks.index(b)
                    return index + 1
            else:
                # 没有辨识度,新板块订阅前3
                new_blocks = LimitUpCodesBlockRecordManager().get_new_blocks()
                if new_blocks and b in new_blocks:
                    info = RadicalBuyBlockManager().get_history_index(code, b, yesterday_limit_up_codes)
                    if info[0] > 0:
                        info = RadicalBuyBlockManager().filter_before_codes(code, b, info[0], info[1],
                                                                            yesterday_limit_up_codes)
                    if info[0] < 3:
                        if b in top_in_blocks:
                            index = top_in_blocks.index(b)
                            return index + 1
                        else:
                            return 200
    else:
        # 尚未涨停过的代码,订阅板块有辨识度的前6
        for b in blocks:
            # 如果当前板块不能买则不订阅
            if not radical_buy_data_manager.is_can_buy_for_forbidden_plate(code, b, yesterday_limit_up_codes):
                continue
            if b not in top_in_blocks:
                continue
            index = top_in_blocks.index(b)
@@ -158,8 +151,8 @@
                    # 创业板的涨幅需要打折
                    rate = rate / 2
                if order_index >= 0:
                    if order_index < 1000 and rate >= 5:
                        # 涨幅大于5%的才能订阅
                    if order_index < 1000 and rate >= 3:
                        # 涨幅大于3%的才能订阅
                        _code_list.append((rate, code, order_index))
                    else:
                        _delete_list.append((rate, code, 0))