From 6fbaa1012ca1b10689f7baad3a5e808ffc3c06b2 Mon Sep 17 00:00:00 2001
From: admin <admin@example.com>
Date: 星期五, 20 六月 2025 14:13:11 +0800
Subject: [PATCH] 1.精选流入09:25起开始进入数据 2.修复日志数据的None BUG 3.分离出手动拉黑后的决策日志和手动拉黑前的决策日志

---
 strategy/plate_strength_analysis.py |    4 ++--
 strategy/buying_strategy.py         |   26 +++++++++++++++-----------
 main.py                             |    2 ++
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/main.py b/main.py
index 2b2b589..5826774 100644
--- a/main.py
+++ b/main.py
@@ -113,6 +113,8 @@
     def get_market_sift_plate_its_stock_power_process(market_sift_plate_info):
         # print(f"鍥炶皟鎴愬姛===绮鹃�夋澘鍧楄偂绁ㄥ己搴︽暟鎹洿鏂�==={market_sift_plate_stock_dict}")
         # logger_kpl_jingxuan_in.info(f"{market_sift_plate_stock_dict}")
+        if market_sift_plate_info is not None:
+            return
         market_sift_plate_stock_dict,  market_sift_plates = market_sift_plate_info[0], market_sift_plate_info[1]
         if market_sift_plate_stock_dict:
             data_cache.market_sift_plate_stock_dict = market_sift_plate_stock_dict
diff --git a/strategy/buying_strategy.py b/strategy/buying_strategy.py
index a5230d6..26db12a 100644
--- a/strategy/buying_strategy.py
+++ b/strategy/buying_strategy.py
@@ -305,8 +305,7 @@
                                 '''
                                 鏈夋蹇佃鐣�
                                 '''
-                                if len(limit_up_plate_included) != 0 and limit_up_plate_included.issubset(
-                                        check_plate_list) is False:
+                                if len(limit_up_plate_included) != 0 and limit_up_plate_included.issubset(constant.check_plate_list) is False:
                                     logger_info(
                                         f"銆恵k_line_data[0]['sec_name']}銆�--------------------------------------------------------------------------------------------------------[鏈夋蹇佃鐣宂")
                                     logger_info(f"鍖呭惈娑ㄥ仠姒傚康锛歿limit_up_plate_included}")
@@ -416,11 +415,7 @@
                                             f"鏈�鏂颁环: {current_price}, 褰撴棩鏈�楂樹环锛歿current_high},鐬椂娑ㄥ箙: {tick_growth:.2f}%,鐬椂閲忓箙姣旓細{last_volume_to_growth_ratio:.2f}%,褰撴棩褰撴椂娑ㄥ箙锛歿today_growth}%锛屽叕鍙稿悕绉帮細{k_line_data[0]['sec_name']},褰撳墠鏃堕棿锛歿current_created_at},浣庝簬姘翠綅绾匡細{deep_low:.2f},浜ゆ槗閲忎粖鏃ヤ笌鏄ㄦ棩鐨勬瘮渚媨round(current_volume / k_line_data[0]['volume'], 2)}")
                                         logger_info(
                                             f"澶х洏缁煎悎寮哄害鍒嗘暟锛歿data_cache.real_time_market_strong}锛岀悊鎯充氦鏄撹鎯呭垎鏁�==={data_cache.ideal_trading_market_score}鍒嗭紝璁炬兂鐨勪笅鍗曢噾棰濓細{get_order_money()}")
-                                        # 璋冪敤涓嬪崟鏂规硶涓嬪崟
-                                        order_methods.buy_order_by_value(symbol,
-                                                                         get_order_money(),
-                                                                         k_line_data[0]['sec_name'],
-                                                                         current_price)
+
                                         # 浼犵粰GUI鏄剧ず
                                         purchased_stock_details = {
                                             "name": k_line_data[0]['sec_name'],
@@ -429,7 +424,18 @@
                                             "buy_time_trading_volume_ratio": (
                                                         current_volume / k_line_data[0]['volume']),
                                         }
+                                        # 濡傛灉涓偂鐨勬墍灞炴蹇垫澘鍧楀湪GUI鎵嬪姩娣诲姞鍚庣殑鎷夐粦鐗堝潡閲屽垯涓嶈烦鍑轰笉涓嬪崟
+                                        if limit_up_plate_included.issubset(check_plate_list) is True:
+                                            logger_info(
+                                                f"銆愪笉鍒┿�戞湁姒傚康鏉垮潡鍦℅UI鎵嬪姩娣诲姞鍚庣殑鎷夐粦鏉垮潡閲岋紒涓嶄拱浜嗭紒锛佸叕鍙稿悕绉帮細{k_line_data[0]['sec_name']}锛孏UI鎵嬪姩娣诲姞鍚庣殑鎷夐粦鏉垮潡=={check_plate_list}")
+                                            return
+                                        # 璋冪敤涓嬪崟鏂规硶涓嬪崟
+                                        order_methods.buy_order_by_value(symbol,
+                                                                         get_order_money(),
+                                                                         k_line_data[0]['sec_name'],
+                                                                         current_price)
                                         data_cache.purchased_stocks_details_list.append(purchased_stock_details)
+
                                         logger_info(f"宸叉垚浜よ偂绁ㄨ鎯呭垪琛細{data_cache.purchased_stocks_details_list} ")
                                         # 妫�娴嬫寔浠撲唬鐮侀泦鍚堜腑鏈夋棤涓嬪崟涓偂锛屾墠璁や负浜ゆ槗鎴愬姛
                                         if symbol_code not in data_cache.position_symbols_set:
@@ -795,8 +801,7 @@
                                 '''
                                 if k_line_data[0]['attribute'] in data_cache.limit_up_type:
                                     # logger_info(f"鏄ㄦ棩娑ㄥ仠")
-                                    if k_line_data[1]['attribute'] not in data_cache.limit_up_type and k_line_data[2][
-                                        'attribute'] not in data_cache.limit_up_type:
+                                    if k_line_data[1]['attribute'] not in data_cache.limit_up_type and k_line_data[2]['attribute'] not in data_cache.limit_up_type:
                                         # logger_info(f"鍓嶆棩澶у墠鏃ユ湭娑ㄥ仠")
                                         if today_open_growth > 1:
                                             logger_info(
@@ -806,8 +811,7 @@
                                             logger_info(f"鏄ㄦ棩棣栨澘娑ㄥ仠锛屽綋鏃ヤ腑绛変互涓婇珮寮� {today_open_growth}% 锛�")
                                             if limit_up_day > 6 and any(
                                                     'attribute' in d and d['attribute'] in data_cache.limit_up_type for
-                                                    d in k_line_data[1:3]) and current_volume <= k_line_data[0][
-                                                'volume'] * 1.5:
+                                                    d in k_line_data[1:3]) and current_volume <= k_line_data[0]['volume'] * 1.5:
                                                 logger_info(
                                                     f"銆愪笉鍒┿�戣繃浜庢樉钁楃エ 涓� 鍓嶆棩鎴栦笂鍓嶆棩娑ㄥ仠鏉� 褰撴棩閲忚繕涓嶈冻鏄ㄦ棩閲忕殑1.5鍊嶏紒涓嶄拱锛侊紒 浠婃棩褰撴椂鎴愪氦閲忎负鏄ㄦ棩绛夋瘮閲忕殑{round(current_volume / k_line_data[0]['volume'], 2)}鍊嶏紝90澶╁唴娑ㄥ仠澶╂暟锛歿limit_up_day}")
                                             elif len(TodayBuyCodeManager().get_buy_codes()) >= 3:
diff --git a/strategy/plate_strength_analysis.py b/strategy/plate_strength_analysis.py
index efe40f4..2adde12 100644
--- a/strategy/plate_strength_analysis.py
+++ b/strategy/plate_strength_analysis.py
@@ -84,10 +84,10 @@
     # print(f"market_sift_plate 鏁� ======{len(market_sift_plate['list'])}")
 
     # 绮鹃�夋澘鍧椼�愬墠20銆� market_sift_plate['list'] ======
-    if data_cache.OPENING_TIME < now_time < data_cache.AFTER_CLOSING_TIME:
+    if data_cache.OPEN_BIDDING_TIME < now_time < data_cache.AFTER_CLOSING_TIME:
         logger_kpl_market_sift_plate.info(f"{market_sift_plate['list']}")
     # 鎬绘帶鍒舵椂闂存
-    if not (data_cache.OPENING_TIME < now_time < data_cache.NOON_MARKET_TIME):
+    if not (data_cache.OPEN_BIDDING_TIME < now_time < data_cache.NOON_MARKET_TIME):
         return
     # ['801235', '鍖栧伐', 6996, 0.027, 2.43, 117836347690, -122548038, 8105997595, -8228545633, 0.92, 8595377775454, 0.09, 332297449, 9954902621130, -192457252, 24.0487, 17.1809, 6996, 0.027]
     # market_sift_plate['list'][0] = ['801062', '鍐涘伐', 3520, -0.49, 0.666, 139133934669, 383864272, 9077352839, -8693488567, 1.183, 6129448037490,-0.12, 168245858, 7088854452019, -290614763, 50.2408, 30.3672, 3520, 0]

--
Gitblit v1.8.0