From 327f9d3e00df8e08a12c6d0f41911e448427d1fb Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 17 Aug 2026 15:39:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20RR=E8=A7=84=E8=8C=83=E8=90=BD=E5=9C=B0?= =?UTF-8?q?=E2=80=94=E2=80=94=E5=90=84scanner=E5=86=99candidates.rr(?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E7=AE=97RR),promote=E5=8F=AA=E5=8D=A1?= =?UTF-8?q?=E9=98=88=E5=80=BC=E4=B8=8D=E9=87=8D=E9=94=9A=E5=AE=9A(b=5Ftd1/?= =?UTF-8?q?p=5Foversold=E8=B1=81=E5=85=8D=E8=B6=85=E8=B7=8C=E9=97=A8?= =?UTF-8?q?=E6=A7=9B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/s2_scanner.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy/profile-scripts/s2_scanner.py b/deploy/profile-scripts/s2_scanner.py index a8da9d20..8e5b67df 100644 --- a/deploy/profile-scripts/s2_scanner.py +++ b/deploy/profile-scripts/s2_scanner.py @@ -227,15 +227,18 @@ def main(): (code,)).fetchone() if exists: continue + # RR 由策略算(老莫规范 2026-08-17):promote 只卡阈值不重锚定 + _mid_v = (entry_low + entry_high) / 2 + _rr_v = round((sig["target"] - _mid_v) / (_mid_v - sig["stop_loss"]), 2) if _mid_v > sig["stop_loss"] > 0 else 0 conn.execute( "INSERT INTO candidates (code, name, sector, reason, " - "entry_range, stop_loss, target, created_at) " - "VALUES (?,?,?,?,?,?,?,datetime('now','localtime')) " + "entry_range, stop_loss, target, rr, created_at) " + "VALUES (?,?,?,?,?,?,?,?,datetime('now','localtime')) " "ON CONFLICT(code) DO UPDATE SET " "name=excluded.name, sector=excluded.sector, reason=excluded.reason, " - "entry_range=excluded.entry_range, stop_loss=excluded.stop_loss, target=excluded.target", + "entry_range=excluded.entry_range, stop_loss=excluded.stop_loss, target=excluded.target, rr=excluded.rr", (code, name, "s2_panic", reasons, - f"{entry_low}~{entry_high}", sig["stop_loss"], sig["target"])) + f"{entry_low}~{entry_high}", sig["stop_loss"], sig["target"], _rr_v)) inserted += 1 print(f" 🟢 {code} {name} 价{price} bias60={sig['bias60']}% r5f={sig['r5f']}% dist_lo20={sig['dist_lo20']}%", flush=True) conn.commit()