From 7534d2cb9570836c2308b75314ba57c8eabc1261 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 20 三月 2025 16:37:22 +0800 Subject: [PATCH] 增加L撤比例API输出 --- cancel_strategy/s_l_h_cancel_strategy.py | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cancel_strategy/s_l_h_cancel_strategy.py b/cancel_strategy/s_l_h_cancel_strategy.py index ef9ed41..225ffa9 100644 --- a/cancel_strategy/s_l_h_cancel_strategy.py +++ b/cancel_strategy/s_l_h_cancel_strategy.py @@ -567,7 +567,7 @@ # 鑾峰彇鎾ゅ崟姣斾緥,杩斿洖锛堟挙鍗曟瘮渚�,鏄惁蹇呬拱锛� @classmethod - def get_cancel_rate(cls, code, buy_exec_time, is_up=False, is_l_down_recomputed=False, buy_mode=None): + def get_cancel_rate(cls, code, is_up=False, is_l_down_recomputed=False, buy_mode=None): try: must_buy = cls.__MustBuyCodesManager.is_in_cache(code) if buy_mode == OrderBeginPosInfo.MODE_RADICAL: @@ -1479,8 +1479,7 @@ # 璁$畻鐩戝惉鐨勬�绘潯鏁� total_num = 0 max_num = 0 - thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code, - total_data[buy_exec_index]["val"]["time"]) + thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code) for wi in watch_indexes: if str(wi) in after_place_order_index_dict: @@ -1618,9 +1617,7 @@ else: canceled_count_weight += WATCH_INDEX_WEIGHTS[-1] rate = round(canceled_count_weight / total_count_weight, 3) - thresh_cancel_rate, must_buy = LCancelRateManager.get_cancel_rate(code, - total_data[buy_exec_index]["val"]["time"], - is_up=True) + thresh_cancel_rate, must_buy = LCancelRateManager.get_cancel_rate(code, is_up=True) l2_log.l_cancel_debug(code, f"璁$畻鑼冨洿锛歿start_index}-{end_index},L鍓嶅凡鎾ゅ崟姣斾緥锛歿rate}/{thresh_cancel_rate}") if rate >= thresh_cancel_rate: # 璁$畻鎴愪氦杩涘害浣嶇疆鍒板綋鍓嶄笅鍗曚綅缃殑绾拱棰� @@ -1773,8 +1770,7 @@ total_nums += val["num"] if left_count > 0 and index < trade_index: total_deal_nums += val["num"] - thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code, - total_datas[buy_exec_index]["val"]["time"]) + thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code) if total_deal_nums / total_nums > 1 - thresh_hold_rate - 0.05: return False return True -- Gitblit v1.8.0