start learning →
intermediate11 min read

Mean reversion trading in forex: z-scores, Bollinger Bands and trend risk

Mean reversion trades bet that a stretched price drifts back towards its average. Here is how traders measure the stretch with z-scores and Bollinger Bands, why the payoff is lopsided, and why trends are the strategy's main enemy.

key takeaways
  1. Mean reversion assumes that when price moves unusually far from an average, it tends to move back towards it.
  2. A z-score measures that distance in standard deviations: (price minus the moving average) divided by the standard deviation.
  3. Bollinger Bands are a visual version of the same idea; a 2 standard deviation band is roughly a z-score of plus or minus 2.
  4. Mean reversion rules often win frequently but lose large amounts when a trend develops, so stops and sizing matter more than entries.
  5. The average itself moves, and a statistical extreme is not a reason for price to turn; test any rule across trending and ranging periods.

Mean reversion trading is based on the idea that when price moves unusually far from its recent average, it tends to drift back towards it. A trader measures how stretched price is, usually in standard deviations from a moving average, and takes the opposite side when the stretch is large: selling after an unusually large rise, buying after an unusually large fall. The approach often wins frequently in sideways markets, and loses heavily when a stretched market keeps stretching because a trend has begun.

This guide explains how the stretch is measured with z-scores and Bollinger Bands, walks through the calculation, shows why the payoff profile is lopsided, and sets out how to test a mean reversion rule and the ways it typically fails. It describes a method, not a recommendation. Most retail CFD accounts lose money, and mean reversion rules are a common route to large single losses when they are traded without a stop.

The idea behind mean reversion

Prices fluctuate around levels that buyers and sellers consider fair for the moment. Short-term order imbalances, a large order, a nervous reaction to a headline, a burst of stop orders, can push price away from that level, and when the imbalance passes, price may drift back. Mean reversion tries to profit from those overshoots.

The weakness is in the assumption. Price moves away from an average for two very different reasons:

  • Noise. A temporary imbalance with no new information. These moves often reverse.
  • Information. A change in interest-rate expectations, a data surprise, a shift in risk sentiment. These moves can be the start of a new trend, and the old average becomes irrelevant.

On the chart, both look the same at the moment of entry. A mean reversion rule cannot tell them apart; it only measures distance. That is the source of most of its losses.

Measuring the stretch: the z-score

A z-score expresses how far price is from its average in units of standard deviation:

z = (price − moving average) ÷ standard deviation

Both the moving average and the standard deviation are calculated over the same lookback, for example the last 20 closes. A z-score of 0 means price is at the average. A z-score of +2 means price is two standard deviations above it; −2 means two below.

The appeal is that the z-score is scale-free. A 60-pip move means something different on EUR/GBP than on GBP/JPY, but a z-score of −2 is "unusually low relative to recent movement" on both. That makes it possible to apply one rule to several pairs.

Worked example: calculating a z-score

These are illustrative numbers, kept to five closes so the arithmetic is easy to follow. Real rules usually use a longer lookback.

The last five closes of EUR/USD are 1.1030, 1.1020, 1.1010, 1.1000 and 1.0940.

  1. Average. The sum is 5.5000, so the average is 5.5000 ÷ 5 = 1.1000.
  2. Deviations from the average. +0.0030, +0.0020, +0.0010, 0 and −0.0060.
  3. Squared deviations. 0.000009, 0.000004, 0.000001, 0 and 0.000036, which sum to 0.000050.
  4. Variance. 0.000050 ÷ 5 = 0.000010 (the population version, dividing by the number of values).
  5. Standard deviation. The square root of 0.000010 is about 0.00316, or 31.6 pips.
  6. Z-score of the latest close. (1.0940 − 1.1000) ÷ 0.00316 = −0.0060 ÷ 0.00316, about −1.90.

The latest close is about 1.9 standard deviations below its five-bar average. Notice that the big drop itself increases the standard deviation, which reduces the z-score. A single large move partly "absorbs" itself in the calculation; this is one reason short lookbacks behave erratically.

What a z-score does not tell you

A z-score uses the language of statistics, but prices do not follow the neat bell curve that makes "a 2 standard deviation move happens about 5% of the time" true. Currency returns have fatter tails than a normal distribution: large moves happen more often than the bell curve suggests, and they cluster in time. A z-score of −3 is not a rare event that must reverse. It is a description of the recent past.

Bollinger Bands: the visual version

Bollinger Bands plot a moving average with bands a set number of standard deviations above and below it, typically 20 periods and 2 standard deviations. A close on the lower band is, by construction, a z-score of about −2; a close on the upper band about +2. The indicator's %b reading is a rescaled z-score: 0 at the lower band, 1 at the upper band, 0.5 at the average.

So a rule such as "buy when price closes below the lower Bollinger Band" is a z-score rule with a threshold of −2. The two are the same idea presented differently. The Bollinger guide explains the calculation, the squeeze and "walking the bands", which is exactly the behaviour that hurts mean reversion: in a strong trend, price can close outside a band repeatedly.

Other ways to define the mean and the stretch

  • Oscillators. RSI and stochastic readings in overbought and oversold territory are another way to express "stretched". They are bounded between 0 and 100, which makes them easy to read but hides how far price has really travelled.
  • ATR distance. Distance from a moving average measured in multiples of the ATR is similar to a z-score but based on the range of each bar rather than the dispersion of closes.
  • Pivot levels and the session average. Some intraday traders use pivot points or the session's average price as the mean.
  • Spreads between related instruments. Pairs trading looks for two related instruments whose price relationship has stretched, rather than one price stretching from its own history. That relationship can break too, as the currency correlation guide explains.

Worked example: a mean reversion trade with a stop

All figures are illustrative. They are not a forecast or a real setup.

On the four-hour chart, the 20-bar average of EUR/USD is 1.1000 and the 20-bar standard deviation is 0.0025 (25 pips). Price closes at 1.0940.

  1. Z-score. (1.0940 − 1.1000) ÷ 0.0025 = −0.0060 ÷ 0.0025 = −2.4. Your rule buys at a close below −2.
  2. Stop. Your rule exits if the z-score reaches −3.5, measured from today's average and standard deviation: 1.1000 − (3.5 × 0.0025) = 1.1000 − 0.00875 = 1.09125. That is 27.5 pips below entry.
  3. Size. With a $10,000 account risking 1%, $100. On EUR/USD one standard lot is about $10 per pip. $100 ÷ 27.5 pips is about $3.64 per pip, or 0.364 lots. Rounding down gives 0.36 lots. The position size calculator handles other pairs and currencies.
  4. Target. Exit at the moving average, currently 1.1000, which is 60 pips away. Many rules instead exit when the z-score returns to 0 or to −0.5, whatever price that turns out to be.

Two practical points come out of this. First, the target moves: if price keeps falling for several bars, the average falls with it, so the "mean" you are reverting to may be well below 1.1000 by the time you get there. Second, the stop is a fixed price once placed; if you recalculated it every bar using the moving average, it would drift lower as the market falls and you would end up holding a losing trade much longer than planned.

Why the payoff is lopsided

Mean reversion rules usually have a high win rate with small average wins, and a lower number of larger losses. That shape is attractive on a chart and in a short test, and dangerous over time.

Here is an illustration in units of risk (R), using made-up but plausible-looking statistics:

  • The rule as tested. It wins 70% of the time with an average win of 0.6R and loses 30% of the time with an average loss of 1R. Expectancy = (0.70 × 0.6) − (0.30 × 1.0) = 0.42 − 0.30 = +0.12R per trade.
  • The rule in practice. In live trading, some losses happen in fast markets or across weekends, and the stop fills worse than planned. If the average loss rises to 1.5R, expectancy = 0.42 − (0.30 × 1.5) = 0.42 − 0.45 = −0.03R per trade.

A modest change in the size of the losses turns a positive result into a negative one, while the win rate, which is what traders notice day to day, is unchanged. The expectancy and risk-reward guides explain this arithmetic, and the trading metrics guide shows how to measure it in your own results.

No stop at all

The most damaging version of mean reversion is the one without a stop: "it is stretched, so it must come back; I will add more if it goes further." That can produce a long run of small wins followed by a single loss larger than all of them combined. Adding to losers on leverage is also how accounts reach a margin call and stop-out. The risk of ruin calculator shows how quickly an account can be badly damaged when losses are large relative to wins.

When mean reversion struggles: trends

Trends are the main enemy. When a central bank changes direction, when a currency is repricing after a shock, or when risk sentiment shifts sharply, a pair can trade at a z-score of −2 or below for days or weeks. Each new low looks like an even better buying opportunity to a mean reversion rule, and each one loses.

Ways traders try to reduce this exposure, each of which should be tested rather than assumed to help:

  • Trend filter. Only take mean reversion trades in the direction of a higher-timeframe trend (buying dips in an uptrend), or only when a longer moving average is flat. The trend following guide covers common definitions.
  • News filter. Avoid entries just after high-impact data, when the move may reflect new information. The economic data guide explains why surprises move prices.
  • Volatility filter. Avoid entries when volatility is expanding rapidly, for example when ATR has jumped. Stretches in calm markets may be more likely to be noise.
  • Time stop. Exit if the trade has not reverted within a set number of bars, instead of waiting indefinitely.
  • Fixed maximum loss. A hard stop, sized so a loss is always a set fraction of the account, whatever the z-score does.

Mean reversion versus range trading

Range trading is a visual, level-based form of mean reversion: it buys near support and sells near resistance. Statistical mean reversion uses an average and a measure of dispersion instead of drawn levels. The range approach has a clear invalidation point (the range edge); the statistical approach needs one to be chosen deliberately. Both have the same weakness in trends, and both are the opposite of the breakout approach, which profits from exactly the moves that hurt them.

How to test a mean reversion rule

  1. Specify every part. Lookback, standard deviation type, entry threshold, stop (as a fixed price set at entry), exit rule, time stop and any filters.
  2. Test across regimes. Include strong trending periods as well as quiet ones. A mean reversion rule tested only in a calm year will look much better than it is.
  3. Include costs. Typical spread at your trading hours, commission, swap for multi-day holds (the swap calculator estimates it), and slippage on stops.
  4. Study the tail. Record the largest losses, the longest losing streak and the maximum drawdown. For a mean reversion rule these figures matter more than the win rate.
  5. Avoid parameter mining. Testing dozens of lookbacks and thresholds and choosing the best is a recipe for a rule that fits the past. Prefer settings that work reasonably across a range of values over a single sharp optimum.
  6. Check unseen data. Keep a later period aside and test on it once at the end. Then forward test small, on demo or minimal size.

The backtesting guide covers the process, and a trading journal helps compare live results with the test.

The main failure modes

  • Regime change. A pair that ranged for months starts trending after a policy shift, and the rule keeps fading the move.
  • Fat tails. Rare, large moves happen more often than a normal distribution suggests, and one of them can outweigh many small wins.
  • Stops that move. Recalculating the stop from a falling moving average keeps a losing trade open far too long.
  • Averaging down. Adding size as the trade moves against you turns a controlled loss into an uncontrolled one.
  • Costs on small targets. Short-timeframe reversion trades aim for small moves, so spread and commission take a large share.
  • Correlated positions. Buying several stretched pairs that are all falling for the same reason (for example broad US dollar strength) is one large bet, not several small ones.

Common mistakes

  • Treating "oversold" as a reason to buy. A statistical extreme describes the past; it does not create buying pressure.
  • Using a tiny lookback. Very short lookbacks produce noisy averages and erratic z-scores.
  • Ignoring leverage. Mean reversion's large occasional losses are magnified by leverage. Size from the stop distance, as the position sizing guide explains.
  • Judging the rule on its win rate. A 75% win rate can still lose money; judge it on expectancy after costs and on its worst losses.

Frequently asked questions

What is mean reversion in trading?

Mean reversion is the idea that when price moves unusually far from its recent average, it tends to move back towards it. Mean reversion traders take the opposite side of large stretches. The idea fails when the stretch reflects new information and the market starts trending.

How do you calculate a z-score for a currency pair?

Take the price, subtract the moving average over your chosen lookback, and divide by the standard deviation of prices over the same lookback. A result of −2 means price is two standard deviations below its average. Most charting platforms can plot this directly or through Bollinger Bands.

Are Bollinger Bands a mean reversion indicator?

They can be used that way, since a close at a 2 standard deviation band is roughly a z-score of 2. They are also used for breakout and trend approaches, for example after a squeeze. In strong trends price can ride along one band for a long time, which is where mean reversion use of the bands loses.

Why do mean reversion strategies have high win rates but still lose money?

Because the wins tend to be small and the losses large. A rule can win 70% of the time and still have negative expectancy if the average loss is big enough, especially once slippage and gaps make some losses larger than planned.

Should a mean reversion trade have a stop loss?

Running mean reversion trades without a stop is how many accounts suffer their largest losses, because the trend that hurts the trade can continue much further than expected. A stop set at entry, with size calculated from it, keeps each loss to a planned fraction of the account.

Does mean reversion work better on some pairs than others?

Historical behaviour differs between pairs and periods; some crosses have spent long periods in ranges, while pairs driven by sharp policy divergences have trended strongly. Past behaviour can change, so any pair-specific result should be tested on recent and unseen data rather than assumed.

Not investment advice. This is general information and education, written without knowledge of your circumstances. It is not a recommendation to buy or sell any instrument. Past performance is not a reliable indicator of future results. Trading leveraged products carries a high risk of losing money. Risk warning