From 3c36073fa926e9fb2571baaac77012cb4a32ef3f Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 01 九月 2023 17:21:14 +0800 Subject: [PATCH] 真实下单位置校验 --- l2/l2_data_manager_new.py | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index f7c94b1..0bce149 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -286,6 +286,11 @@ if code in cls.unreal_buy_dict: cls.unreal_buy_dict.pop(code) + @classmethod + def set_real_place_order_index(cls, code, index): + cls.__DCancelBigNumComputer.set_real_order_index(code, index) + cls.__SecondCancelBigNumComputer.set_real_place_order_index(code, index) + # 澶勭悊鍗庨懌L2鏁版嵁 @classmethod def process_huaxin(cls, code, origin_datas): @@ -310,8 +315,7 @@ # 鑾峰彇涓嬪崟浣嶇疆 place_order_index = huaxin_delegate_postion_manager.get_l2_place_order_position(code, datas) if place_order_index: - cls.__DCancelBigNumComputer.set_real_order_index(code, place_order_index) - cls.__SecondCancelBigNumComputer.set_real_place_order_index(code, place_order_index) + cls.set_real_place_order_index(code, place_order_index) async_log_util.info(logger_l2_process, "code:{} 鑾峰彇鍒颁笅鍗曠湡瀹炰綅缃細{}", code, place_order_index) __start_time = round(t.time() * 1000) if len(datas) > 0: @@ -1022,12 +1026,13 @@ # 涔板叆绾拱棰濈粺璁� new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new = cls.__sum_buy_num_for_order_3(code, - start_process_index, - compute_end_index, - num, count, - threshold_money, - buy_single_index, - max_num_set) + start_process_index, + compute_end_index, + num, + count, + threshold_money, + buy_single_index, + max_num_set) # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "绾拱棰濈粺璁℃椂闂�") l2_log.debug(code, "m鍊�-{} 閲忔瘮:{} rebegin_buy_pos:{}", threshold_money, cls.volume_rate_info[code][0], @@ -1056,9 +1061,11 @@ # 鏁版嵁鏄惁澶勭悊瀹屾瘯 if new_buy_exec_index < compute_end_index: if ordered: - cls.__process_order(code, new_buy_exec_index + 1, compute_end_index, capture_time, is_first_code, False) + cls.__process_order(code, new_buy_exec_index + 1, compute_end_index, capture_time, is_first_code, + False) else: - cls.__start_compute_buy(code, new_buy_exec_index + 1, compute_end_index, threshold_money, capture_time, + cls.__start_compute_buy(code, new_buy_exec_index + 1, compute_end_index, threshold_money, + capture_time, is_first_code, False) else: # 鏈揪鍒颁笅鍗曟潯浠讹紝淇濆瓨绾拱棰濓紝璁剧疆绾拱棰� -- Gitblit v1.8.0