Backtesting guides
The total PnL rarely tells you what to change in a trading rule. These guides cover how to break a backtest result down and read it.
- How to backtest a trading strategy in Python, and how to read the resultWrite a trading rule in Python, run a backtest, and read more than the total PnL. Step by step with hawk-bt code examples.
- MFE and MAE explained: split losing trades into exit problems and entry problemsWhat maximum favorable excursion (MFE) and maximum adverse excursion (MAE) mean, and how to use them to tell whether a strategy needs a better exit or a better entry.
- How to avoid overfitting a backtest when you optimize parametersWhy the single best parameter set from an optimization tends to break on new data, and how to pick a stable region on a parameter heatmap instead.
- Backtest fill assumptions: gaps, TP and SL on the same bar, spreadFill assumptions can move backtest results by several percent. Gaps through a stop, TP and SL touched on one bar, spread and fees, and signal-bar vs next-bar entries.
- Split backtest results by market regime: trend, range and shocksThe same rule can win in trends and lose in ranges. How to break backtest results down by market regime to see what a strategy is actually good at.
- Choosing a backtesting tool: Python libraries, TradingView, MT5 or a browser appbacktesting.py, vectorbt, Backtrader, TradingView and the MT5 strategy tester compared by what each is good at, and what to check before you pick one.