07.4.4.1.1 — Market State Human UI + HOLD Lifecycle Fix

This commit is contained in:
2026-05-10 23:20:54 +03:00
parent 8024cd9d9a
commit ef7cec68cc
14 changed files with 1209 additions and 39 deletions

View File

@@ -162,6 +162,7 @@ def _build_waiting_text(state) -> str:
f"<b>Доступно</b> · $ {_format_money_compact(available)}",
"",
_signal_line(state),
_market_state_line(state),
*_signal_confidence_lines(state),
*_execution_block_lines(state),
"",
@@ -208,6 +209,7 @@ def _build_active_position_text(state) -> str:
f"<b>Доступно</b> · $ {_format_money_compact(available)}",
f"<b>Зарезервировано</b> · $ {_format_money_compact(reserved)}",
f"<b>P&L</b> {_format_signed_usd_with_direction(pnl)}",
_market_state_line(state),
*_execution_block_lines(state),
"",
(
@@ -235,6 +237,22 @@ def _build_active_position_text(state) -> str:
return "\n".join(parts)
def _market_state_line(state) -> str:
market_state = getattr(state, "market_state", None)
labels = {
"TREND_UP": "📈 Рынок · Рост",
"TREND_DOWN": "📉 Рынок · Падение",
"RANGE": "🟰 Рынок · Флэт",
"HIGH_VOLATILITY": "⚠️ Рынок · Волатильность",
"LOW_VOLATILITY": "🟰 Рынок · Спокойный",
"UNKNOWN": "⏳ Рынок · Анализ",
None: "⏳ Рынок · Анализ",
}
return labels.get(market_state, "⏳ Рынок · Анализ")
def _execution_block_lines(state) -> list[str]:
lines: list[str] = []