From e2380b23a5a945119396e16058a127073cdcef05 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 01 八月 2023 10:49:26 +0800 Subject: [PATCH] 获取环境接口 --- l2/l2_data_manager_new.py | 67 ++++++++++++++------------------- 1 files changed, 28 insertions(+), 39 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index ae4f558..7a20f5b 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -300,21 +300,8 @@ limit_up_time = limit_up_time_manager.get_limit_up_time(code) if limit_up_time is None: limit_up_time = tool.get_now_time_str() - score = None - if len(add_datas) < 10: - score = first_code_score_manager.get_score(code, volume_rate, limit_up_time, True) - else: - lp = LineProfiler() - lp.enable() - lp_wrap = lp(first_code_score_manager.get_score) - score = lp_wrap(code, volume_rate, limit_up_time, True) - output = io.StringIO() - lp.print_stats(stream=output) - lp.disable() - with open( - f"/home/logs/profile/{code}_get_score_{add_datas[0]['index']}_{add_datas[-1]['index']}.txt", - 'w') as f: - f.write(output.getvalue()) + score = first_code_score_manager.get_score(code, volume_rate, limit_up_time, True) + cls.__l2PlaceOrderParamsManagerDict[code] = l2_trade_factor.L2PlaceOrderParamsManager(code, is_first_code, volume_rate, volume_rate_index, @@ -335,20 +322,21 @@ end_index = len(total_datas) - 1 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: # 宸叉寕鍗� - if len(add_datas) < 10: + if True: #len(add_datas) < 10: cls.__process_order(code, start_index, end_index, capture_timestamp, is_first_code) else: - lp = LineProfiler() - lp.enable() - lp_wrap = lp(cls.__process_order) - lp_wrap(code, start_index, end_index, capture_timestamp, is_first_code) - output = io.StringIO() - lp.print_stats(stream=output) - lp.disable() - with open( - f"/home/logs/profile/{code}_process_order_{add_datas[0]['index']}_{add_datas[-1]['index']}.txt", - 'w') as f: - f.write(output.getvalue()) + pass + # lp = LineProfiler() + # lp.enable() + # lp_wrap = lp(cls.__process_order) + # lp_wrap(code, start_index, end_index, capture_timestamp, is_first_code) + # output = io.StringIO() + # lp.print_stats(stream=output) + # lp.disable() + # with open( + # f"/home/logs/profile/{code}_process_order_{add_datas[0]['index']}_{add_datas[-1]['index']}.txt", + # 'w') as f: + # f.write(output.getvalue()) else: # 鏈寕鍗�,鏃堕棿鐩稿樊涓嶅ぇ鎵嶈兘鎸傚崟 if l2.l2_data_util.L2DataUtil.is_same_time(now_time_str, latest_time): @@ -371,20 +359,21 @@ if round(t.time() * 1000) - __start_time > 10: __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time, "鑾峰彇m鍊兼暟鎹�楁椂") - if end_index - start_index < 10: + if True: #end_index - start_index < 10: cls.__start_compute_buy(code, start_index, end_index, threshold_money, capture_time, is_first_code) else: - lp = LineProfiler() - lp.enable() - lp_wrap = lp(cls.__start_compute_buy) - lp_wrap(code, start_index, end_index, threshold_money, capture_time, is_first_code) - output = io.StringIO() - lp.print_stats(stream=output) - lp.disable() - with open( - f"/home/logs/profile/{code}_start_compute_buy_{start_index}_{end_index}.txt", - 'w') as f: - f.write(output.getvalue()) + pass + # lp = LineProfiler() + # lp.enable() + # lp_wrap = lp(cls.__start_compute_buy) + # lp_wrap(code, start_index, end_index, threshold_money, capture_time, is_first_code) + # output = io.StringIO() + # lp.print_stats(stream=output) + # lp.disable() + # with open( + # f"/home/logs/profile/{code}_start_compute_buy_{start_index}_{end_index}.txt", + # 'w') as f: + # f.write(output.getvalue()) # 娴嬭瘯涓撶敤 @classmethod -- Gitblit v1.8.0