Blog / Strategy
Strategy

Atr Stretch Reversion

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

Atr Stretch Reversion is a mean-reversion trading strategy that combines the Average True Range (ATR) — a volatility gauge — with an Exponential Moving Average (EMA) anchor and a Relative Strength Index (RSI) confirmation filter. In plain terms, it is a "rubber-band" fade: markets frequently over-stretch away from their average price, and this approach studies how price behaves when it snaps back toward that average. The trading style here is counter-trend mean reversion on a single timeframe, with symmetric rules for both long and short trades.

The core idea rests on a simple observation. Price tends to orbit a moving average, but from time to time it stretches unusually far away from it. The strategy uses ATR to define what "unusually far" means in a statistical sense, rather than relying on a fixed number of pips. When the prior bar pushes beyond the EMA by a multiple of ATR — an over-extension — and the very next bar rejects that extreme by closing back toward the mean, the strategy treats this as a possible exhaustion point and signals a fade in the opposite direction.

As a learning tool, Atr Stretch Reversion is well suited to traders who want to study how volatility-scaled bands, momentum confirmation, and disciplined risk management fit together in a single, readable rule set. It is an objective, non-repainting system: every decision is made on a bar that has already closed. This makes it a clear example for understanding mean-reversion logic. It is not a shortcut to results, and it is best explored on a demo account where you can observe how the signals behave across different market conditions.

How It Works

The strategy evaluates its rules only when a new bar has fully closed, which avoids the "repainting" problem where signals appear and then vanish mid-bar. It looks at two recently closed bars: the over-extension bar (two bars back) and the signal bar (the most recently closed bar, also called the reclaim bar). It then confirms with RSI before acting.

Long entry — the strategy signals a buy when all of these are true:

Short entry — the strategy signals a sell when all of these are true (mirror image):

Stop-loss logic: When a trade is opened, the stop-loss is placed at a distance of SlAtrMult × ATR from the entry price. Because the distance scales with ATR, the stop automatically widens in volatile conditions and tightens in calm ones.

Take-profit logic: The take-profit is set at TpAtrMult × ATR from entry, again scaled to current volatility. With the default settings, the profit target sits farther from entry than the stop, giving the trade a reward-to-risk structure greater than one.

Breakeven management: On every tick, the strategy checks open trades. Once price has moved in the trade's favour by BreakevenAtr × ATR, the stop-loss is pulled up (or down, for shorts) to the entry price. This may reduce exposure on a trade that has already moved favourably. The strategy also holds only one position at a time, which keeps the fade clean and risk bounded.

ATR mean reversion MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
EmaPeriod 50 20 150 Look-back period for the EMA that anchors the "mean" price.
AtrPeriod 14 7 28 Look-back period for ATR, which measures recent volatility.
RsiPeriod 14 7 21 Look-back period for the RSI momentum confirmation filter.
StretchMult 2.00 1.00 4.00 ATR multiple that defines an over-extension: EMA ± StretchMult × ATR.
RsiOversold 30 15 40 RSI level marking oversold; overbought is derived as 100 − this value.
SlAtrMult 1.50 0.50 4.00 Stop-loss distance expressed in ATRs.
TpAtrMult 2.00 0.50 6.00 Take-profit distance expressed in ATRs.
BreakevenAtr 1.00 0.00 3.00 ATRs of favourable movement before the stop is moved to entry (0 disables it).
Lots 0.10 0.01 1.00 Order volume in lots.
ATR mean reversion MT5 EA — MQL5 source code

Recommended Chart Settings

Atr Stretch Reversion is a single-timeframe strategy, so it reads all of its indicators and price data from the chart it is attached to. Mean-reversion fades tend to be studied most often on liquid instruments such as major forex pairs, and on intraday timeframes like the M15 or H1 chart, where over-extensions and reclaims occur frequently enough to observe. That said, the default parameters are a starting point for study, not a tuned configuration.

Because ATR and RSI behave differently across instruments and sessions, results will vary considerably across different symbols, timeframes, and market conditions. Trending markets in particular can behave very differently from the ranging conditions that favour mean reversion. Test any settings thoroughly in the MetaTrader 5 Strategy Tester and on a demo account before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The logic is objective and transparent: every entry requires an ATR-defined over-extension, a reclaim bar, and an RSI confirmation, so there is no discretionary guesswork. Using ATR to scale the bands, stops, and targets means the strategy adapts to changing volatility instead of relying on fixed pip distances. The one-position-at-a-time rule and the breakeven mechanism are both designed to keep risk bounded and easy to reason about. It also acts only on closed bars, so signals do not repaint.

Known limitations. Mean-reversion strategies share a well-known weakness: they assume price will snap back toward the average, but in a strong, persistent trend the "over-extension" can simply keep extending. Fading a powerful trend can lead to a sequence of losing trades. The RSI and reclaim-bar filters are meant to reduce this risk by demanding evidence of exhaustion, but no filter removes it entirely.

Where it may underperform. Expect this style to struggle during trending or news-driven markets, where price breaks away from its mean and does not return quickly. Low-volatility, choppy conditions can also produce weak or ambiguous ATR bands. As with any parameter-based system, there is a risk of over-fitting settings to past data that then fail to hold up going forward. Treat this EA as a framework for learning how these indicators interact — not as a finished, market-ready solution.

Risk Management Tips

Sound risk management matters more than any single entry rule. Consider these general principles as you study this strategy:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog