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/buying_strategy.py | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) 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: -- Gitblit v1.8.0