From 1f77f5771397e7d4a0e135bb3afcd92a5d3821e0 Mon Sep 17 00:00:00 2001 From: hmo Date: Tue, 11 Aug 2026 13:04:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20promote=5Fcandidates=E5=8A=A0p=5Foversol?= =?UTF-8?q?d=20RR=E4=BE=8B=E5=A4=96=E2=80=94=E2=80=94=E8=B6=85=E8=B7=8C?= =?UTF-8?q?=E5=8F=8D=E5=BC=B9=E5=80=99=E9=80=89=E8=B7=B3=E8=BF=87RR>=3D2.0?= =?UTF-8?q?=E9=97=A8=E6=A7=9B(=E7=94=A8=E4=B8=93=E5=B1=9E=E8=AF=84?= =?UTF-8?q?=E4=BC=B0=E6=9B=BF=E4=BB=A3),SELECT=E5=8A=A0sector=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/promote_candidates.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/profile-scripts/promote_candidates.py b/deploy/profile-scripts/promote_candidates.py index 96fa6b35..e648accb 100644 --- a/deploy/profile-scripts/promote_candidates.py +++ b/deploy/profile-scripts/promote_candidates.py @@ -35,7 +35,7 @@ def main(): # 读未提拔候选(按评分降序) rows = conn.execute(""" - SELECT c.code, c.name, c.score_final, c.entry_range, c.stop_loss, c.target + SELECT c.code, c.name, c.score_final, c.entry_range, c.stop_loss, c.target, c.sector FROM candidates c WHERE (c.promoted IS NULL OR c.promoted = 0) AND (c.dropped IS NULL OR c.dropped = 0) @@ -57,6 +57,8 @@ def main(): break # 已有"在自选"的候选(上次已插但被标记或重复)快速跳过,不计入 new 配额 code = str(r[0]) + # 2026-08-11:读取候选 sector(用于 p_oversold RR 例外) + cand_sector = str(r[6] or "").strip() if len(r) > 6 else "" exists = conn.execute( "SELECT id FROM holding_strategies WHERE code=? AND status='active'", (code,) @@ -127,7 +129,9 @@ def main(): if el > 0 and eh > el and sl > 0 and tp > 0: _mid = (el + eh) / 2 _rr = (tp - _mid) / (_mid - sl) if (_mid - sl) > 0 else 0 - if _rr < 2.0: + # 2026-08-11:p_oversold(预测超跌反弹)候选跳过 RR>=2.0 门槛—— + # 超跌反弹候选 RR 天然 <2(支撑近/压力远),用专属评估替代(部署计划 §8.3 方案C) + if _rr < 2.0 and cand_sector != "p_oversold": print(f" ⏭ {code} {name} RR={_rr:.2f}<2.0,不入自选") processed += 1 continue