From caf8a5a73bff64d10723f383c60985bc15536079 Mon Sep 17 00:00:00 2001 From: xxm Date: Tue, 18 Aug 2026 18:48:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sync=5Frecommend=5Ftag=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=87=8D=E7=AE=97=E8=A6=86=E7=9B=96scanner=E5=AE=9A=E7=9A=84RR?= =?UTF-8?q?(688081=E8=A2=ABrecompute=E4=BB=8E2.29=E6=94=B9=E6=88=901.51,?= =?UTF-8?q?=E8=BF=9D=E5=8F=8DRR=E7=94=B1scanner=E5=AE=9A=E5=8E=9F=E5=88=99?= =?UTF-8?q?)=E3=80=82RR=E7=BC=BA=E5=A4=B1(0)=E6=89=8D=E5=85=9C=E5=BA=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/mofin_db.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy/profile-scripts/mofin_db.py b/deploy/profile-scripts/mofin_db.py index d1f6a186..97621dd6 100644 --- a/deploy/profile-scripts/mofin_db.py +++ b/deploy/profile-scripts/mofin_db.py @@ -1380,7 +1380,11 @@ def sync_recommend_tag(conn, code: str, timing_signal: str): 动作级信号 → current_recommend;信号降级 → 清除 current_recommend; active_manual(人工标记)永不动。与 XMPP 动作级告警同源(红线#12)。""" try: - recompute_rr(conn, code) # 先入先算:保证 tag/入队/盯盘排序拿到新鲜 RR + # 2026-08-18 修复:RR 由 scanner 定(老莫原则),已有值不重算覆盖。 + # 原逻辑每次信号同步都 recompute_rr → 重评后参数漂移 → scanner 定的 RR(2.29) 被悄悄改成 1.51。 + _rr_have = conn.execute("SELECT rr_ratio FROM holding_strategies WHERE code=? AND status='active'", (code,)).fetchone() + if not (_rr_have and (_rr_have[0] or 0) > 0): + recompute_rr(conn, code) # 仅 RR 缺失(0)时兜底,保证 tag/入队/盯盘排序有值 _row = conn.execute( "SELECT tag, timing_signal FROM holding_strategies WHERE code=? AND status='active'", (code,)).fetchone() _old_tag = (_row[0] or '') if _row else ''