refactor(auto): improve runtime reset structure and observing UI

This commit is contained in:
2026-07-02 21:59:22 +03:00
parent af276b1ce4
commit 954ca0e427
3 changed files with 81 additions and 104 deletions

View File

@@ -1535,8 +1535,16 @@ def _trade_word(value: int) -> str:
def _cycle_summary_lines(state) -> list[str]:
# Единый блок статистики текущего цикла.
# Показываем номер цикла всегда, даже если закрытых сделок ещё нет.
status = str(getattr(state, "status", "") or "").upper()
# В режиме наблюдения торгового цикла нет:
# бот только анализирует рынок и не исполняет сделки.
if status == "OBSERVING":
return ["🔬 Анализ рынка"]
if status != "RUNNING":
return []
cycle_trades = int(getattr(state, "cycle_closed_trades", 0) or 0)
cycle_pnl = float(getattr(state, "cycle_realized_pnl_usd", 0.0) or 0.0)