From 69cd0478af7e16704edda3ab1c65876eaf98056f Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 24 Aug 2026 14:23:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20zones=E7=9B=91=E6=8E=A7=E7=9B=B2?= =?UTF-8?q?=E5=8C=BA=E6=A0=B9=E6=B2=BB=E2=80=94=E2=80=94trigger=5Fjson=3D'?= =?UTF-8?q?{}'=E7=9A=84=E7=89=88=E6=9C=AC=E5=8C=96=E7=AD=96=E7=95=A5(76/11?= =?UTF-8?q?2=E6=9D=A1)=E5=AE=8C=E5=85=A8=E8=84=B1=E7=A6=BB=E6=AD=A2?= =?UTF-8?q?=E6=8D=9F/=E6=AD=A2=E7=9B=88/=E4=B9=B0=E5=85=A5=E5=8C=BA?= =?UTF-8?q?=E7=9B=91=E6=8E=A7,zones=E5=BE=AA=E7=8E=AF=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E4=B8=BB=E5=B1=82=E5=AD=97=E6=AE=B5=E5=85=9C=E5=BA=95=E6=9E=84?= =?UTF-8?q?=E5=BB=BA(603920=E7=A0=B4=E6=AD=A2=E6=8D=9F36.57=E6=97=A0?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=A0=B9=E5=9B=A0;8/21=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8C=96=E6=94=B9=E9=80=A0=E5=86=99=E5=85=A5trigger=5Fjson=3D'?= =?UTF-8?q?{}'=E6=89=80=E8=87=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/price_monitor.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/deploy/profile-scripts/price_monitor.py b/deploy/profile-scripts/price_monitor.py index 5383fbef..3e019e4d 100644 --- a/deploy/profile-scripts/price_monitor.py +++ b/deploy/profile-scripts/price_monitor.py @@ -692,11 +692,22 @@ def run_once(round_label=""): for d in active: code = d["code"] - trig = d.get("trigger", {}) - if not trig: - continue + trig = d.get("trigger", {}) or {} zones = get_trigger_zones(trig) + # ── 2026-08-24 监控盲区根治:trigger_json 为空的版本化策略(76/112!), + # 用主层字段构建基础 zones(stop_loss/entry_zone/take_profit_zone)。 + # 否则这些股票完全脱离止损/止盈/买入区监控(603920 破止损无告警事件的根因)。 + try: + if d.get("stop_loss") and not any(z[0] == "stop_loss" for z in zones): + zones.append(("stop_loss", "止损", 0, float(d["stop_loss"]))) + if d.get("entry_low") and d.get("entry_high") and not any(z[0] == "entry_zone" for z in zones): + zones.append(("entry_zone", "买入区", float(d["entry_low"]), float(d["entry_high"]))) + if d.get("take_profit") and not any(z[0] == "take_profit_zone" for z in zones): + _tp = float(d["take_profit"]) + zones.append(("take_profit_zone", "止盈区间", _tp * 0.995, _tp * 100)) + except Exception: + pass if not zones: continue