fix: zones监控盲区根治——trigger_json='{}'的版本化策略(76/112条)完全脱离止损/止盈/买入区监控,zones循环改用主层字段兜底构建(603920破止损36.57无告警根因;8/21版本化改造写入trigger_json='{}'所致)
This commit is contained in:
@@ -692,11 +692,22 @@ def run_once(round_label=""):
|
|||||||
|
|
||||||
for d in active:
|
for d in active:
|
||||||
code = d["code"]
|
code = d["code"]
|
||||||
trig = d.get("trigger", {})
|
trig = d.get("trigger", {}) or {}
|
||||||
if not trig:
|
|
||||||
continue
|
|
||||||
|
|
||||||
zones = get_trigger_zones(trig)
|
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:
|
if not zones:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user