From a1e55e8ca85f25a85dfce0bb51ae5299050512d7 Mon Sep 17 00:00:00 2001 From: xxm Date: Tue, 18 Aug 2026 15:11:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E8=AF=84=E5=B8=A6=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E7=AD=96=E7=95=A5=E2=80=94=E2=80=94collect=5Fdata?= =?UTF-8?q?=E8=AF=BBstrategy=5Fname,prompt=E9=A1=B6=E9=83=A8=E6=A0=87'?= =?UTF-8?q?=E6=8C=89=E6=AD=A4=E7=AD=96=E7=95=A5=E9=87=8D=E8=AF=84'(?= =?UTF-8?q?=E8=80=81=E8=8E=AB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index 34d0899e..8ea2f708 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -82,7 +82,7 @@ def collect_data(code): # 从DB读策略(含 full_analysis / changelog_json / position_advice) conn = sqlite3.connect(DB, timeout=30) - r = conn.execute("SELECT name, entry_low, entry_high, stop_loss, take_profit, timing_signal, action, rr_ratio, tech_snapshot, sector_context, stock_category, full_analysis, changelog_json, reassessed_at, position_advice FROM holding_strategies WHERE code=? AND status='active'", (code,)).fetchone() + r = conn.execute("SELECT name, entry_low, entry_high, stop_loss, take_profit, timing_signal, action, rr_ratio, tech_snapshot, sector_context, stock_category, full_analysis, changelog_json, reassessed_at, position_advice, strategy_name FROM holding_strategies WHERE code=? AND status='active'", (code,)).fetchone() if r: data["name"] = r[0] data["entry_low"] = r[1] or 0 @@ -98,6 +98,7 @@ def collect_data(code): data["full_analysis"] = r[11] or "" data["changelog_json"] = r[12] or "" data["reassessed_at"] = r[13] or "" + data["strategy_name"] = r[15] or "" # 2026-08-18 来源策略 data["position_advice"] = r[14] or "" # 持仓状态(2026-07-22 老爸要求:LLM 必须知道是否持有/成本/股数) hr = conn.execute("SELECT shares, cost, price FROM holdings WHERE code=? AND is_active=1 AND shares>0", (code,)).fetchone() @@ -318,7 +319,7 @@ def build_prompt(data): pass _position_context += _rotation_context - _orig_strategy_section = f"""当前策略参数: {_params_str} + _orig_strategy_section = f"""来源策略: {data.get("strategy_name") or "unknown"}(按此策略选股逻辑重评,可据最新情况调整参数)\n当前策略参数: {_params_str} 变更记录(最近3条): {_changelog_str}