Administrator
2023-09-18 70728b98fd8d0286155283009ccb6b9b1d0ec11f
交易日志同步
2个文件已修改
7 ■■■■■ 已修改文件
l2/l2_data_manager_new.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_server.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -330,6 +330,7 @@
            local_today_datas[code].extend(add_datas)
            l2.l2_data_util.load_num_operate_map(local_today_num_operate_map, code, add_datas)
            l2.l2_data_util.load_buy_no_map(local_today_buyno_map, code, add_datas)
            l2_data_log.l2_time_log(code, "process_add_datas 加载完数据")
            if constant.L2_SOURCE_TYPE == constant.L2_SOURCE_TYPE_HUAXIN:
                try:
                    # 获取下单位置
@@ -385,6 +386,7 @@
                state = cls.__CodesTradeStateManager.get_trade_state_cache(code)
                start_index = len(total_datas) - len(add_datas)
                end_index = len(total_datas) - 1
                l2_data_log.l2_time_log(code, "process_add_datas 开始处理")
                if state == trade_manager.TRADE_STATE_BUY_DELEGATED or state == trade_manager.TRADE_STATE_BUY_PLACE_ORDER or state == trade_manager.TRADE_STATE_BUY_SUCCESS:
                    # 已挂单
                    cls.__process_order(code, start_index, end_index, capture_timestamp, is_first_code)
@@ -1035,9 +1037,8 @@
            # 记录买入信号位置
            cls.__save_order_begin_data(code, buy_single_index, -1, compute_end_index, buy_nums, buy_count,
                                        max_num_set_new, None)
            print("保存大单时间", round((t.time() - _start_time) * 1000))
            _start_time = t.time()
        pass
        l2_data_log.l2_time_log(code, "__start_compute_buy 结束")
    # 获取下单起始信号
    @classmethod
trade/huaxin/trade_server.py
@@ -296,7 +296,7 @@
            async_log_util.info(logger_l2_process, "code:{} 处理数据数量: {} 最终处理时间:{}", code,
                                len(_datas),
                                round(time.time() * 1000) - now_timestamp)
            l2_data_log.l2_time_log(code, "处理L2逐笔委托结束")
            l2_data_log.l2_time_log(code, f"处理L2逐笔委托结束:处理数据数量: {len(_datas)} 最终处理时间:{round(time.time() * 1000) - now_timestamp}")
    @classmethod
    def l2_transaction(cls, code, datas):