A mean-reversion Expert Advisor (EA) bets that a stretched price will snap back. When it works, it tends to win often and by small amounts. When it fails, it usually fails in one specific way: the stretch keeps stretching, and a position that was meant to be a small, quick win becomes the largest loss in the history.
That payoff shape makes mean-reversion strategies look reassuring in a backtest and fragile in the one scenario that matters. General robustness tests still apply, but they can miss this failure mode, because a smooth equity curve and a high win rate are exactly what the strategy produces right up to the moment it does not. This guide covers the tests that are specific to mean reversion.
One point up front: a high win rate is the shape of a mean-reversion strategy, not evidence that it works. What decides whether it holds up is the size and frequency of the losses, and those are the part of the history with the least data.
Why mean reversion needs its own tests
Three features set mean reversion apart from trend-following and breakout designs.
- The payoff is skewed the wrong way. Many small wins and a few large losses. The average looks fine, but the outcome depends heavily on a handful of trades.
- Losses cluster. The losing trades tend to arrive together, during a persistent trend or a volatility expansion, rather than spread evenly through time.
- The worst case is often not in the backtest. If the largest loss came from the strongest trend in the test period, a stronger trend later produces a larger loss. The backtest's worst loss is a lower bound, not a limit.
Our guide to market regime testing shows how to label trades by trend and volatility and see where the profit comes from. Run that first. For a mean-reversion EA, expect the profit to come from ranging, calmer conditions and the losses from trending ones. If the breakdown shows something else, the strategy may not be doing what you think it does.
Step 1: Describe the payoff shape
Measure every trade in multiples of the initial risk, often written R, and record:
- Win rate.
- Average win and average loss, in R.
- Largest loss, in R.
- How many average wins the largest loss erases.
- The longest run of consecutive losses.
Our guide to reading an MT5 Strategy Tester report explains where to find the raw figures.
The break-even win rate
For any strategy, the win rate needed just to break even is the average loss divided by the sum of the average win and the average loss. For a mean-reversion strategy, that number usually sits close to the actual win rate, and the distance between them is the real margin of safety.
Hypothetical arithmetic, for illustration only. Suppose an EA wins 75% of its trades, with an average win of 0.5R and an average loss of 1.2R. Its average result per trade is 0.75 × 0.5 − 0.25 × 1.2 = 0.075R. Its break-even win rate is 1.2 ÷ (0.5 + 1.2), about 70.6%. A fall of under five percentage points turns the average trade negative: at 70% it is 0.70 × 0.5 − 0.30 × 1.2 = −0.01R. If its largest loss were 4R, one such loss would erase eight average wins.
Nothing in that example is unusual for the archetype. The point is how little room it leaves. A strategy with a 75% win rate and a 70.6% break-even point has a far thinner margin than its win rate suggests.
Step 2: Test where the stop sits
Mean-reversion strategies face a real dilemma. A tight stop cuts the losses but also stops out trades that would have reverted and won. A wide stop, or none, keeps those winners but lets the occasional loss grow very large. The test is to measure that trade-off rather than guess it.
Read the winners' adverse excursion
For each trade, the maximum adverse excursion (MAE) is how far price moved against the position before it closed. Look at the MAE of the winning trades in particular, because it shows how much room the strategy needs to let a winner revert.
This sketch estimates, for a range of stop distances, how many winners a tighter stop would have cut and how many large losses it would have capped. It assumes a trade list with each trade's result and MAE in R.
import pandas as pd
trades = pd.read_csv("trades.csv") # columns: result_r, mae_r (mae as a positive number)
winners = trades[trades["result_r"] > 0]
losers = trades[trades["result_r"] <= 0]
rows = []
for stop in [0.5, 0.75, 1.0, 1.5, 2.0, 3.0]:
cut = (winners["mae_r"] >= stop).mean() # winners this stop would have closed at a loss
capped = (losers["result_r"] < -stop).mean() # losses this stop would have limited
rows.append({"stop_r": stop, "winners_cut": round(cut, 2), "losses_capped": round(capped, 2)})
print(pd.DataFrame(rows))
This is an approximation. A trade stopped out earlier might have been followed by a different trade, and stop fills can slip. Confirm the most promising stop distances with a full backtest at each one, and treat the stop distance like any other parameter, with a sweep and a look for a stable region, as our guide to parameter sensitivity describes.
What to look for:
- Winners clustered at small MAE, with few going far against the position: a stop just beyond that cluster cuts few winners and caps the tail. That is the comfortable case.
- Winners spread across large MAE values: the strategy needs a lot of room to win. Any stop that limits the tail also removes much of the edge. That is a structural weakness, not a tuning problem.
- A stop that the backtest never reaches: if no trade went far enough to hit it, the stop has not been tested at all. It may still be a sensible protective level, but the backtest cannot tell you what it costs.
Time stops
Many mean-reversion strategies expect the reversion within a certain number of bars. If it has not happened by then, the original idea has probably failed. A time stop closes the trade after that many bars, whatever the price.
Test it by recording how long winners take to close. If most winners close within a short window and the trades that run much longer are mostly the large losses, a time stop can cut the tail without cutting many winners. Sweep the time limit and check for a stable region, as with any parameter.
Step 3: If the EA averages, measure the exposure
Some mean-reversion EAs add to a losing position instead of stopping out, sometimes on a grid of fixed distances, sometimes with increasing size. Averaging improves the average entry price, so a smaller reversion is enough to close the whole position at a profit. It also multiplies the exposure exactly when the market is moving against it. Our guide to spotting an overfit backtest lists very high win rates with occasional large losses as a sign of this kind of logic.
Hypothetical arithmetic, for illustration only. An EA opens one lot and adds one more lot every 20 pips against it, up to four lots. If price moves 100 pips against the first entry, the four positions are 100, 80, 60 and 40 pips under water: a combined 280 pips on one lot, against 100 pips for a single position with no averaging. If each added position were doubled in size instead, at 1, 2, 4 and 8 lots, the same move would cost 100 + 160 + 240 + 320 = 820 pips on one lot.
For any averaging EA, measure:
- Maximum open size and maximum floating loss reached in the backtest, not just the closed-trade drawdown. Our guide to drawdown metrics explains why equity drawdown matters more than balance drawdown for designs that hold losing positions.
- The hard limit: the maximum number of additions, maximum total size, or an equity stop that closes everything. Without one, the worst case has no ceiling.
- The move that hits the limit: work out how far price must move against the first entry to reach the maximum size, and what the floating loss is at that point. Then compare that distance with the largest one-directional moves in the history.
A backtest in which an averaging EA never reached its maximum size has not tested its worst case.
Step 4: Replay the trending shocks
The scenario that breaks mean reversion is a strong, persistent move. Test it directly.
- Find the strongest moves in the history. Rank periods by their net one-directional move, for example over five or twenty trading days, and take the top ten.
- List what the EA did in each. Which trades were open, how large the loss grew, and how the trades were closed: by stop, by time, by a reversal, or by the end of the test.
- Stretch the excursion. For every losing trade, ask what would have happened if the adverse move had gone 50% or 100% further before reversing. With a hard stop, the loss is capped, apart from slippage. Without one, the loss grows with the move, and for an averaging EA it grows faster.
- Look outside the home market. Running the same rules on related symbols, or on periods outside the main test, brings in trends the original history did not contain.
If the strategy's worst losses all come from the few strongest trends in the history, assume a stronger one will eventually arrive, and make sure the stop or the hard limit decides how much it costs.
Step 5: Monte Carlo that respects clustered losses
A standard Monte Carlo test, explained in our guide to Monte Carlo testing, reshuffles or resamples individual trades. That treats each trade as independent. For mean reversion, the losses are not independent: they bunch together in trending periods. Shuffling them apart spreads the bad trades out and can make the drawdown tail look milder than it is.
A block bootstrap keeps that clustering. Instead of resampling single trades, it resamples blocks of consecutive trades, so a losing streak stays together.
import numpy as np
def block_bootstrap_dd(results_r, block=10, runs=5000, seed=1):
"""Maximum drawdown (in R) for resampled sequences of consecutive-trade blocks."""
rng = np.random.default_rng(seed)
r = np.asarray(results_r, dtype=float)
n = len(r)
starts = np.arange(n - block + 1)
dds = np.empty(runs)
for k in range(runs):
picks = rng.choice(starts, size=int(np.ceil(n / block)))
seq = np.concatenate([r[s:s + block] for s in picks])[:n]
equity = np.cumsum(seq)
dds[k] = np.max(np.maximum.accumulate(np.maximum(equity, 0)) - equity)
return np.percentile(dds, [50, 95, 99])
Run it alongside the ordinary trade-by-trade version on the same trade list. If the block version shows a noticeably worse 95th or 99th percentile drawdown, the losses in the history are clustered, and the ordinary version understates the tail. Try a few block lengths, roughly matching the length of the losing streaks you saw in Step 1.
Two limits apply. First, like any Monte Carlo test, a block bootstrap can only reorder the trades in the history; it cannot invent a larger loss than the largest one recorded. Pair it with the stretched-excursion test from Step 4, which can. Second, the block length is a choice, and it changes the result, so report the percentiles for several block lengths rather than picking the one that looks best.
Step 6: Check when and how long it holds
Mean-reversion EAs often trade in quiet hours, when ranges are narrow, and sometimes around the daily rollover. They also tend to hold losing trades longer than winning ones, sometimes over a weekend. Each of those carries a cost the backtest may not show.
- Spread at entry. Quiet hours and the rollover window often have the widest spreads. Check the entry times and test those trades with realistic spreads for that hour.
- Swaps on long holds. A losing trade that is held for days pays or receives swap every night, including the larger charge on the triple-swap day.
- Weekend exposure. A position held over the weekend can open beyond its stop on Monday. Our guide to weekend gaps, swaps and news spikes explains how to test each.
Compare the holding time of winners and losers. If the losers are typically held several times longer than the winners, the costs of holding fall mostly on the trades that are already losing.
Step 7: Decide the failure rules in advance
Because the bad scenario is a persistent trend, the EA, and you, need a rule for it that is decided before it happens, not during it.
- What closes a failed trade: a hard stop, a time stop, an equity limit, or a combination. "It will come back" is not a rule.
- What the EA does in a strong trend: keep trading, trade smaller, or pause. If you use a regime filter for this, define it in advance and test it out of sample, because filters added after seeing the losses are easy to overfit.
- When to stop the EA altogether: for example, a loss beyond the stretched-excursion scenario from Step 4, or a losing run longer than anything the block bootstrap produced.
Write these down with the test results. They are part of the strategy, not something to improvise later.
Common mean-reversion testing mistakes
- Trusting the win rate. A high win rate is the archetype's normal shape. Judge it against the break-even win rate.
- Treating the largest backtest loss as the worst case. It is the worst case so far. A stronger trend produces a larger loss.
- Removing the stop to improve the backtest. It usually raises the win rate and the average trade, and moves the risk into the tail where the backtest has the least evidence.
- Averaging without a hard limit. Exposure then has no ceiling in exactly the conditions that hurt.
- Looking only at closed-trade drawdown. Designs that hold losing positions need the floating, equity-based figure.
- Using only trade-by-trade Monte Carlo. It breaks up clustered losses and can understate the tail.
- Adding a trend filter after seeing the losses. That fits the filter to the specific trends in the history.
Mean-reversion stress-test checklist
- Trades labelled by regime, with profit and losses traced to trend and volatility conditions
- Win rate, average win and loss, largest loss and longest losing run recorded in R
- Break-even win rate calculated and compared with the actual win rate
- Winners' adverse excursion examined, and stop distance swept for a stable region
- Time stop tested against how long winners take to close
- For averaging designs: maximum size, maximum floating loss and the hard limit recorded
- The move needed to hit the averaging limit compared with the largest moves in the history
- Strongest trending periods replayed, and adverse excursions stretched by 50% and 100%
- Block bootstrap Monte Carlo run alongside the trade-by-trade version
- Entry spreads, swaps on long holds and weekend exposure checked
- Failure rules written down before going live
Frequently asked questions
Why do mean-reversion EAs have such high win rates?
Because they take profits quickly, when price returns towards its average, and give losing trades more room. That produces many small wins and fewer, larger losses. The win rate describes the shape of the strategy, not its quality; the size of the losses decides whether it holds up.
Should a mean-reversion EA use a stop-loss?
That is a design decision, but it should be tested rather than assumed. Measure how far winners move against the position before reverting, sweep the stop distance, and compare how many winners each stop cuts with how much of the loss tail it removes. Without any stop or hard limit, the worst case has no ceiling.
Is averaging into losing trades the same as a martingale?
Not exactly. Averaging adds positions as price moves against the trade. A martingale also increases the size of each addition. Both increase exposure when the market moves against the position, and martingale sizing increases it much faster. Either way, the hard limit on total size decides the worst case.
How do I Monte Carlo test a strategy whose losses come in clusters?
Use a block bootstrap, which resamples blocks of consecutive trades rather than single trades, so losing streaks stay together. Compare its drawdown percentiles with an ordinary trade-by-trade Monte Carlo. A worse tail in the block version means the ordinary version understated the risk.
Does passing these tests mean a mean-reversion EA is safe to trade?
No. The tests show how the strategy's losses are shaped and where its limits are. They cannot predict how strong the next trending move will be, and a strategy can pass every test here and still lose money.
Want a second pair of eyes?
Start with our free Sample Stress-Test Report. It walks one anonymized, illustrative strategy through a full stress test, start to finish, so you can see what rigorous validation looks like before you test your own.
Read the Sample Stress-Test ReportWant your own backtest checked? The Strategy Audit + 60-minute call is a paid service at a launch price of £100, credited in full against our build and portfolio offers. You send an MT4/MT5 Strategy Tester report or trade-list CSV; what we can check depends on the files you supply, and walk-forward and parameter sweeps are not included because they need the strategy itself. It is analysis of strategy testing, not investment advice, and does not promise any trading or evaluation outcome. See the Strategy Audit
Disclaimers
CollosoTrading provides educational content and analytical services for retail and professional algorithmic traders. We do not provide regulated investment advice, financial advice, or personal recommendations. Trading derivatives, leveraged products, and CFDs carries a high level of risk and may result in losses exceeding deposits. Past performance, including any verified or unverified historical results referenced on this site, is not indicative of future results. Consult an independent regulated financial adviser before making investment decisions.
All figures are backtests or simulations unless marked LIVE. Hypothetical or backtested performance results have inherent limitations and may not reflect actual trading. No representation is made that any account will or is likely to achieve profits or losses similar to those shown. Individual results vary. Any figures in this article are hypothetical arithmetic for teaching purposes, not results from any strategy or account. We do not guarantee the outcome of any prop firm challenge.