diff --git a/mofin_db.py b/mofin_db.py index 7ad43b2c..88f55098 100644 --- a/mofin_db.py +++ b/mofin_db.py @@ -1552,9 +1552,12 @@ def flush_rec_digest(max_items=5): _rr_txt = f"RR={_rr_mid}({_lo_val}~{_hi_val})" else: _rr_txt = f"RR={_rr_mid}" + _el = it.get('entry_low') or 0 + _eh = it.get('entry_high') or 0 + _mid = f"{(_el+_eh)/2:.2f}" if _el > 0 and _eh > _el else "—" _badge = "💰可执行" if it['code'] in _exec_codes else "⏳排队" lines.append(f"• {_badge} {it.get('name') or it['code']}({it['code']}) {it['signal']}" - f" 区{it.get('entry_low') or '—'}~{it.get('entry_high') or '—'}" + f" 区{_el or '—'}~{_eh or '—'}(中{_mid})" f" 损{it.get('stop_loss') or '—'} 盈{it.get('take_profit') or '—'}" f" {_rr_txt} 仓位{it.get('position') or '—'}") if it.get('_stale_warn'): @@ -1610,8 +1613,9 @@ def push_recommend_alert(conn, code: str): import sys as _s, os as _o _s.path.insert(0, _o.path.dirname(_o.path.abspath(__file__))) from alert_helper import notify, ACTION + _mid_xmpp = f"{(el+eh)/2:.2f}" if el > 0 and eh > el else "—" msg = (f"📈 {name or code}({code}) 价{price}→12维{sig}!" - f"区间{el}~{eh} 损{sl} 盈{tp} RR={rr or 0} 仓位{pos or '-'}") + f"区间{el}~{eh}(中{_mid_xmpp}) 损{sl} 盈{tp} RR={rr or 0} 仓位{pos or '-'}") return notify("买入信号", msg, ACTION) except Exception as e: print(f" [ALERT] {code} 推送异常: {e}", flush=True) diff --git a/static/index.html b/static/index.html index 4f0c647d..371ac9c1 100644 --- a/static/index.html +++ b/static/index.html @@ -461,7 +461,9 @@ function renderWatchlist() {