From 364911b865bb4749b8fcd0583a4ba79922e92ee2 Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 17 Aug 2026 16:30:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E8=AF=84=E5=90=8C=E6=AD=A5trig?= =?UTF-8?q?ger=5Fjson(price=5Fmonitor=E9=98=88=E5=80=BC=E6=BA=90,=E5=B9=BF?= =?UTF-8?q?=E4=BF=A1=E6=95=99=E8=AE=AD)+RR=E6=B7=98=E6=B1=B0=E9=97=A8?= =?UTF-8?q?=E6=A7=9B1.5=E2=86=922.0(=E4=B8=8Epromote=E9=97=AD=E7=8E=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 17 +++++++++++++++++ deploy/profile-scripts/watchlist_auto_exit.py | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index 11291b10..9d02efcf 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -578,6 +578,23 @@ def save_result(code, full_text, parsed, ta_levels=None): updates.append("action=?") params.append(parsed["action_advice"]) + # ── 2026-08-17 同步 trigger_json:price_monitor 的监控阈值来源 ── + if updates: + _cur = conn.execute( + "SELECT stop_loss, take_profit, entry_low, entry_high FROM holding_strategies " + "WHERE code=? AND status='active'", (code,)).fetchone() + _sl = _tp = _el = _eh = 0 + if _cur: + _sl, _tp, _el, _eh = _cur + if "stop_loss=?" in updates: + _sl = params[updates.index("stop_loss=?")] + if "take_profit=?" in updates: + _tp = params[updates.index("take_profit=?")] + import json as _json + _trigger = {"stop_loss": _sl, "entry_zone": f"{_el}~{_eh}" if _el and _eh else "", + "take_profit_zone": f"0~{_tp}" if _tp else ""} + updates.append("trigger_json=?") + params.append(_json.dumps(_trigger, ensure_ascii=False)) params.append(code) sql = f"UPDATE holding_strategies SET {', '.join(updates)} WHERE code=? AND status='active'" conn.execute(sql, params) diff --git a/deploy/profile-scripts/watchlist_auto_exit.py b/deploy/profile-scripts/watchlist_auto_exit.py index 40e14dca..3c2c55cf 100644 --- a/deploy/profile-scripts/watchlist_auto_exit.py +++ b/deploy/profile-scripts/watchlist_auto_exit.py @@ -71,13 +71,13 @@ def main(dry_run=False): except Exception: pass - # 条件5: RR闸——RR<1.5 的平庸标的直接出(老爸:1.5边缘也是阿猫阿狗) + # 条件5: RR闸——RR<2.0 淘汰(2026-08-17 老莫:每日重评后低于2.0淘汰,与promote门槛2.0闭环) try: _rr = conn.execute( "SELECT rr_ratio FROM holding_strategies WHERE code=? AND status='active'", (code,)).fetchone() - if _rr and _rr[0] is not None and 0 < _rr[0] < 1.5: - reasons.append(f"RR={_rr[0]}<1.5") + if _rr and _rr[0] is not None and 0 < _rr[0] < 2.0: + reasons.append(f"RR={_rr[0]}<2.0") except Exception: pass