diff --git a/deploy/profile-scripts/per_stock_reassess.py b/deploy/profile-scripts/per_stock_reassess.py index 00b81181..e0ffbba7 100644 --- a/deploy/profile-scripts/per_stock_reassess.py +++ b/deploy/profile-scripts/per_stock_reassess.py @@ -306,6 +306,19 @@ def main(): if price > 0: print(f" 实时价: {price} (来自DB)") else: + # 2026-08-18 修复:三表无价时 stock_quote 直查(600262 案例:promote 后未进价格表→price=0→计算全崩) + try: + import subprocess, json as _jj2 + _rq = subprocess.run(["python3", "/home/hmo/.hermes/profiles/position-analyst/scripts/stock_quote.py", code_raw], + capture_output=True, text=True, timeout=10) + _qq = _jj2.loads(_rq.stdout) + _qprice = float(_qq.get("price", 0)) + if _qprice > 0: + price = _qprice + print(f" 实时价: {price} (stock_quote直查)") + except Exception as _qe: + print(f" stock_quote直查失败: {_qe}", file=sys.stderr) + if price <= 0: # fallback to DB portfolio data _pf_data = read_portfolio() for _h in _pf_data.get("holdings", []): diff --git a/deploy/profile-scripts/promote_candidates.py b/deploy/profile-scripts/promote_candidates.py index a704ae57..1deaaaef 100644 --- a/deploy/profile-scripts/promote_candidates.py +++ b/deploy/profile-scripts/promote_candidates.py @@ -248,7 +248,7 @@ def main(): sector_context, quality_check) VALUES (?,?,?,?,?,?,?,?,?,'自选策略','scan', 'active',?,'关注',?,?,?,'', 'pending') - """, (code, name, 0, el, eh, sl, tp, timing_signal, action, _rr, source_strategy, now, now)) + """, (code, name, _price, el, eh, sl, tp, timing_signal, action, _rr, source_strategy, now, now)) newly_added = cur.rowcount > 0 conn.execute("UPDATE candidates SET promoted=1 WHERE code=?", (code,))