From 36f41a614b01928cfd6b64bdcf1a028dba16e75f Mon Sep 17 00:00:00 2001 From: admin <admin@example.com> Date: 星期二, 20 五月 2025 14:18:44 +0800 Subject: [PATCH] 1.首笔计划下单金额的逻辑梳理修改 2.L2板上盯卖的持仓检查代码格式修改 3. --- strategy/buying_strategy.py | 3 +++ strategy/selling_strategy.py | 12 ++++++------ strategy/market_sentiment_analysis.py | 15 +++------------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/strategy/buying_strategy.py b/strategy/buying_strategy.py index 9b23b3e..f879a8b 100644 --- a/strategy/buying_strategy.py +++ b/strategy/buying_strategy.py @@ -315,6 +315,9 @@ if strength_list_have_it is True: logger_info( f"銆愭湁姒傚康 鏈夊己搴︺�戝嚭鐜板湪鏉垮潡寮哄害澶т簬2鐨勫垪琛ㄤ腑 鐬椂閲忓箙姣旓細{round(last_volume_to_growth_ratio, 2)}%锛屽綋鏃ュ綋鏃舵定骞咃細{today_growth}%銆�") + # if tick_growth >= 0.8: + # logger_info( + # f"銆愭湁姒傚康 鏈夊己搴� 鏈夊己鎷夈�戠灛鏃舵定骞� > 0.8% 锛佺灛鏃舵定骞咃細{round(tick_growth, 2)}%") if last_volume_to_growth_ratio > 0.8 and ( free_market_value < 40 and current_price < 20): logger_info( diff --git a/strategy/market_sentiment_analysis.py b/strategy/market_sentiment_analysis.py index b113391..3351a56 100644 --- a/strategy/market_sentiment_analysis.py +++ b/strategy/market_sentiment_analysis.py @@ -768,23 +768,14 @@ # usefulMoney * 0.9 * low_emotion_mood_ratio / Unfinished_opening_plan_number) # 闄や互3搴旇鏄竴涓父閲忥紝濡傛灉浠nfinished_opening_plan_number锛屼細鍑虹幇float division by zero - # 濡傛灉浠婃棩璁″垝涓嬪崟鏁伴噺涓嶄负绌� 鎴� 璁″垝閲戦涓洪粯璁ゅ�硷紝閭d箞灏卞疄鏃惰绠楃涓�娆¤鍒掗噾棰濓紝骞跺浐瀹氳褰曚笅鏉� + # 濡傛灉浠婃棩璁″垝涓嬪崟鏁伴噺涓嶄负绌� 鎴� 璁″垝閲戦涓洪粯璁ゅ�硷紝閭d箞灏卞疄鏃惰绠楃璁″垝閲戦锛岃褰曚笅鏉� if not data_cache.today_planned_order_amount or data_cache.today_first_planned_order_amount <= 0: data_cache.today_planned_order_amount = usefulMoney * 0.95 * ideal_trading_market_score / 3 - logger.info(f"绗竴娆″疄鏃惰绠楄鍒掍笅鍗曢噾棰�==={data_cache.today_planned_order_amount}鍏�") + logger.info(f"瀹炴椂璁$畻璁″垝涓嬪崟閲戦==={data_cache.today_planned_order_amount}鍏�") - # 寮�浠撹鍒掕繍琛屾椂闂存 + # 璁$畻骞跺浐瀹氶娆′笅鍗曟椂鐨勮鍒掗噾棰濓紙鏈夊欢杩熻宸級 # # 濡傛灉涓�鏃ヤ笁浠撶殑璁″垝杩樻湭瀹屾垚 涓� 棣栨寮�浠撻噾棰濅负0 if Unfinished_opening_plan_number != 0 and data_cache.today_first_planned_order_amount <= 0: - # 濡傛灉GUI鐪嬬洏鎵嬪姩璁剧疆浜嗗叿浣撶殑涓嬪崟閲戦銆恉ata_cache.BUY_MONEY_PER_CODE 涓粯璁ゅ�间负-1锛屽彧鏈夊綋GUI鐪嬬洏鎵嬪姩璁剧疆浜嗗苟鎻愪氦鎵嶄細>=0銆戯紝灏辨寜鐓UI璁剧疆鐨勯噾棰濅笅鍗曘�傚惁鍒欏氨鎸夌収璇勫垎绛栫暐鐨勯噾棰濅笅鍗曪紝 - # if data_cache.BUY_MONEY_PER_CODE >= 0: - # data_cache.today_planned_order_amount = data_cache.BUY_MONEY_PER_CODE - # logger.info(f"閲囩敤GUI璁剧疆鏂瑰紡=銆嬩粖鏃ヨ鍒掍笅鍗曢噾棰�:{data_cache.today_planned_order_amount}") - # else: - # # 濡傛灉浠婃棩杩樻病鏈変竴涓柊澧炰粨浣嶏紝灏变笉鍋滆绠楁洿鏂拌鍒掗噾棰� - # if addition_position_number > 0: - # data_cache.today_planned_order_amount = data_cache.opening_strategy_results - # logger.info(f"閲囩敤寮�浠撶瓥鐣ヨ绠楁柟寮�=銆嬩粖鏃ヨ鍒掍笅鍗曢噾棰�:{data_cache.today_planned_order_amount}") if addition_position_number > 0: # 涓嬭繃涓�娆″崟杩囧悗鍐嶈绠楀姩鎬佷笅鍗曢噾棰� data_cache.today_first_planned_order_amount = float(data_cache.today_planned_order_amount) diff --git a/strategy/selling_strategy.py b/strategy/selling_strategy.py index 13daffd..a4ac020 100644 --- a/strategy/selling_strategy.py +++ b/strategy/selling_strategy.py @@ -556,12 +556,12 @@ # L2绾ф暟鎹Е鍙戠殑鏉夸笂鐩殑鐐告澘绛栫暐 def explosion_strategy(code): if code not in data_cache.available_symbols_set: - return + return "娌″湪鎸佷粨涓�" current_info = data_cache.current_l1_dict.get(code) if not current_info: - return + return "L1鏁版嵁涓嶅瓨鍦�" # symbol = symbol_code - symbol = basic_methods.format_stock_symbol(code) # 杞寲涓烘帢閲戞暟鎹潵婧愮殑鑲$エ浠g爜 + symbol = basic_methods.format_stock_symbol(code) # 杞寲涓烘帢閲戞暟鎹牸寮忕殑鑲$エ浠g爜 current_price = current_info[2] # 鑾峰彇褰撳墠鏈�鏂颁环 current_volume = current_info[3] # 褰撴棩褰撴椂鐨勬�绘垚浜ら噺 current_quotes_sell = current_info[6] # 鍗�5妗f暟鎹� @@ -573,10 +573,10 @@ index = i break if not position_info: - return + return "鏃犳寔浠撴暟鎹�" position_volume_yesterday = position_info['availablePosition'] # 鑲′唤鍙敤 (鍙敤鑲′唤鏁伴噺) # 鏄ㄦ棩鎸佷粨閲忥紙鍙敤鎸佷粨閲忥級 - # 璇ヨ偂鍔犲叆鍒版澘涓婄洴鍗栫殑闆嗗悎涓� 鎵�浠ヨ瀹氬崠鍑哄叏浠� - if symbol in data_cache.LIMIT_UP_SELL_CODES: + # 璇ヨ偂鍔犲叆鍒版澘涓婄洴鍗栫殑闆嗗悎涓� 鎵�浠ヨ瀹氬崠鍑哄叏浠� data_cache.LIMIT_UP_SELL_CODES 鏄崕閼牸寮忕殑浠g爜 + if code in data_cache.LIMIT_UP_SELL_CODES: logger_info(f"鏉夸笂鐩崠 |寮�鍚瘄 杩涘叆鍗栫エ鍐崇瓥") if current_volume < k_line_data[0]['volume'] * 0.6: logger_info( -- Gitblit v1.8.0