Stage 07.4.3.11 — Risk Settings UI & UX

This commit is contained in:
2026-05-05 19:14:51 +03:00
parent 163e8efe82
commit 3c3f0e846a
13 changed files with 967 additions and 12 deletions

View File

@@ -550,6 +550,9 @@ class AutoTradeRunner:
@classmethod
async def _refresh_screen(cls, *, force: bool = False) -> None:
if cls._current_screen != "auto":
return
now = time.monotonic()
if now < cls._retry_after_until:

View File

@@ -220,6 +220,24 @@ class AutoTradeService:
state = self.get_state()
state.leverage = leverage
return state
# установить stop loss в %
def set_stop_loss_percent(self, value: float | None) -> AutoTradeState:
state = self.get_state()
state.stop_loss_percent = value
return state
# установить take profit в %
def set_take_profit_percent(self, value: float | None) -> AutoTradeState:
state = self.get_state()
state.take_profit_percent = value
return state
# установить max loss в USD
def set_max_loss_usd(self, value: float | None) -> AutoTradeState:
state = self.get_state()
state.max_loss_usd = value
return state
# сбросить внутренний трекинг сигналов
def _reset_signal_tracking(self) -> None:

View File

@@ -68,15 +68,10 @@ class AutoTradeState:
leverage: float | None = 2.0
# stop loss по движению цены в %
#stop_loss_percent: float | None = 2.0
stop_loss_percent: float | None = None
# take profit по движению цены в %
#take_profit_percent: float | None = 3.0
take_profit_percent: float | None = None
# максимальный допустимый paper-убыток в USD
#max_loss_usd: float | None = None
# для демонстрации рисков: стоп-лосс и тейк-профит по риску в % от капитала
stop_loss_percent: float | None = None
take_profit_percent: float | None = None
max_loss_usd: float | None = 0.01
max_loss_usd: float | None = None