From 8382cbe98cab50d8bbea9d43779e1c632548fe04 Mon Sep 17 00:00:00 2001 From: admin <admin@example.com> Date: 星期二, 17 六月 2025 13:39:32 +0800 Subject: [PATCH] 禁止买入板块管理/增加外部接口 --- strategy/buying_strategy.py | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/strategy/buying_strategy.py b/strategy/buying_strategy.py index 991e972..bc6be39 100644 --- a/strategy/buying_strategy.py +++ b/strategy/buying_strategy.py @@ -429,6 +429,7 @@ data_cache.bought_plate.extend(limit_up_plate_included_list) logger_info( f"銆恵k_line_data[0]['sec_name']}銆戜氦鏄撴垚鍔燂紒鎸佷粨闆嗗悎锛歿data_cache.position_symbols_set}") + # 浼犵粰GUI鏄剧ず purchased_stock_details = { "name": k_line_data[0]['sec_name'], "policy_name": "鏈夋蹇垫湁寮哄害绛栫暐鍒嗘敮", @@ -548,11 +549,23 @@ data_cache.bought_plate.extend(limit_up_plate_included_list) logger_info( f"銆恵k_line_data[0]['sec_name']}銆戜氦鏄撴垚鍔燂紒鎸佷粨闆嗗悎锛歿data_cache.position_symbols_set}") + # 浼犵粰GUI鏄剧ず + purchased_stock_details = { + "name": k_line_data[0]['sec_name'], + "policy_name": "鏈夋蹇垫棤寮哄害绛栫暐鍒嗘敮", + "plate_name": limit_up_plate_included, + "buy_time_trading_volume_ratio": ( + current_volume / k_line_data[0]['volume']), + } + data_cache.purchased_stocks_details_list.append(purchased_stock_details) + logger_info( + f"宸叉垚浜よ偂绁ㄨ鎯呭垪琛細{data_cache.purchased_stocks_details_list} ") ''' 鏃犳蹇� 鏈夊己搴﹁鐣� ''' - if len(limit_up_plate_included) == 0: - # logger_info(f"銆愭棤姒傚康銆�") + if len(limit_up_plate_included) == 0 or limit_up_plate_included.issubset( + check_plate_list) is True: + # logger_info(f"銆愭棤姒傚康 鎴� 姒傚康鍦ㄥ睆钄芥蹇电粍涓��") if strength_list_have_it is True: logger_info( f"銆恵k_line_data[0]['sec_name']}銆�--------------------------------------------------------------------------------------------------------[鏈夊己搴﹁鐣宂") @@ -661,6 +674,18 @@ data_cache.bought_plate.extend(strength_plate) logger_info( f"銆恵k_line_data[0]['sec_name']}銆戜氦鏄撴垚鍔燂紒鎸佷粨闆嗗悎锛歿data_cache.position_symbols_set}") + # 浼犵粰GUI鏄剧ず + purchased_stock_details = { + "name": k_line_data[0]['sec_name'], + "policy_name": "鏃犳蹇垫湁寮哄害绛栫暐鍒嗘敮", + "plate_name": strength_plate, + "buy_time_trading_volume_ratio": ( + current_volume / k_line_data[0]['volume']), + } + data_cache.purchased_stocks_details_list.append( + purchased_stock_details) + logger_info( + f"宸叉垚浜よ偂绁ㄨ鎯呭垪琛細{data_cache.purchased_stocks_details_list} ") ''' 鏃犳蹇垫棤寮哄害 鏈夊皬閲忔崲澶ф定骞呭害瑙嗙晫 ''' -- Gitblit v1.8.0