Administrator
2023-10-10 3da24bc5d5f4caa9c8f8a5284e11776c2d0a2cfa
bug修改
2个文件已修改
14 ■■■■ 已修改文件
l2/cancel_buy_strategy.py 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -1022,23 +1022,32 @@
    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, "尚未找到下单位置"
            return False, "尚未找到下单位置", ""
        time_space = tool.trade_time_sub(total_data[start_index]["val"]["time"],
                                         total_data[buy_exec_index]["val"]["time"])
        # 守护S撤以外的数据
        if time_space <= constant.L_CANCEL_START_TIME or int(tool.get_now_time_str().replace(":", "")) > int("145000"):
            return False, None
            return False, None, ""
        # 下单位临近撤
        can_cancel, cancel_data = False, None
        try:
        can_cancel, cancel_data = self.__compute_need_cancel(code, buy_exec_index, start_index, end_index, total_data,
                                                             is_first_code)
        except Exception as e:
            logger_l2_l_cancel.exception(e)
            raise e
        extra_msg = "L下"
        if not can_cancel:
            # 成交位临近撤
            try:
            can_cancel, cancel_data = self.__compute_near_by_trade_progress_need_cancel(code, buy_exec_index,
                                                                                        start_index, end_index,
                                                                                        total_data,
                                                                                        is_first_code)
            extra_msg = "L上"
            except Exception as e:
                logger_l2_l_cancel.exception(e)
                raise e
        return can_cancel, cancel_data, extra_msg
    def place_order_success(self, code):
l2/l2_data_manager_new.py
@@ -487,7 +487,6 @@
                                     f"L撤出错 参数:buy_single_index-{_buy_single_index} buy_exec_index-{_buy_exec_index} 错误原因:{str(e)}")
                logger_l2_error.exception(e)
                async_log_util.exception(logger_l2_error, e)
                raise e
            finally:
                # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "已下单-L撤大单计算")
                pass