From 16db33c161f5dbbb423f2d84199b3f7723e9b2ad Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 17 八月 2023 19:46:17 +0800
Subject: [PATCH] bug修改

---
 l2/l2_data_manager_new.py |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py
index 1411634..47ed202 100644
--- a/l2/l2_data_manager_new.py
+++ b/l2/l2_data_manager_new.py
@@ -584,7 +584,7 @@
             if need_clear_data:
                 trade_result_manager.real_cancel_success(code, buy_single_index, buy_exec_index,
                                                          local_today_datas.get(code))
-            return
+            return False
         else:
             l2_log.debug(code, "鍙互涓嬪崟锛屽師鍥狅細{}", reason)
 
@@ -607,7 +607,9 @@
                 l2_log.debug(code, "鎵ц涔板叆寮傚父:{}", str(e))
                 pass
             finally:
-                l2_log.debug(code, "m鍊煎奖鍝嶅洜瀛愶細{}", l2_trade_factor.L2TradeFactorUtil.factors_to_string(code))
+                # l2_log.debug(code, "m鍊煎奖鍝嶅洜瀛愶細{}", l2_trade_factor.L2TradeFactorUtil.factors_to_string(code))
+                pass
+            return True
 
     # 鏄惁鍙互鍙栨秷
     @classmethod
@@ -880,21 +882,21 @@
             # with open(f"{constant.get_path_prefix()}/logs/profile/{code}_can_buy_first.txt", 'w') as f:
             #     f.write(output.getvalue())
             # return results
-            return cls.can_buy_first(code, limit_up_price, score_index, score, score_info, cls.volume_rate_info[code])
+            return cls.can_buy_first(code, limit_up_price)
 
         else:
             return True, False, "鍦ㄦ兂涔板悕鍗曚腑"
 
     @classmethod
-    def can_buy_first(cls, code, limit_up_price, score_index, score, score_info, volume_rate_info):
-        def is_has_k_format(score_info):
-            # (15涓氦鏄撴棩娑ㄥ箙鏄惁澶т簬24.9%,鏄惁鐮村墠楂橈紝鏄惁瓒呰穼锛屾槸鍚︽帴杩戝墠楂橈紝鏄惁N,鏄惁V,鏄惁鏈夊舰鎬�,澶╅噺澶ч槼淇℃伅,鏄惁鍏锋湁杈ㄨ瘑搴�)
-
-            if score_info[1][3][6][0] and not score_info[1][3][3][0]:
-                return True
-            if score_info[1][3][7][0]:
-                return True
-            return False
+    def can_buy_first(cls, code, limit_up_price):
+        # def is_has_k_format(score_info):
+        #     # (15涓氦鏄撴棩娑ㄥ箙鏄惁澶т簬24.9%,鏄惁鐮村墠楂橈紝鏄惁瓒呰穼锛屾槸鍚︽帴杩戝墠楂橈紝鏄惁N,鏄惁V,鏄惁鏈夊舰鎬�,澶╅噺澶ч槼淇℃伅,鏄惁鍏锋湁杈ㄨ瘑搴�)
+        #
+        #     if score_info[1][3][6][0] and not score_info[1][3][3][0]:
+        #         return True
+        #     if score_info[1][3][7][0]:
+        #         return True
+        #     return False
 
         if float(limit_up_price) >= constant.MAX_CODE_PRICE:
             return False, True, f"鑲′环澶т簬{constant.MAX_CODE_PRICE}鍧�"
@@ -1074,11 +1076,15 @@
             cls.__TradePointManager.delete_buy_cancel_point(code)
             l2_log.debug(code, "delete_buy_cancel_point")
             # 鐩存帴涓嬪崟
-            cls.__buy(code, capture_time, total_datas[compute_index], compute_index, is_first_code)
+            ordered = cls.__buy(code, capture_time, total_datas[compute_index], compute_index, is_first_code)
 
             # 鏁版嵁鏄惁澶勭悊瀹屾瘯
             if compute_index < compute_end_index:
-                cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False)
+                if ordered:
+                    cls.__process_order(code, compute_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,
+                                            is_first_code)
         else:
             # 鏈揪鍒颁笅鍗曟潯浠讹紝淇濆瓨绾拱棰濓紝璁剧疆绾拱棰�
             # 璁板綍涔板叆淇″彿浣嶇疆

--
Gitblit v1.8.0