Mean Reversion in the Forex Market
Trading Bollinger Bands and Overbought/Oversold Zones
The mean reversion strategy exploits a statistical regularity: after a strong deviation, the price tends to revert to its mean value. In the forex market, this idea appeals to traders due to its apparent simplicity—buy “cheap,” sell “expensive.” However, behind this apparent ease lie strict mathematical conditions, the violation of which turns a profitable system into a loss generator. Let’s examine which pairs are truly prone to reversion, how to confirm it statistically, and why the absence of a stop-loss is deadly dangerous.
Which Pairs Are Prone to Mean Reversion
orex instruments are heterogeneous in nature. Majors such as EURUSD, USDJPY, and GBPUSD exhibit pronounced trending movements, especially during periods of monetary policy divergence. Mean reversion works on them only fragmentarily—mainly during the Asian session or in periods of low volatility when the market is consolidating. Non-dollar cross rates (EURGBP, EURCHF, AUDNZD) have historically shown a stronger tendency toward stationarity, as their dynamics are driven by the difference between two non-dollar economies, not subject to global capital flows with the same intensity. Pairs involving the Swiss franc, particularly EURCHF, deserve special attention: the Swiss National Bank long maintained a currency ceiling, and even after its removal, the pair still exhibits periods of sustained reversal. Exotic pairs like USDSGD or USDHKD often have managed exchange rates, making them attractive for mean-reversion systems, but low liquidity and wide spreads eat away potential profits.
Instrument selection is a critical step. Do not apply reversal logic to a pair in a long-term fundamental trend. For example, USDTRY has shown a sustained upward trend in recent years due to the Turkish central bank’s inflationary policies, and any attempt to catch reversals is doomed.
Statistical Tests for Stationarity: ADF and the Dickey-Fuller Test
Stationarity is a property of a time series whereby its statistical characteristics (mean, variance) do not depend on time. For mean reversion, this is a fundamental requirement: if the mean to which the price is supposed to revert is itself drifting, the trading logic breaks down.
The Augmented Dickey-Fuller (ADF) test is the primary tool for checking stationarity. Its null hypothesis states the presence of a unit root, i.e., non-stationarity. In practice, a trader takes daily closing prices over two to three years, runs them through the ADF test, and looks at the p-value. If the p-value is less than 0.05, the null hypothesis is rejected, and the series can be considered stationary over the chosen time window. An important nuance: the ADF test requires specifying the number of lags. Too few lags lead to residual autocorrelation; too many reduce the test’s power. The optimal approach is to use the Akaike Information Criterion (AIC) for automatic selection.
In Python, the test is performed using the statsmodels library:
python
from statsmodels.tsa.stattools import adfuller
result = adfuller(close_prices, autolag=’AIC’)
print(f’ADF Statistic: {result[0]:.4f}’)
print(f’p-value: {result[1]:.4f}’)
f the p-value > 0.05, the series is non-stationary, and pure mean reversion is contraindicated. For pairs that do not pass the test on prices, the spread between two cointegrated assets is sometimes tested—this forms the basis of pair trading.
The KPSS test is also worth mentioning. Unlike the ADF test, its null hypothesis assumes stationarity. Using the ADF and KPSS tests together provides more reliable conclusions: if the ADF test rejects a unit root and the KPSS test does not reject stationarity, the series has strong grounds to be considered stationary.
Trading Bollinger Bands and Overbought/Oversold Zones
The Bollinger Bands indicator is a natural tool for mean-reversion strategies. It consists of a central moving average and two bands located N standard deviations away (usually 2). Statistically, under a normal distribution, about 95% of all prices should fall within the bands. A breakout beyond the band is interpreted as an extreme deviation, after which a reversion follows.
Classic reversal logic: when the price touches or breaks below the lower Bollinger Band, a long position is opened; when it breaks above the upper band, a short position is opened. The profit target is the central moving average. However, a direct breakout of the band is often a signal of the start of a trend, not its end. Therefore, a filter is essential: overbought/oversold conditions on RSI or Stochastic. If the price breaks below the lower band but RSI(14) has not yet fallen below 30, the signal is premature. If the band is broken and the RSI confirms the extreme, the probability of a successful trade increases.
Another important filter is the state of the market itself. Bollinger Bands contract before a strong move (squeeze) and expand during a trend. Mean reversion works best when the band width is stable and the market is in a consolidation phase. An ADX below 20 confirms the absence of a pronounced trend and permits mean-reversion entries. When ADX is above 25, it is better to avoid the strategy.
The Danger of Martingale and Averaging
The temptation to use Martingale arises inevitably. If the price continues to move against the position, it seems logical to add another lot: the deviation from the mean is increasing, so a reversion becomes “even more likely.” This is a deadly trap. A time series can remain non-stationary over a horizon exceeding the life of the deposit. A classic example is EURCHF on January 15, 2015, when the Swiss National Bank unexpectedly removed the currency peg, and the pair collapsed 30% within minutes. Traders averaging long positions from the Bollinger Bands lost everything.
Averaging without a stop-loss violates the basic principle of risk management: the maximum loss must be known before entering a trade. The mathematical expectation of a series of mean-reversion entries may be positive, but a sequence of losses will eventually lead to ruin given limited capital. Even if the pair is indeed stationary, extreme deviations do occur, and recovery can take weeks or months, during which the position will remain in deep drawdown, consuming swaps and margin.
Implementing a Protective Stop-Loss in Code
A stop-loss for a mean-reversion system must account for the instrument’s volatility. It is logical to place it beyond the extreme deviation considered statistically significant. For example, if entry occurs at the touch of two standard deviations, the stop-loss is set at the level of three standard deviations. This approach relies on the three-sigma rule: the probability of exceeding three sigmas under a normal distribution is 0.3%. However, market distributions have “fat tails,” so a purely statistical stop requires an additional buffer.
An alternative approach is a volatility-based stop using ATR. If ATR(14) equals X, the stop is placed 1.5–2 ATR away from the entry price. This adapts the protective level to current market activity. In high-volatility periods, the stop widens to prevent premature exit; in quiet periods, it narrows to limit risk.
Example implementation in MQL5 for a buy from the lower Bollinger Band:
mql5
double atr = iATR(_Symbol, PERIOD_H1, 14);
double sl_distance = 2.0 * atr;
double stop_loss = NormalizeDouble(Ask – sl_distance, _Digits);
double bb_lower = iBands(_Symbol, PERIOD_H1, 20, 2, 0, PRICE_CLOSE, MODE_LOWER, 0);
double rsi = iRSI(_Symbol, PERIOD_H1, 14, PRICE_CLOSE, 0);
if(Ask <= bb_lower && rsi < 30 && PositionSelect(_Symbol) == false)
{
double tp = NormalizeDouble(Ask + sl_distance * 2.5, _Digits);
trade.Buy(0.1, _Symbol, Ask, stop_loss, tp, “MeanReversion”);
The key ratio: the take-profit must be at least 2–2.5 times the stop-loss. Since mean-reversion systems often have win rates around 60–70%, the mathematical expectation becomes positive only with an asymmetric risk-to-reward ratio. A stop-loss embedded in the code also protects against connection drops, terminal freezes, and other technical failures that could turn a controlled drawdown into a catastrophic los
Conclusion
Mean reversion in the forex market is a viable strategy, but with strict limitations. It requires a stationary instrument confirmed by statistical testing, signal filtering with trend indicators, and a mandatory stop-loss. Ignoring any of these conditions turns a mathematically sound system into a gamble with a predictable outcome. The ADF test should become a ritual before launching any reversal system, and a protective order—a non-removable part of the code. The market periodically refuses to revert to the mean precisely when the trader believes in it most.
Comments
No comments yet. Be the first to share your thoughts!
Comments only for logged-in users.