From 03e872dba0c9073758eb128f405cf4d519aff256 Mon Sep 17 00:00:00 2001 From: xxm Date: Tue, 25 Aug 2026 09:54:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E9=80=89=E8=BF=9B=E5=87=BA?= =?UTF-8?q?=E8=81=8C=E8=B4=A3=E5=BD=92=E4=BD=8D=E2=80=94=E2=80=94promote?= =?UTF-8?q?=E6=92=A4=E5=AE=B9=E9=87=8F=E9=97=B8(=E4=B8=8D=E8=AE=BE?= =?UTF-8?q?=E4=B8=8A=E9=99=90=E4=B8=8D=E6=B7=98=E6=B1=B0,=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E5=8D=B3=E6=8F=90=E6=8B=94;=E5=8E=9F60=E7=A1=AC?= =?UTF-8?q?=E9=A1=B6+RR=E7=BD=AE=E6=8D=A2=E4=B8=8Eauto=5Fexit=E8=84=B1?= =?UTF-8?q?=E8=8A=82=E4=B8=94=E8=A2=AB=E5=A4=9A=E5=85=A5=E5=8F=A3=E7=BB=95?= =?UTF-8?q?=E8=BF=87=E5=A4=B1=E6=95=88),=E5=87=BA=E6=B8=85=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E6=9D=83=E5=A8=81=3Dauto=5Fexit(=E7=9B=98=E5=89=8D12?= =?UTF-8?q?=E7=BB=B4=E4=BF=A1=E5=8F=B7=E9=A9=B1=E5=8A=A8),auto=5Fexit?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=8A=A0=E6=B1=A0=E5=AD=90=E8=A7=84=E6=A8=A1?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF(=E8=80=81=E8=8E=AB=E7=9B=91=E5=AF=9F?= =?UTF-8?q?=E9=80=80=E5=87=BA=E6=9C=BA=E5=88=B6=E6=98=AF=E5=90=A6=E5=A5=8F?= =?UTF-8?q?=E6=95=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/promote_candidates.py | 24 +++---------------- deploy/profile-scripts/watchlist_auto_exit.py | 7 ++++-- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/deploy/profile-scripts/promote_candidates.py b/deploy/profile-scripts/promote_candidates.py index bbe97401..42daa66e 100644 --- a/deploy/profile-scripts/promote_candidates.py +++ b/deploy/profile-scripts/promote_candidates.py @@ -239,29 +239,11 @@ def main(): reason_text.append(f"评分{score}") action = " | ".join(reason_text) if reason_text else f"市场扫描发现(评分{score})" - # 容量闸:自选上限60只 - MAX_WATCH = 60 + # 2026-08-25 老莫:撤容量闸——不设上限、不淘汰(原60硬顶+RR置换与重评驱动的 + # auto_exit 退出机制重复且脱节,单点闸被多入口绕过已失效)。进管进、出管出: + # 出清唯一权威 = watchlist_auto_exit(盘前,12维信号驱动)。本脚本只负责合格即提拔。 wl_count = conn.execute( "SELECT COUNT(*) FROM holding_strategies WHERE status='active' AND decision_type='自选策略'").fetchone()[0] - if wl_count >= MAX_WATCH: - weakest = conn.execute(""" - SELECT code, name, COALESCE(rr_ratio,0) as rr FROM holding_strategies - WHERE status='active' AND decision_type='自选策略' - AND code != ? - ORDER BY COALESCE(rr_ratio,0) ASC, updated_at ASC LIMIT 1""", (code,)).fetchone() - if weakest and (weakest[2] or 0) < 1.0: - conn.execute( - "INSERT INTO watchlist_log (code, name, event, reason, old_signal, new_signal, price) " - "VALUES (?,?,?,?,?,?,?)", - (weakest[0], weakest[1] or "", "exit", f"容量{MAX_WATCH}淘汰为新标的{code}腾位", "", "已删除", 0)) - conn.execute( - "DELETE FROM holding_strategies WHERE code=? AND status='active' AND decision_type='自选策略'", - (weakest[0],)) - print(f" 🔴 容量淘汰: {weakest[0]} {weakest[1]} (RR={weakest[2]})", flush=True) - else: - print(f" ⏭ 自选已满{MAX_WATCH}且现有标的均RR>=2.0,{code}暂缓提拔", flush=True) - processed += 1 - continue cur = conn.execute(""" INSERT OR IGNORE INTO holding_strategies diff --git a/deploy/profile-scripts/watchlist_auto_exit.py b/deploy/profile-scripts/watchlist_auto_exit.py index 8e870887..51ac53c3 100644 --- a/deploy/profile-scripts/watchlist_auto_exit.py +++ b/deploy/profile-scripts/watchlist_auto_exit.py @@ -117,8 +117,11 @@ def main(dry_run=False): if not dry_run: conn.commit() - - print(f"\n结果: {len(exited)}只退出, {len(kept)}只保留") + + # 2026-08-25 老莫监察要求:输出池子规模趋势(观察退出机制是否奏效的核心指标) + _pool_now = conn.execute( + "SELECT COUNT(*) FROM holding_strategies WHERE status='active' AND decision_type='自选策略'").fetchone()[0] + print(f"\n结果: {len(exited)}只退出, {len(kept)}只保留 | 池子规模: {_pool_now + len(exited)}→{_pool_now}") # 生成退出摘要日志 if exited: