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 Sequential Setup Reversal strategy is a price-action exhaustion and mean-reversion system inspired by Tom DeMark's well-known "Sequential Setup" counting logic. Rather than relying on oscillators, moving averages, or volume, it reads a market purely through the geometry of closing prices measured against their own recent history. In technical terms, a mean-reversion approach assumes that a market which has stretched too far in one direction tends to snap back toward a more balanced level, and this strategy tries to identify the moment that snap-back becomes probable.
What makes this method different from a plain "consecutive higher/lower close" streak is the use of a fixed comparison lag. Instead of comparing each close to the bar immediately before it, every close is compared to the close a set number of bars earlier (four by default). When a run of bars all close beyond that lagged reference, the strategy interprets it as a genuine, sustained directional drift rather than short-term noise. A persistent downward drift is read as sellers exhausting themselves — a potential buy setup — while a persistent upward drift is read as buyers exhausting — a potential sell setup.
As a learning tool, Sequential Setup Reversal is well suited to traders who want to study counter-trend and exhaustion concepts on liquid FX pairs. It is symmetric (it has distinct long and short rules), it fires selectively, and it uses volatility-scaled risk. It is best treated as a framework for understanding how structured price-action counting works — not as a shortcut to any particular outcome.
How It Works
The strategy processes one completed bar at a time on your chosen timeframe. On each newly closed bar it counts two separate "setups" and checks whether either has just completed. Here is the logic in plain English:
- Bar comparison (the lagged count): The strategy compares the most recent close to the close
ComparisonLagbars earlier. It then walks backward, counting how many consecutive bars satisfy the same condition. - Buy setup: The strategy signals a potential long when it counts
SetupLengthconsecutive bars whose close is below the close fromComparisonLagbars earlier. This represents a persistent downdrift that may indicate sellers are running out of momentum. - Sell setup: The strategy signals a potential short when it counts
SetupLengthconsecutive bars whose close is above the close fromComparisonLagbars earlier — a persistent updrift that may indicate buyers are running out of momentum. - The "perfection" filter (optional): When
RequirePerfectionis enabled, a setup is only accepted if the move has pressed to a genuinely fresh extreme at the point of exhaustion. For a buy, the lowest low of the last two setup bars must be at or below the lowest low of the two bars before them; for a sell, the highest high of the last two bars must be at or above the two before them. This DeMark refinement helps confirm the move truly overstretched right where a reversal tends to ignite. - One-time firing: The signal fires exactly once — on the bar that completes the count. A longer run does not re-fire, and any interruption of the sequence resets the count, so a brand-new setup must form before another signal can appear.
- Single position rule: Only one position per magic number is held at a time. While a trade is open, no new signals are taken; the stop-loss and take-profit manage the exit.
Stop-loss and take-profit logic are both volatility-based, using the Average True Range (ATR) — a common measure of how much a market typically moves per bar:
- The stop-loss is placed
AtrStopMultATRs away from the entry price, giving the trade room proportional to current market noise. - The take-profit is placed
AtrTargetMultATRs away from entry. With the defaults (1.5 ATR stop, 2.0 ATR target), the intended reward-to-risk ratio is roughly 1.3-to-1. - For a long, the entry uses the ask price, the stop sits below entry, and the target sits above. For a short, the entry uses the bid, the stop sits above, and the target below. If ATR cannot be computed or is zero, no trade is placed.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SetupLength | 9 | 5 | 13 | Number of consecutive lagged-qualifying bars required to complete a setup. Higher values demand a longer, more sustained drift before signalling. |
| ComparisonLag | 4 | 2 | 6 | How many bars back each close is compared against (the DeMark lag). Larger values tolerate more intrabar wobble and emphasise longer drifts. |
| RequirePerfection | 1 | 0 | 1 | 1 = require the "perfection" fresh-extreme filter; 0 = accept a raw count. Enabling it produces fewer but more selective signals. |
| AtrPeriod | 14 | 7 | 30 | ATR lookback used to size the stop and target. Shorter reacts faster to volatility changes; longer is smoother. |
| AtrStopMult | 1.5 | 0.5 | 4.0 | Stop-loss distance expressed as a multiple of ATR from the entry price. |
| AtrTargetMult | 2.0 | 0.5 | 6.0 | Take-profit distance expressed as a multiple of ATR from the entry price. |
| Lots | 0.10 | 0.01 | 1.0 | Order volume (position size) in lots. |

Recommended Chart Settings
Sequential Setup Reversal was designed with liquid FX swing timeframes in mind — think H1 (1-hour) and H4 (4-hour) charts on major currency pairs such as EUR/USD, GBP/USD, or USD/JPY, where spreads are tight and closing prices are meaningful. The strategy is single-timeframe: every calculation uses the timeframe of the chart it is attached to, so you can experiment on other timeframes, but the exhaustion logic is most coherent on higher-timeframe swing charts rather than very fast intraday periods.
Because the method is inherently counter-trend, it tends to behave differently across ranging, trending, and volatile conditions. Results will vary considerably from one market environment to another, and no single symbol or timeframe is guaranteed to suit it. Always test any configuration on your own broker's data before drawing conclusions.
How to Install on MetaTrader 5
- Download the
.ex5file 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
Like every strategy, Sequential Setup Reversal has clear strengths and real limitations, and it is worth weighing both before you rely on it — even in testing.
Strengths. The approach is refreshingly transparent: it uses only closing-price geometry, so there is no indicator lag introduced by heavy smoothing, and every signal can be reconstructed by hand. The lagged comparison makes the count more robust than a naive consecutive-close streak, filtering out small intrabar wobble. The optional perfection filter adds a second layer of confirmation, and ATR-based stops adapt the risk to prevailing volatility rather than using a fixed distance that may be too tight or too wide.
Limitations. This is fundamentally a counter-trend system, and counter-trend methods face a well-known challenge: strong, persistent trends can keep extending far past the point where an exhaustion count completes. When that happens, the strategy may enter against a move that simply keeps going, and the stop is hit before any reversion materialises. The single-position rule also means the strategy sits out while a trade is open, so it can miss subsequent setups during fast markets. Finally, because signals fire only when a full count completes, the strategy trades relatively infrequently, which means performance can hinge on a small number of trades over any given period.
Where it may underperform. Expect the most difficulty during powerful, one-directional trends and during low-volatility drift where the count completes but no genuine reversal follows. Conversely, the logic is conceptually aligned with choppy, range-bound conditions where overstretched moves tend to mean-revert. Treat the perfection filter, setup length, and lag as levers to study rather than settings to optimise blindly — over-fitting to past data is one of the most common pitfalls in strategy research.
Risk Management Tips
Sound risk management matters far more than any single entry rule. As you study this strategy, keep these general principles in mind:
- Risk a small, fixed fraction per trade. A widely cited guideline is to risk no more than 1–2% of your account on any single position. Size your lots so that the ATR-based stop distance corresponds to that fraction, rather than trading a fixed lot size regardless of stop width.
- Understand your drawdown tolerance. Counter-trend systems can experience clusters of consecutive losing trades during strong trends. Know in advance how large a drawdown you are prepared to withstand, both financially and psychologically.
- Start on a demo account. Run the EA on a demo account first to observe how it behaves across different market conditions, and only consider live use once you fully understand its trade frequency and risk profile.
- Account for costs. Spreads, commissions, slippage, and swap can meaningfully affect a strategy that targets modest ATR-based moves. Include realistic costs in any evaluation.
- Never over-leverage. Leverage magnifies both gains and losses. Keep position sizes conservative and never commit capital you cannot afford to lose.
- Review and adapt. Markets evolve. Periodically review whether the parameters and assumptions still fit current conditions instead of assuming past behaviour will persist.
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: SequentialSetupReversal.ex5 (48 downloads)
- Source Code: SequentialSetupReversal.mq5 (52 downloads)
- Documentation: SequentialSetupReversal.pdf (55 downloads)