Administrator
2025-08-12 d1df4e77d2188ff3ad84b66fb2ba7f9bc738031d
l2/l2_transaction_data_processor.py
@@ -22,12 +22,12 @@
from log_module import async_log_util
from log_module.log import hx_logger_l2_debug, logger_l2_trade_buy_queue, logger_debug, hx_logger_l2_upload, \
    logger_trade, logger_l2_trade
from trade import current_price_process_manager, trade_constant
from trade import current_price_process_manager, trade_constant, trade_manager
import concurrent.futures
from trade.buy_radical import radical_buy_strategy
from trade.buy_radical.radical_buy_data_manager import RadicalBuyDataManager, EveryLimitupBigDealOrderManager
from utils import tool
from utils import tool, trade_util
class HuaXinTransactionDatasProcessor:
@@ -58,7 +58,7 @@
                if L2DataUtil.is_limit_up_price_buy(buyno_map[buy_no]["val"]):
                    buy_progress_index = buyno_map[buy_no]["index"]
                break
        if buy_progress_index is None and buy_exec_index is not None:
        if buy_progress_index is None and buy_exec_index is not None and buy_exec_index >= 0:
            # 没有找到真实成交进度位且有买入执行位置
            # 根据最近的成交买单号计算真实成交位置
            try:
@@ -288,12 +288,17 @@
            # if big_money_count > 0:
            #     LCancelRateManager.compute_big_num_deal_rate(code)
            buy_progress_index, is_similar = cls.__compute_latest_trade_progress(code, fdatas)
            trade_state = trade_manager.CodesTradeStateManager().get_trade_state_cache(code)
            # 计算成交进度
            buy_progress_index, is_similar = cls.__compute_latest_trade_progress(code, fdatas,
                                                                                 order_begin_pos.buy_exec_index if trade_util.is_delegated(
                                                                                     trade_state) else -1)
            if buy_progress_index is not None:
                buy_progress_index_changed = cls.__TradeBuyQueue.set_traded_index(code, buy_progress_index,
                                                                                  total_datas)
                l2_log.info(code, logger_l2_trade_buy_queue, "获取成交位置成功: code-{} index-{}", code, buy_progress_index)
                l2_log.info(code, logger_l2_trade_buy_queue, "获取成交位置成功: code-{} index-{} is_similar-{}", code,
                            buy_progress_index, is_similar)
                if is_placed_order:
                    # NewGCancelBigNumComputer().set_trade_progress(code, order_begin_pos.buy_single_index,
                    #                                               buy_progress_index)
@@ -375,9 +380,11 @@
                L2TradeDataProcessor.cancel_buy(code, cancel_msg, cancel_type=cancel_type)
            # 统计涨停主动卖成交,为了F撤准备数据
            HuaXinSellOrderStatisticManager.statistic_active_sell_deal_volume(code, fdatas, limit_up_price)
            trade_state = trade_manager.CodesTradeStateManager().get_trade_state_cache(code)
            # 计算成交进度
            _buy_progress_index, _is_similar = cls.__compute_latest_trade_progress(code, fdatas,
                                                                                   order_begin_pos.buy_exec_index)
                                                                                   order_begin_pos.buy_exec_index if trade_util.is_delegated(
                                                                                       trade_state) else -1)
            if _buy_progress_index is not None:
                total_datas = l2_data_util.local_today_datas.get(code)
                buy_progress_index_changed = cls.__TradeBuyQueue.set_traded_index(code, _buy_progress_index,
@@ -456,7 +463,11 @@
                # 如果是被动买就更新成交进度
                if not fdatas[-1][1]:
                    buy_progress_index, is_similar = cls.__compute_latest_trade_progress(code, fdatas)
                    trade_state = trade_manager.CodesTradeStateManager().get_trade_state_cache(code)
                    # 计算成交进度
                    buy_progress_index, is_similar = cls.__compute_latest_trade_progress(code, fdatas,
                                                                                         order_begin_pos.buy_exec_index if trade_util.is_delegated(
                                                                                             trade_state) else -1)
                    if buy_progress_index is not None:
                        total_datas = l2_data_util.local_today_datas.get(code)
                        cls.__TradeBuyQueue.set_traded_index(code, buy_progress_index,