feat: stop_scale=0.5, отключение time_exit, safety stop на бирже

- config: stop_scale (множитель стоп-дистанции), time_exit (вкл/выкл),
  safety_stop_pct (защитный стоп на бирже от flash crash)
- executor: применение stop_scale, условный time_exit, размещение и
  отмена safety stop при открытии/закрытии live позиции
- spot: place_safety_stop() и cancel_order() для Bybit
- state: миграция safety_stop_order_id в positions

Бэктест exp16e: stop_scale=0.5 + no time_exit → Sharpe 4.15 (vs 2.45),
DD 5.0% (vs 8.4%), +$13.20/мес (vs $4.15) — все 7 активов прибыльные.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-10 02:15:55 +10:00
co-authored by Claude Opus 4.6
parent 59496ac316
commit acdcdba9d0
5 changed files with 87 additions and 8 deletions
+3
View File
@@ -42,6 +42,9 @@ class RiskConfig:
max_position_pct: float = 0.50
max_open_positions: int = 2
leverage: int = 1 # 1 = no leverage, 2-10 = spot margin
stop_scale: float = 1.0 # multiplier on ATR stop distance (0.5 = tighter)
time_exit: bool = True # close after shift-K bars; False = hold until stop
safety_stop_pct: float = 0.10 # exchange hard stop: 10% below entry
@dataclass