Skip to main content

Backtest Engine

b1e55ed includes a walk-forward backtesting engine for strategy validation.

Commands

Walk-forward

Runs a walk-forward test with FDR-corrected results. Outputs: Sharpe ratio, Sortino ratio, max drawdown, win rate per strategy/asset combination.

Grid sweep

Sweeps parameter combinations for a strategy. FDR correction applied across all combinations to control false discovery rate.

Mega sweep

Sweeps all strategies × all parameter combos × all assets. Runs in parallel. Produces ranked survivors after FDR correction.

Regime-conditioned

Breaks performance down by detected regime (EARLY_BULL, LATE_BULL, BEAR, SIDEWAYS). Shows which strategies hold in each regime.

Dynamic Kelly

Estimates optimal position sizing from trade history using the Kelly criterion. Regime-adjusted.

Understanding results

FDR correction is mandatory. A strategy that looks good on a single backtest is likely noise.

Key findings

Combined multi-factor strategies (momentum + MA crossover) outperform single-factor strategies after FDR correction. Pure momentum and pure RSI do not survive strict out-of-sample validation. See: architecture.md for how backtest results feed into the learning loop.