From 30af2f297f4e412bac36c9678bb68ffb2f4c0709 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 17 六月 2024 15:01:27 +0800
Subject: [PATCH] 文件读取bug修复

---
 cancel_strategy/s_l_h_cancel_strategy.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cancel_strategy/s_l_h_cancel_strategy.py b/cancel_strategy/s_l_h_cancel_strategy.py
index 07d7703..3d15672 100644
--- a/cancel_strategy/s_l_h_cancel_strategy.py
+++ b/cancel_strategy/s_l_h_cancel_strategy.py
@@ -1252,12 +1252,18 @@
         # 璁$畻鐩戝惉鐨勬�绘潯鏁�
         total_num = 0
         max_num = 0
+        thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code,
+                                                                        total_data[buy_exec_index]["val"]["time"])
         # 杩欐槸涓嬪崟浣嶇疆涔嬪悗鐨勭储寮�: key涓哄瓧绗︿覆
         after_place_order_index_dict = self.__get_cancel_l_down_after_place_order_index_dict(code)
         if after_place_order_index_dict is None:
             after_place_order_index_dict = {}
         for wi in watch_indexes:
             if str(wi) in after_place_order_index_dict:
+                # 濡傛灉鍔犵孩灏遍渶瑕佽绠楀垎姣�
+                if must_buy:
+                    total_num += total_data[wi]["val"]["num"] * (
+                            10 - after_place_order_index_dict[str(wi)]) // 10
                 continue
             total_num += total_data[wi]["val"]["num"] * total_data[wi]["re"]
             if total_data[wi]["val"]["num"] > max_num:
@@ -1304,8 +1310,7 @@
                 #     return True, total_data[-1]
 
             rate = round(canceled_num / total_num, 3)
-            thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code,
-                                                                            total_data[buy_exec_index]["val"]["time"])
+
             # 闄ゅ紑鏈�澶у崟鐨勫奖鍝嶆潈閲�
             if not must_buy:
                 temp_thresh_hold_rate = round((total_num - max_num) * 0.9 / total_num, 2)

--
Gitblit v1.8.0