From de34b0a96d71e6ab8eabe2e580c2b94de9065d08 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 31 八月 2023 17:00:14 +0800
Subject: [PATCH] 交易bug修改

---
 l2/l2_data_manager_new.py |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py
index 651ac0f..2551453 100644
--- a/l2/l2_data_manager_new.py
+++ b/l2/l2_data_manager_new.py
@@ -1021,7 +1021,7 @@
         # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "m鍊奸槇鍊艰绠�")
 
         # 涔板叆绾拱棰濈粺璁�
-        compute_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new = cls.__sum_buy_num_for_order_3(code,
+        new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new = cls.__sum_buy_num_for_order_3(code,
                                                                                                              start_process_index,
                                                                                                              compute_end_index,
                                                                                                              num, count,
@@ -1040,25 +1040,25 @@
                                     is_first_code, False)
             return
 
-        if compute_index is not None:
-            l2_log.debug(code, "鑾峰彇鍒颁拱鍏ユ墽琛屼綅缃細{} m鍊硷細{} 绾拱鎵嬫暟锛歿} 绾拱鍗曟暟锛歿} 鏁版嵁锛歿} ,閲忔瘮:{} ", compute_index, threshold_money,
+        if new_buy_exec_index is not None:
+            l2_log.debug(code, "鑾峰彇鍒颁拱鍏ユ墽琛屼綅缃細{} m鍊硷細{} 绾拱鎵嬫暟锛歿} 绾拱鍗曟暟锛歿} 鏁版嵁锛歿} ,閲忔瘮:{} ", new_buy_exec_index, threshold_money,
                          buy_nums,
-                         buy_count, total_datas[compute_index], cls.volume_rate_info[code])
-            cls.__save_order_begin_data(code, buy_single_index, compute_index, compute_index,
+                         buy_count, total_datas[new_buy_exec_index], cls.volume_rate_info[code])
+            cls.__save_order_begin_data(code, buy_single_index, new_buy_exec_index, new_buy_exec_index,
                                         buy_nums, buy_count, max_num_set_new,
                                         cls.volume_rate_info[code][0])
-            cls.__LimitUpTimeManager.save_limit_up_time(code, total_datas[compute_index]["val"]["time"])
+            cls.__LimitUpTimeManager.save_limit_up_time(code, total_datas[new_buy_exec_index]["val"]["time"])
             cls.__TradePointManager.delete_buy_cancel_point(code)
             l2_log.debug(code, "delete_buy_cancel_point")
             # 鐩存帴涓嬪崟
-            ordered = cls.__buy(code, capture_time, total_datas[compute_index], compute_index, is_first_code)
+            ordered = cls.__buy(code, capture_time, total_datas[new_buy_exec_index], new_buy_exec_index, is_first_code)
 
             # 鏁版嵁鏄惁澶勭悊瀹屾瘯
-            if compute_index < compute_end_index:
+            if new_buy_exec_index < compute_end_index:
                 if ordered:
-                    cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False)
+                    cls.__process_order(code, new_buy_exec_index + 1, compute_end_index, capture_time, is_first_code, False)
                 else:
-                    cls.__start_compute_buy(code, compute_index + 1, compute_end_index, threshold_money, capture_time,
+                    cls.__start_compute_buy(code, new_buy_exec_index + 1, compute_end_index, threshold_money, capture_time,
                                             is_first_code, False)
         else:
             # 鏈揪鍒颁笅鍗曟潯浠讹紝淇濆瓨绾拱棰濓紝璁剧疆绾拱棰�
@@ -1248,8 +1248,8 @@
                              buy_nums, threshold_num)
 
             max_buy_num_set_count = 0
-            for i in max_buy_num_set:
-                max_buy_num_set_count += total_datas[i]["re"]
+            for i1 in max_buy_num_set:
+                max_buy_num_set_count += total_datas[i1]["re"]
             # 鏈夋挙鍗曚俊鍙凤紝涓斿皬浜庨槇鍊�
             if buy_nums >= threshold_num and buy_count >= threshold_count and trigger_buy and max_buy_num_set_count >= big_num_count:
                 return i, buy_nums, buy_count, None, max_buy_num_set

--
Gitblit v1.8.0