fix: читаемые скипы в cycle report — группировка по причине
Пропущены: ETH BTC DOGE (cooldown) · XRP (фильтр) · DOT (нет сигнала) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -660,26 +660,32 @@ def format_cycle_report(logs: list[str]) -> str:
|
||||
for ticker, body in alerts:
|
||||
lines.append(f"\n\u26a0\ufe0f <b>{_escape_html(ticker)}</b> {_escape_html(body)}")
|
||||
|
||||
# --- Skips: compact, one line ---
|
||||
# --- Skips: grouped by reason ---
|
||||
if skips:
|
||||
lines.append("")
|
||||
skip_tickers = []
|
||||
groups: dict[str, list[str]] = {}
|
||||
for ticker, body in skips:
|
||||
reason = ""
|
||||
if "cooldown" in body:
|
||||
reason = "cd"
|
||||
reason = "cooldown"
|
||||
elif "correlated" in body:
|
||||
reason = "corr"
|
||||
reason = "\u0444\u0438\u043b\u044c\u0442\u0440"
|
||||
elif "corr=" in body or "corr<" in body:
|
||||
reason = "\u2212"
|
||||
reason = "\u043d\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430"
|
||||
elif "max" in body:
|
||||
reason = "max"
|
||||
reason = "\u043b\u0438\u043c\u0438\u0442"
|
||||
elif "SHORT" in body:
|
||||
reason = "short"
|
||||
elif "not enough" in body:
|
||||
reason = "\u043d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445"
|
||||
else:
|
||||
reason = "skip"
|
||||
skip_tickers.append(f"{ticker}\u2009{reason}")
|
||||
sep = " \u00b7 "
|
||||
lines.append(f"<i>{sep.join(skip_tickers)}</i>")
|
||||
short_ticker = ticker.replace("-USD", "")
|
||||
groups.setdefault(reason, []).append(short_ticker)
|
||||
parts = []
|
||||
for reason, tickers in groups.items():
|
||||
sep = " "
|
||||
parts.append(f"{sep.join(tickers)} ({reason})")
|
||||
dot = " \u00b7 "
|
||||
lines.append(f"<i>\u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u044b: {dot.join(parts)}</i>")
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
Reference in New Issue
Block a user