From 084d7337165d6d17b77392054c984dbf9916169a Mon Sep 17 00:00:00 2001 From: admin <admin@example.com> Date: 星期四, 19 六月 2025 14:49:52 +0800 Subject: [PATCH] 1.已成交股票详情列表 添加逻辑提前 2.打印收盘涨停概念列表 --- strategy/basic_methods.py | 2 strategy/buying_strategy.py | 69 ++++++++++++++++++---------------- main.py | 3 + 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/main.py b/main.py index 962c9b1..2b2b589 100644 --- a/main.py +++ b/main.py @@ -92,8 +92,11 @@ # 寮�鐩樺暒鐨勬定鍋滄蹇电殑鍥炶皟鍑芥暟 def kpl_limit_up_process(datas): # print(f"鍥炶皟鎴愬姛==={datas}") + now_time = tool.get_now_time_str() if datas is not None and len(datas) > 0: data_cache.limit_up_block_names = datas + if data_cache.CLOSING_TIME < now_time < data_cache.AFTER_CLOSING_TIME: + logger_common.info(f"鏀剁洏娑ㄥ仠姒傚康鍒楄〃鏇存柊==={now_time}=={datas}") else: data_cache.limit_up_block_names = [] diff --git a/strategy/basic_methods.py b/strategy/basic_methods.py index 4bc00ff..2af7d7b 100644 --- a/strategy/basic_methods.py +++ b/strategy/basic_methods.py @@ -211,7 +211,7 @@ # 鍏呭垎浜ゆ槗閲忓叕寮� 鐢ㄤ簬璁$畻鏃ュ唴娑ㄥ箙娈电悊璁虹殑瀹夊叏浜ゆ槗閲忓�� def sufficient_volume(current_volume, yesterday_volume, today_growth): if today_growth > 0 and round(current_volume / yesterday_volume, 2) >= 0.01: - if current_volume > yesterday_volume * (today_growth/10) * 0.4: + if current_volume > yesterday_volume * (today_growth/10) * 0.5: return True else: return False diff --git a/strategy/buying_strategy.py b/strategy/buying_strategy.py index a52e947..8b30597 100644 --- a/strategy/buying_strategy.py +++ b/strategy/buying_strategy.py @@ -249,6 +249,7 @@ async_log_util.info(logger, f"鍗曚竴鏉垮潡鍐呯灛鏃舵媺鍗囨暟涓猴細{len(values)}锛屽垎鍒负===={values}") # 濡傛灉瀛愬垪琛ㄩ暱搴﹀ぇ浜�1涓旂浜屼釜鍏冪礌鍖呭惈 褰撳墠杩涘叆娑ㄥ箙瑙嗙晫鐨剆ymbol_code + # 鏈夊己搴﹁鐣� strength_list_have_it = True strength_plate = correlation_plate_list if stock_list[6] >= 1: @@ -420,6 +421,16 @@ get_order_money(), k_line_data[0]['sec_name'], current_price) + # 浼犵粰GUI鏄剧ず + purchased_stock_details = { + "name": k_line_data[0]['sec_name'], + "policy_name": "鏈夋蹇垫湁寮哄害绛栫暐鍒嗘敮", + "plate_name": list(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 symbol_code not in data_cache.position_symbols_set: logger_info( @@ -431,16 +442,6 @@ 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": list(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 strength_list_have_it is False: logger_info( @@ -540,6 +541,17 @@ f"************************************************銆愭湁姒傚康鏃犲己搴︽寚鏍囦笅鍗曘��************************************************") logger_info( 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)}") + # 浼犵粰GUI鏄剧ず + purchased_stock_details = { + "name": k_line_data[0]['sec_name'], + "policy_name": "鏈夋蹇垫棤寮哄害绛栫暐鍒嗘敮", + "plate_name": list(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 symbol_code not in data_cache.position_symbols_set: logger_info( @@ -551,17 +563,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": "鏈夋蹇垫棤寮哄害绛栫暐鍒嗘敮", - "plate_name": list(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} ") + ''' 鏃犳蹇� 鏈夊己搴﹁鐣� ''' @@ -665,6 +667,18 @@ get_order_money(), k_line_data[0]['sec_name'], current_price) + # 浼犵粰GUI鏄剧ず + purchased_stock_details = { + "name": k_line_data[0]['sec_name'], + "policy_name": "鏃犳蹇垫湁寮哄害绛栫暐鍒嗘敮", + "plate_name": list(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} ") # 妫�娴嬫寔浠撲唬鐮侀泦鍚堜腑鏈夋棤涓嬪崟涓偂锛屾墠璁や负浜ゆ槗鎴愬姛 if symbol_code not in data_cache.position_symbols_set: logger_info( @@ -676,18 +690,7 @@ 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": list(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