From bea977458173f2e60971bad2d6f1e3183070c5ca Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 21 十月 2024 10:21:56 +0800 Subject: [PATCH] bug修改 --- cancel_strategy/s_l_h_cancel_strategy.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cancel_strategy/s_l_h_cancel_strategy.py b/cancel_strategy/s_l_h_cancel_strategy.py index e3d10d9..fc73cd5 100644 --- a/cancel_strategy/s_l_h_cancel_strategy.py +++ b/cancel_strategy/s_l_h_cancel_strategy.py @@ -16,7 +16,7 @@ from utils import tool from l2.transaction_progress import TradeBuyQueue -from trade import l2_trade_factor, trade_record_log_util +from trade import l2_trade_factor, trade_record_log_util, trade_constant from l2 import l2_log, l2_data_source_util from l2.l2_data_util import L2DataUtil, local_today_datas, local_today_canceled_buyno_map, local_today_buyno_map from log_module.log import logger_l2_s_cancel, logger_debug, logger_l2_l_cancel, logger_l2_h_cancel @@ -1648,20 +1648,22 @@ def need_cancel(self, code, buy_exec_index, start_index, end_index, total_data, is_first_code): if buy_exec_index is None: - return False, None, "灏氭湭鎵惧埌涓嬪崟浣嶇疆" + return False, None, "灏氭湭鎵惧埌涓嬪崟浣嶇疆", None # 瀹堟姢S鎾や互澶栫殑鏁版嵁 if int(tool.get_now_time_str().replace(":", "")) > int("145700") and not constant.TEST: - return False, None, "" + return False, None, "", None try: LCancelOutOfDateWatchIndexesManager().process(code, start_index, end_index) except Exception as e: l2_log.l_cancel_debug("L鍚庣ǔ瀹氭洿鏂板嚭閿欙細{}", str(e)) # 涓嬪崟浣嶄复杩戞挙 - can_cancel, cancel_data = False, None + can_cancel, cancel_data, cancel_type = False, None, None try: can_cancel, cancel_data = self.__compute_need_cancel(code, buy_exec_index, start_index, end_index, total_data, is_first_code) + if can_cancel: + cancel_type = trade_constant.CANCEL_TYPE_L_DOWN except Exception as e: logger_l2_l_cancel.exception(e) raise e @@ -1673,6 +1675,8 @@ start_index, end_index, total_data, is_first_code) + if can_cancel: + cancel_type = trade_constant.CANCEL_TYPE_L_UP extra_msg = "L鍓�" except Exception as e: logger_l2_l_cancel.exception(e) @@ -1692,7 +1696,7 @@ except Exception as e: l2_log.l_cancel_debug(code, "L鍚庡悗鍗婃璁$畻鍑洪敊锛歿}", str(e)) - return can_cancel, cancel_data, extra_msg + return can_cancel, cancel_data, extra_msg, cancel_type def place_order_success(self, code): self.clear(code) -- Gitblit v1.8.0