From 844f556545df19e4058441b20cbe1bc6ad711db9 Mon Sep 17 00:00:00 2001 From: hmo Date: Mon, 27 Jul 2026 13:28:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B9=B0=E5=85=A5=E5=8C=BA=E9=97=B4?= =?UTF-8?q?=E4=B8=AD=E5=80=BC=E7=AA=81=E5=87=BA=E6=98=BE=E7=A4=BA(?= =?UTF-8?q?=E9=87=91=E8=89=B2=E5=8A=A0=E7=B2=97,=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E9=99=90=E4=B9=8B=E9=97=B4)=20+=20XMPP=E5=90=8C=E6=AD=A5=20+?= =?UTF-8?q?=20no-cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mofin_db.py | 4 ++-- static/index.html | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mofin_db.py b/mofin_db.py index 88f55098..677ef214 100644 --- a/mofin_db.py +++ b/mofin_db.py @@ -1557,7 +1557,7 @@ def flush_rec_digest(max_items=5): _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" 区{_el or '—'}~{_eh or '—'}(中{_mid})" + f" 区{_el or '—'}→{_mid}←{_eh or '—'}" f" 损{it.get('stop_loss') or '—'} 盈{it.get('take_profit') or '—'}" f" {_rr_txt} 仓位{it.get('position') or '—'}") if it.get('_stale_warn'): @@ -1615,7 +1615,7 @@ def push_recommend_alert(conn, code: str): 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}(中{_mid_xmpp}) 损{sl} 盈{tp} RR={rr or 0} 仓位{pos or '-'}") + f"区间{el}→{_mid_xmpp}←{eh} 损{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 f35d5eb8..d3ba001b 100644 --- a/static/index.html +++ b/static/index.html @@ -462,8 +462,8 @@ function renderWatchlist() { ${stocks.map(s => { const el = s.entry_low||0, eh = s.entry_high||0; - const mid = (el > 0 && eh > el) ? ('(中' + ((el+eh)/2).toFixed(2) + ')') : ''; - const buyZone = el + '~' + eh + mid; + const mid = (el > 0 && eh > el) ? (' ' + ((el+eh)/2).toFixed(2) + ' ') : '~'; + const buyZone = el + mid + eh; const rr = s.rr_ratio || 0; const sl = s.stop_loss || 0; const tp = s.take_profit || 0; @@ -745,7 +745,7 @@ async function openStock(code) {
${sd.timing_signal?`信号 ${sd.timing_signal}`:''} - ${sd.entry_low?`区间 ${sd.entry_low}~${sd.entry_high} 中值${((sd.entry_low+sd.entry_high)/2).toFixed(2)}`:''} + ${sd.entry_low?`区间 ${sd.entry_low} ${((sd.entry_low+sd.entry_high)/2).toFixed(2)} ${sd.entry_high}`:''} ${sd.stop_loss?`损 ${sd.stop_loss}`:''} ${sd.take_profit?`盈 ${sd.take_profit}`:''} RR ${rrTxt} @@ -1586,7 +1586,9 @@ async function renderWatch() { const shares = s.shares || 0; const posPct = s.position_pct || 0; - const buyZone = (el_ && eh_) ? el_.toFixed(2) + '~' + eh_.toFixed(2) + '(中' + ((el_+eh_)/2).toFixed(2) + ')' : '—'; + const buyZone = (el_ && eh_) + ? el_.toFixed(2) + ' ' + ((el_+eh_)/2).toFixed(2) + ' ' + eh_.toFixed(2) + : '—'; const sltp = (sl_ || tp_) ? '损' + (sl_||'—') + '/盈' + (tp_||'—') : '—'; const posDisplay = (isRec && s.suggested_position_pct) ? '建议' + s.suggested_position_pct + '%'