Administrator
3 天以前 256248e09fa5e44c18a2cd7b45b203d09aa4a3ee
l2/l2_transaction_data_processor.py
@@ -98,7 +98,7 @@
        统计大单成交
        @param code:
        @param fdatas: 格式:[(数据本身, 是否主动买, 是否涨停, 总成交额, 不含ms时间,含ms时间)]
        @return:
        @return: 大买单列表,大卖单列表
        """
        def statistic_big_buy_data():
@@ -167,6 +167,7 @@
        else:
            buy_datas = statistic_big_buy_data()
            sell_datas = statistic_big_sell_data()
        return buy_datas, sell_datas
        # L撤的比例与买卖大单无直接关系了
        # if buy_datas or sell_datas:
        #     buy_money = BigOrderDealManager().get_total_buy_money(code)
@@ -230,8 +231,9 @@
            _start_time = time.time()
            #  大单统计
            # cls.__statistic_thread_pool.submit(cls.statistic_big_order_infos, code, datas, order_begin_pos)
            big_sell_list = []
            try:
                cls.statistic_big_order_infos(code, fdatas, order_begin_pos)
                big_buy_list, big_sell_list = cls.statistic_big_order_infos(code, fdatas, order_begin_pos)
            except Exception as e:
                async_log_util.error(hx_logger_l2_debug, f"统计大单出错:{str(e)}")
            use_time_list.append(("统计大单数据", time.time() - _start_time))
@@ -254,17 +256,18 @@
                _start_time = time.time()
                if is_placed_order:
                    LCancelBigNumComputer().set_big_sell_order_info(code, big_sell_order_info)
                    # need_cancel, cancel_msg = SCancelBigNumComputer().set_big_sell_order_info_for_cancel(code,
                    #                                                                                      big_sell_order_info,
                    #                                                                                      order_begin_pos)
                    need_cancel, cancel_msg = False, ""
                    cancel_type = None
                    if need_cancel:
                        cancel_msg = f"S撤:{cancel_msg}"
                        cancel_type = trade_constant.CANCEL_TYPE_S
                    try:
                        can_cancel, cancel_data = LCancelBigNumComputer().add_big_sell_order_deal_list(code, big_sell_list)
                        if can_cancel:
                            need_cancel, cancel_msg = True, f"L后大卖单成交叠加触发撤单:{big_sell_list}"
                    except Exception as e:
                        async_log_util.error(logger_debug, f"L后大卖单成交叠加触发撤单:{str(e)}")
                    if not need_cancel:
                        need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code,
                                                                                            order_begin_pos)
@@ -373,7 +376,6 @@
            big_sell_order_info = HuaXinSellOrderStatisticManager.statistic_continue_limit_up_sell_transaction_datas(
                code, fdatas,
                limit_up_price)
            LCancelBigNumComputer().set_big_sell_order_info(code, big_sell_order_info)
            need_cancel, cancel_msg = False, ""
            cancel_type = None
            if not need_cancel:
@@ -496,4 +498,4 @@
    @classmethod
    def get_latest_transaction_data(cls, code):
        return cls.__latest_transaction_data_dict.get(code)
        return cls.__latest_transaction_data_dict.get(code)