Home / EDU / PRO-03
PRO-03 · Pro

Backtesting, statistics and system evaluation

Test to falsify, not to confirm, and know your 'normal' drawdown before it happens.

Document 15/18Level ProReading time 50 minMarkets Forex · Gold · Indices
Backtesting, Statistics and Trading System Evaluation

You will learn

  • A 5-step testing process and in-sample / out-of-sample splits
  • Manual backtesting done right: hide the future, record in R, sample ≥ 100
  • 8 required metrics: expectancy, profit factor, win rate, max DD, recovery factor, Sharpe/Sortino, MAE/MFE, R distribution
  • Detecting overfitting: number of parameters, sensitivity, walk-forward
  • Monte Carlo for expected drawdown and a 'stop the system' rule
  • Backtesting in the MT5 Strategy Tester: tick mode, spread, latency and common traps

Who it's for

Traders who want to evaluate a manual system seriously, or are preparing to move to an EA.

Read first

PRO-01, PRO-02

An untested system is just a belief. A badly tested system is even more dangerous, because it gives you false confidence. This document presents a quantitative-standard testing process that still works for manual traders: how to backtest without fooling yourself, the minimum set of metrics, how to detect overfitting, and how to use Monte Carlo to know your system's "normal" drawdown before it happens for real.

01 Testing is for falsifying, not confirming

Traders usually backtest to prove their system works. That is the fastest way to fool yourself: you "see" the good setups, ignore the bad ones and tweak the rules until the past looks perfect. Scientists do the opposite: they try to disprove the hypothesis. Only a system that survives a serious attempt at falsification deserves real money.

Figure 1: PRO-03

Figure 1. The 5-step process. Step 4 (validation on unseen data) is where most "beautiful" systems are eliminated, and that is the point.

The hypothesis must be writable

Before looking at any chart, write all the rules down in a true/false testable form:

"Buy when: (1) D1 structure is up, or ranging at the lower edge; (2) H4 price touches a D1 zone (candle body within the zone ± 0.2 ADR); (3) the H4 candle has body/range < 0.35 and a lower wick ≥ 50% of the range; (4) candle volume ≥ 120% of the 20-bar average; (5) the next candle breaks the signal candle's high. SL = min(signal low, lowest of the last 3 touches) − 0.1 ADR. TP = next D1 zone − 0.1 ADR; skip if R:R < 1.5. Pending order expires after 3 candles."

If a rule cannot be written like that ("the zone looks strong"), it cannot be tested, and it cannot be repeated either.

02 Manual backtesting done right

For price action traders, manual backtesting is still the main tool because many rules are not yet coded. But it must be run like an experiment:

  1. Hide the future. Use a "bar replay" tool (e.g. TradingView) or scroll back and advance candle by candle. Never look at the whole chart and then mark setups: your brain will "see" highs and lows nobody could see at the time.
  2. Record every setup, including skipped ones. Each time the rules trigger, log a line: date, direction, score, R result (or "not filled", "skipped for R:R"). Skipped setups tell you frequency and reasons.
  3. Score R by rule, not by feel. Price hits SL before TP → −1R, even if "it would have won with a bit more room". Hits TP → +target R. Time-out (e.g. 15 candles) → close at the candle close, record the actual R.
  4. Minimum sample. ≥ 100 trades across at least two market regimes (a strong trend phase and a range phase). 30 trades in one good month mean nothing.
  5. Split the data before you start. 70% in-sample (rules may be tweaked) and 30% out-of-sample (run once, no changes). If you change the rules after seeing the out-of-sample, it has become in-sample.
⚠️ The most common manual-backtest trap

Hindsight bias: you "see" support because you already know price bounced there. The fix: draw zones before advancing candles, screenshot the zone map at the start of each week of the backtest period, and use only zones already drawn. If a setup occurs at a zone you hadn't drawn → it doesn't count.

03 Eight required metrics

MetricFormula / meaningReference threshold
Expectancy (E)Total R / number of trades≥ +0.15R for manual systems; ≥ +0.1R for high-frequency EAs
Profit factor (PF)Gross profit / gross loss (absolute)≥ 1.4 out-of-sample. PF > 2.5 in-sample is often overfit
Win rateWinners / totalOnly meaningful with the average R. 35% at 2.5R beats 60% at 0.8R
Max drawdown (MDD)Largest peak-to-trough decline, in R and %MDD ≤ 15R at 1% risk → 15% of the account
Recovery factorNet profit / MDD≥ 3 over ≥ 100 trades
Sharpe / SortinoAverage return / standard deviation (Sortino counts downside deviation only), monthly or per tradeMonthly Sharpe ≥ 0.3 (≈ 1.0 annualised) is acceptable for an individual trader
MAE / MFEEach trade's largest open loss / open profit, in RUsed to optimise SL/TP (below)
R distributionHistogram of each trade's RLargest winner ≤ 20% of total profit; otherwise results depend on luck
🔑 The "one trade" rule

Remove the single largest winner and recalculate E. If E drops by more than 30% or turns negative, your system is living off one lucky event. Good systems spread their profit across many trades.

04 MAE / MFE: data to optimise stops and targets

For each trade, record two more numbers: MAE (Maximum Adverse Excursion: the deepest the trade went against you, in R) and MFE (Maximum Favourable Excursion: the furthest it went in your favour, in R).

Figure 2: PRO-03

Figure 2. Each dot is a trade. Green: winners; red: losers. Winners rarely have MAE beyond 0.7R, suggesting the stop could be tighter. Many losers had an MFE of 0.5–1R, suggesting an early partial close or a breakeven stop at +1R.

  1. Is the stop too wide? If 90% of winners have MAE < 0.6R, you are paying 1R of risk for something that needs only 0.6R. Tightening the SL by 30% raises R:R with almost no change in win rate. (Always re-verify out-of-sample.)
  2. Is the target too far? If many losers had MFE ≥ 1R, a "move SL to breakeven at +1R" rule would turn them into 0R instead of −1R, but it will also cut some winners. Calculate E with and without the rule to decide.

05 Detecting overfitting

Overfitting is when a system "memorises" the past instead of learning a pattern. Signs:

SignExampleHow to check
Too many parameters9 filters, each with its own thresholdRule of thumb: ≤ 1 free parameter per 30 trades in the sample
"Odd" parametersMA 37, RSI 68, volume 143%Try 120/150/180%: if only 143% is profitable, it is noise
In-sample far outperformsPF 3.2 in-sample, 1.1 out-of-sampleOut-of-sample should reach ≥ 60% of in-sample performance
Fails on similar pairsProfitable on EURUSD, losing on GBPUSDGood price action systems usually transfer between major pairs
Sensitive to start dateStarting 1 Jan profits, starting 15 Jan losesRun with 5 different start dates
Figure 3: PRO-03

Figure 3. Two systems with similar in-sample equity curves. Out-of-sample, the healthy system keeps rising at a similar slope; the overfit one flattens and then falls.

Walk-forward

Instead of a single 70/30 split, divide the data into rolling windows: optimise on 12 months → test on the next 3 → slide forward 3 months → repeat. Stitch all the test segments into one "walk-forward" equity curve: the most honest estimate of future performance. Walk-forward efficiency = annual walk-forward return / annual in-sample return; ≥ 50% is good.

06 Monte Carlo: know "normal" drawdown before it happens

The order of trades in a backtest is one of millions of possible orders. With the same 120 trades, if 10 losers happen in a row at the start instead of scattered, the drawdown is very different, even though the end result is the same. Monte Carlo answers: "for this system, which drawdown is normal and which is abnormal?"

Figure 4: PRO-03

Figure 4. Randomly reshuffling 120 trades (1% risk) six times. The end point is almost the same; the path, and the drawdown, differ significantly. The bold line is the original order.

Process (Excel/Google Sheets or Python):

  1. Take the list of R values from ≥ 100 trades.
  2. Shuffle the order randomly (or resample with replacement), compute the equity curve at your planned % risk, record the max drawdown.
  3. Repeat 1,000–10,000 times.
  4. Take the 95th percentile of max drawdown: the "worst normal drawdown". Take the 99th percentile: the "alarm drawdown".

System stop rule: if real drawdown exceeds the 95th percentile → halve risk. Beyond the 99th percentile → stop, go back to demo, and investigate whether the market has changed or you broke the rules. This separates a "normal losing streak" from a "broken system" with data instead of feelings.

07 Backtesting in the MT5 Strategy Tester

Once the system is coded (PRO-05), the Strategy Tester can test thousands of trades in minutes. But results are only trustworthy if it is configured correctly:

SettingRecommendationWhy
Modelling mode"Every tick based on real ticks" for the final test; "1 minute OHLC" for quick optimisation"Open prices only" ignores SL/TP being hit within a candle
SpreadCurrent, or fixed at the broker's average London spread + 20%A zero spread makes scalping strategies look falsely profitable
LatencyEnable random delayMarket orders are not filled instantly
DataDownload full history from the real broker that will run the EA; check for data gapsOther brokers have different server times and spreads
Period≥ 3 years, including 2020 (extreme volatility) and a ranging yearTwo market regimes
OptimisationOnly 2–3 parameters, coarse steps; choose a stable parameter region, not the peakThe optimisation peak is usually overfit
Forward testUse the Forward 1/3 or 1/4 featureAutomatic out-of-sample

EA-specific traps: lookahead (using iHigh(..., 0) of the running candle as if it had closed), repainting (ZigZag/fractal indicators changing past points), tick volume differing between brokers. PRO-05 handles each one in code.

08 System evaluation report template

Every system needs a one-page report before it runs real money. Example values are illustrative:

ItemValue
System name / versionPA reversal + VSA, v1.2
Markets / timeframesXAUUSD, EURUSD, GBPUSD · H4 signal, D1 context
In-sample period01/2021 – 06/2024 (n = 164)
Out-of-sample period07/2024 – 06/2026 (n = 71)
E (in / out)+0.31R / +0.24R
PF (in / out)1.9 / 1.6
Win rate (in / out)44% / 41%
MDD (in / out)9.8R / 11.2R
Recovery factor (total)4.1
Largest winner / total profit7%
Monte Carlo MDD P95 / P99 (1% risk)13.5% / 17.8%
Walk-forward efficiency68%
Free parameters4 (body/range threshold, volume %, SL buffer, expiry)
DecisionDemo 2 months → live at 0.5% → 1% after 30 trades with E > 0

09 Summary

  • Test to falsify. Write rules down in a testable form before looking at the chart.
  • Manual backtest: hide the future, record every setup, score R by rule, ≥ 100 trades across ≥ 2 regimes, split 70/30 first.
  • 8 metrics: E, PF, win rate, MDD, recovery, Sharpe/Sortino, MAE/MFE, R distribution. The "one trade" rule.
  • Overfitting: ≤ 1 parameter per 30 trades, "round" parameters, out-of-sample ≥ 60% of in-sample, walk-forward efficiency ≥ 50%.
  • Monte Carlo for MDD P95/P99 → data-driven rules to cut risk / stop the system.
  • MT5 Tester: real ticks, real spreads, latency, ≥ 3 years, optimise ≤ 3 parameters, choose a stable region.

References

  1. Robert Pardo, The Evaluation and Optimization of Trading Strategies, 2nd ed., Wiley: walk-forward analysis.
  2. Ernest P. Chan, Quantitative Trading: backtest pitfalls, lookahead bias.
  3. John Sweeney, Maximum Adverse Excursion: MAE/MFE.
  4. David Aronson, Evidence-Based Technical Analysis: data-mining bias.
  5. MetaQuotes, MQL5 Reference: Strategy Tester tick modelling and forward testing.
  6. BMR Master Trade internal EA testing process.

Study with a community

Questions on this document? Join the BMR trader community on Telegram to discuss the exercises and keep each other accountable. Trading costs matter too: our cashback pays you back on every lot.

Join on Telegram

Educational content, not investment advice. Trading forex, gold, indices and CFDs on margin carries a high risk of losing capital; past or simulated results do not guarantee future results. You are fully responsible for your trading decisions. Part of the BMR Trader Library (© BMR Master Trade), compiled from the references listed in each document.