feat: stop_multiplier, dollar-based scoring, 365d бэктест

- stop_multiplier в strategy.py — расширение стопов (per-symbol в config)
- _quick_score переделан на dollar PnL с комиссиями (был R-based,
  скрывал убыточность при leverage cap)
- backtest_wf: 365d по умолчанию, stop_multiplier в grid
- config: BTC sm=2.5, ETH sm=1.0, SOL sm=3.0
- sweep_leverage.py, sweep_stop.py — утилиты для grid sweep

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-13 19:45:26 +10:00
co-authored by Claude Opus 4.6
parent 650ab61168
commit cc41bef00c
6 changed files with 277 additions and 11 deletions
+5 -2
View File
@@ -24,6 +24,7 @@ class Params:
session_end_h: int = 11 # stop entering after this hour (NY)
session_end_m: int = 0
first_fvg_only: bool = False # only trade the first FVG of the day
stop_multiplier: float = 1.0 # widen stop: 1.0 = candle low/high, 2.0 = 2x distance
@dataclass
@@ -173,8 +174,10 @@ def run_day(df_day: pd.DataFrame, p: Params | None = None,
continue
entry = float(c["close"])
stop = float(c["low"]) if fvg.direction == "bull" else float(c["high"])
risk = abs(entry - stop)
raw_stop = float(c["low"]) if fvg.direction == "bull" else float(c["high"])
raw_risk = abs(entry - raw_stop)
risk = raw_risk * p.stop_multiplier
stop = entry - risk if fvg.direction == "bull" else entry + risk
if risk <= 0:
continue
if p.min_risk_pct > 0 and mid > 0 and risk / mid < p.min_risk_pct / 100: