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?
The Elastic Tension Reversion strategy is a mean-reversion Expert Advisor (EA) built around two classic indicators: an Exponential Moving Average (EMA) — a moving average that weights recent prices more heavily — and the Average True Range (ATR), a standard gauge of volatility. It borrows a physical metaphor from Hooke's law: price is modeled as a mass tethered to a moving "rest position" by an elastic spring. The further price is pulled away from that equilibrium, the more tension the spring stores, and the stronger the restoring force that could snap price back. This is a counter-trend, range-oriented trading style rather than a momentum or breakout approach.
Instead of measuring stretch in raw price terms, the strategy normalizes displacement by ATR. That means "how far is price from the EMA" is expressed in volatility units, so the same logic adapts automatically whether a market is calm or choppy. Crucially, a stretched spring alone is not treated as a trade signal — a trending market can keep pulling price further from its average for a long time. The strategy instead waits for evidence that the spring has actually begun to release before it acts.
As a learning tool, Elastic Tension Reversion is well suited to traders who want to study how mean-reversion logic can be made volatility-adaptive and regime-aware. It combines a displacement threshold, a velocity (bar-to-bar momentum) confirmation, and a trend filter, so it is a compact example of how several conditions can be layered to reduce low-quality signals. This article explains how the mechanics fit together; it is an educational analysis, not a profit opportunity.
How It Works
The EA acts once per closed bar on whatever timeframe the chart is set to. On each new bar it recalculates the EMA (the spring's rest position) and the ATR (the market's natural "jitter" scale), then evaluates a sequence of conditions.
Entry conditions — the strategy signals a long when:
- Stretch below equilibrium: the closing price sits below the EMA by at least
StretchAtr× ATR. Displacement is measured asClose − EMAand divided by ATR, so the "stretch" is expressed in volatility units. - Velocity turns up: the most recent close-to-close change is positive after the prior change was flat or negative. This suggests the spring has just started releasing back toward the mean rather than stretching further.
- Flat regime: the EMA slope over
SlopeLookbackbars, divided by ATR, is smaller thanSlopeAtrMax. If the average is trending strongly, the strategy steps aside because the spring/oscillator model applies best to ranging conditions.
The strategy signals a short under the mirror-image conditions: price stretched above the EMA by at least StretchAtr × ATR, velocity just turning down, and the regime still flat.
Exit logic combines three mechanisms:
- Return-to-rest exit (dynamic): if an open long has seen price reclaim the (moving) EMA, the position is closed — the spring is considered discharged, banking the reversion even if the fixed target was not touched exactly. Shorts close when price falls back to or below the EMA.
- Take-profit: the target is placed at the equilibrium (EMA) level. If the EMA has already been reclaimed at entry, a fallback target of
TargetAtr× ATR is used instead. - Stop-loss: a fixed stop is placed
StopAtr× ATR beyond the entry, positioned past the stretched extreme so that a spring which keeps stretching (a failed reversion) is cut at a defined distance.
Only one position per magic number is held at a time, so the strategy does not stack trades. This keeps the logic simple to study and the risk per idea contained to a single position.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| EmaPeriod | 34 | 10 | 120 | Period of the EMA that defines the spring's "rest position" (equilibrium). Larger values create a slower, smoother baseline. |
| AtrPeriod | 14 | 5 | 40 | Lookback for the ATR used to measure volatility and normalize stretch, stops, and targets. |
| StretchAtr | 2.2 | 0.8 | 5.0 | Minimum displacement from the EMA, in ATR multiples, required to arm a trade. Higher values demand a more extreme stretch. |
| SlopeLookback | 8 | 3 | 30 | Number of bars used to measure the EMA slope for the trend (regime) filter. |
| SlopeAtrMax | 1.0 | 0.2 | 3.0 | Maximum EMA slope (relative to ATR) allowed for the regime to count as "flat." Trades are skipped above this. |
| StopAtr | 1.6 | 0.5 | 5.0 | ATR multiple used to place the stop-loss beyond the stretched extreme. |
| TargetAtr | 2.5 | 0.5 | 6.0 | ATR multiple for the fallback take-profit, used when the EMA has already been reclaimed at entry. |
| Lots | 0.10 | 0.01 | 1.0 | Trade volume in lots. Should be sized to your account and risk tolerance. |

Recommended Chart Settings
Elastic Tension Reversion is a single-timeframe, indicator-based strategy, and it reads whatever symbol and timeframe the chart is set to at run time. Mean-reversion logic of this kind is often studied on liquid forex pairs such as EUR/USD or GBP/USD, where ranging behavior is common, and on intraday-to-swing timeframes such as M15, M30, or H1, where the ATR and EMA measurements have enough bars to stabilize.
Because the strategy is volatility-adaptive, the same defaults can behave very differently across instruments and sessions. Results will vary across different market conditions, so treat any chosen symbol/timeframe as a starting point for your own testing rather than a fixed recommendation. Always study the behavior on historical data and a demo account before drawing conclusions.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below
- Copy it to your MT5
MQL5\Expertsfolder - Restart MetaTrader 5 or refresh the Navigator panel
- Drag the EA onto a chart matching the recommended symbol and timeframe
- Configure the input parameters and enable Algo Trading
What to Consider Before Using This EA
Strengths of the approach. The strategy is a clean example of layered filtering. Rather than fading every stretch, it requires three conditions to align — displacement, a velocity turn, and a flat regime — which historically reduces the number of premature counter-trend entries. Normalizing everything by ATR makes the logic self-scaling across quiet and volatile periods, and the dynamic "return-to-rest" exit is a thoughtful way to bank a reversion when price reclaims its moving average without waiting for a fixed target.
Known limitations. Mean-reversion systems share a well-documented weakness: they can be caught on the wrong side of a strong, persistent trend. The regime filter (SlopeAtrMax) is designed to mitigate this, but no slope filter is perfect, and a market can transition from ranging to trending faster than the EMA slope updates. In those conditions the strategy may fade a move that keeps going, and the fixed ATR stop is what defines the downside on such trades.
Where it may underperform. Strongly trending markets, news-driven gaps, and low-liquidity sessions can all challenge a reversion model. The velocity turn uses only the two most recent bar-to-bar changes, so it can be triggered by noise as well as by genuine reversals. Because only one position is held at a time, the strategy trades selectively — this is a feature for risk control but means signals may be infrequent on some instruments. None of this is a verdict on the strategy; it is context you should weigh, test, and monitor yourself.
Risk Management Tips
Sound risk management matters more than any single entry rule. Consider these general principles as you study this EA:
- Position sizing: set
Lotsso that the distance to your stop represents only a small slice of your account. Many educational sources suggest risking no more than 1–2% of account equity on any single trade. - Understand drawdown: even a well-constructed strategy will experience losing streaks. Review the maximum historical drawdown before committing capital, and ask whether you could tolerate it emotionally and financially.
- Start on demo: run the EA on a demo account first to understand how it behaves in live conditions, including spread, slippage, and execution timing that backtests may not fully capture.
- Diversify and avoid over-leverage: concentrating risk in one instrument or using excessive leverage can turn a normal drawdown into a serious loss.
- Monitor, don't set-and-forget: market regimes change. Periodically review whether the flat-regime assumption still holds for the instrument you are trading.
Risk management is about survival and consistency, not about chasing outcomes. Treat every parameter as something to be tested, not trusted.
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
- Expert Advisor: ElasticTensionReversion.ex5 (8 downloads)
- Source Code: ElasticTensionReversion.mq5 (9 downloads)
- Documentation: ElasticTensionReversion.pdf (12 downloads)