From 15887c4d6719c1e85693da82fe75fa7bde718b3c Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 17 Aug 2026 16:06:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20promote=E6=8F=90=E6=8B=94rr=5Fratio?= =?UTF-8?q?=E7=94=A8=E5=80=99=E9=80=89=5Frr(=E5=8E=9F=E7=A1=AC=E7=BC=96?= =?UTF-8?q?=E7=A0=810=E8=87=B4=E6=96=B0=E6=8F=90=E6=8B=94=E8=A2=AB?= =?UTF-8?q?=E5=BD=93weakest=E7=A7=92=E6=B7=98=E6=B1=B0)+=E5=AE=B9=E9=87=8F?= =?UTF-8?q?=E6=B7=98=E6=B1=B0=E6=8E=92=E9=99=A4=E6=96=B0=E6=8F=90=E6=8B=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/promote_candidates.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy/profile-scripts/promote_candidates.py b/deploy/profile-scripts/promote_candidates.py index 99c7ce91..47f67f57 100644 --- a/deploy/profile-scripts/promote_candidates.py +++ b/deploy/profile-scripts/promote_candidates.py @@ -160,7 +160,8 @@ def main(): weakest = conn.execute(""" SELECT code, name, COALESCE(rr_ratio,0) as rr FROM holding_strategies WHERE status='active' AND decision_type='自选策略' - ORDER BY COALESCE(rr_ratio,0) ASC, updated_at ASC LIMIT 1""").fetchone() + AND code != ? + ORDER BY COALESCE(rr_ratio,0) ASC, updated_at ASC LIMIT 1""", (code,)).fetchone() if weakest and (weakest[2] or 0) < 2.0: conn.execute( "INSERT INTO watchlist_log (code, name, event, reason, old_signal, new_signal, price) " @@ -182,8 +183,8 @@ def main(): rr_ratio, stock_category, created_at, updated_at, sector_context, quality_check) VALUES (?,?,?,?,?,?,?,?,?,'自选策略','scan', - 'active',0,'关注',?,?,'', 'pending') - """, (code, name, 0, el, eh, sl, tp, timing_signal, action, now, now)) + 'active',?,'关注',?,?,'', 'pending') + """, (code, name, 0, el, eh, sl, tp, timing_signal, action, _rr, now, now)) newly_added = cur.rowcount > 0 conn.execute("UPDATE candidates SET promoted=1 WHERE code=?", (code,))