From be7fd23591e03d024baff417e7697085c9527bb4 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 01 九月 2023 14:48:44 +0800 Subject: [PATCH] 添加测试 --- l2/l2_data_manager_new.py | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index 2551453..f7c94b1 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -1164,6 +1164,8 @@ raise Exception("娑ㄥ仠浠锋棤娉曡幏鍙�") # 鐩爣鎵嬫暟 threshold_num = round(threshold_money / (limit_up_price * 100)) + # 澶х洰鏍囨墜鏁帮紙婊¤冻杩欎釜灏变笉闇�瑕佺湅瀹夊叏绗旀暟锛� + threshold_max_num = int(threshold_num * 1.2) # place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code) # 鐩爣璁㈠崟鏁伴噺 @@ -1184,7 +1186,7 @@ big_num_count = cls.__l2PlaceOrderParamsManagerDict[code].get_big_num_count() # 杈冨ぇ鍗曠殑鎵嬫暟 - bigger_num = round(5900 / limit_up_price) + bigger_num = round(5000 / limit_up_price) for i in range(compute_start_index, compute_end_index + 1): data = total_datas[i] @@ -1210,9 +1212,9 @@ # 鍙粺璁�59涓囦互涓婄殑閲戦 buy_nums += int(_val["num"]) * int(total_datas[i]["re"]) buy_count += int(total_datas[i]["re"]) - if buy_nums >= threshold_num and buy_count >= threshold_count: + if (buy_nums >= threshold_num and buy_count >= threshold_count) or buy_nums >= threshold_max_num: async_log_util.info(logger_l2_trade_buy, - f"{code}鑾峰彇鍒颁拱鍏ユ墽琛岀偣锛歿i} 缁熻绾拱鎵嬫暟锛歿buy_nums} 鐩爣绾拱鎵嬫暟锛歿threshold_num} 缁熻绾拱鍗曟暟锛歿buy_count} 鐩爣绾拱鍗曟暟锛歿threshold_count}, 澶у崟鏁伴噺锛歿len(max_buy_num_set)}") + f"{code}鑾峰彇鍒颁拱鍏ユ墽琛岀偣锛歿i} 缁熻绾拱鎵嬫暟锛歿buy_nums} 鐩爣绾拱鎵嬫暟锛歿threshold_num}/{threshold_max_num} 缁熻绾拱鍗曟暟锛歿buy_count} 鐩爣绾拱鍗曟暟锛歿threshold_count}, 澶у崟鏁伴噺锛歿len(max_buy_num_set)}") elif L2DataUtil.is_limit_up_price_buy_cancel(_val): if _val["num"] >= bigger_num: # 鍙粺璁�59涓囦互涓婄殑閲戦 -- Gitblit v1.8.0