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?
Trend Pullback Reclaim is a trend-following continuation system that combines an Exponential Moving Average (EMA) — a moving average that weights recent prices more heavily — with the Relative Strength Index (RSI), a momentum oscillator that measures how quickly price has risen or fallen on a scale of 0 to 100. Rather than trying to catch tops and bottoms, this strategy studies an existing trend, waits for a temporary dip against that trend, and then looks for momentum to "reclaim" its direction before signalling an entry. In plain terms, it is a structured way to study the classic "buy-the-dip / sell-the-rip" idea.
The strategy is designed for trending market conditions on liquid instruments. It is built to stay out of sideways, choppy price action by requiring the trend-defining EMA to be genuinely sloping, not merely drifting. When markets are ranging, the strategy is intended to produce few or no signals at all — a deliberate trade-off that favours quality of setup over quantity.
As a learning tool, Trend Pullback Reclaim is well suited to traders who want to understand how multiple filters can be layered to define a single high-conviction entry. It demonstrates confluence (several independent conditions agreeing), momentum timing, and volatility-based risk sizing in one package. It is not a shortcut and should be treated as an educational study of a discretionary concept expressed in code.
How It Works
The strategy evaluates its logic once per newly closed bar. Three independent filters must line up before any entry is signalled, and the short side is a mirror image of the long side.
- Trend regime filter (the direction): The strategy measures the slope of a long EMA over a set number of bars. For an up-regime, the EMA must have travelled upward by at least a minimum amount, defined as a fraction of the current Average True Range (ATR) — a measure of typical volatility. A down-regime requires the mirror downward travel. If the EMA is flat or drifting, no regime is declared and the strategy stays idle.
- Pullback filter (arming the setup): Inside an up-regime, the strategy waits for RSI to cool back down to the pullback level, indicating a dip within the uptrend rather than a full reversal. In a down-regime it waits for RSI to heat up to the mirror level. When this happens, the setup becomes "armed" for a limited number of bars.
- Reclaim trigger (the entry): While armed long, the strategy signals an entry only when RSI crosses back up through the pullback level on a bullish bar (close above open) — momentum resuming in the trend direction. While armed short, it requires RSI to cross back down through the mirror level on a bearish bar.
- "Don't-chase" gate: Any reclaim is rejected if the closing price is more than a set number of ATRs away from the EMA. This keeps entries close to the mean and is the strategy's primary drawdown-control mechanism — it avoids buying pullbacks that have already stretched far from value.
- Stop-loss logic: When an entry is signalled, the stop-loss is placed a multiple of ATR away from the entry price. Because ATR expands and contracts with volatility, the stop automatically widens in fast markets and tightens in calm ones.
- Take-profit logic: The take-profit is placed a larger multiple of ATR away from entry, so the intended reward-to-risk profile favours the trend the strategy is trying to ride.
- Position management: The strategy holds only one position at a time per magic number. While a trade is live, no new setups are armed. A regime flip, a return to a flat market, or an expired arm-timer all cancel a pending setup.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| TrendEmaPeriod | 100 | 40 | 200 | Length of the trend-defining EMA. Longer values define slower, broader trends. |
| EmaSlopeBars | 5 | 2 | 15 | How many bars back the EMA slope is measured over. |
| MinSlopeAtrFrac | 0.15 | 0.0 | 1.0 | Minimum EMA travel over the slope window, as a fraction of ATR, to count as a real trend. Filters out flat or choppy regimes. |
| RsiPeriod | 14 | 6 | 25 | Lookback length for the RSI momentum oscillator. |
| PullbackRsi | 42 | 30 | 48 | The pullback / reclaim RSI level for longs. Shorts mirror this at 100 − value. |
| MaxAtrFromEma | 2.5 | 0.5 | 5.0 | Rejects a reclaim if price is further than this many ATRs from the EMA (the "don't-chase" gate). |
| ArmExpiryBars | 6 | 2 | 15 | Number of bars an armed pullback stays valid before it expires unfilled. |
| AtrPeriod | 14 | 7 | 28 | ATR period used for stop-loss and take-profit sizing. |
| AtrSlMult | 2.0 | 1.0 | 4.0 | Stop-loss distance as a multiple of ATR. |
| AtrTpMult | 3.0 | 1.0 | 6.0 | Take-profit distance as a multiple of ATR. |
| BaseLots | 0.10 | 0.01 | 1.0 | Base lot size at the starting equity, scaled up or down with the account. |
| MaxLots | 2.0 | 0.1 | 10.0 | Hard cap on the equity-scaled lot size. |

Recommended Chart Settings
Trend Pullback Reclaim was designed with liquid, trend-prone markets in mind — for example major forex pairs such as EURUSD and GBPUSD, or an index CFD such as US500. It is intended to run on intermediate timeframes, roughly M15 to H4, where trends have room to develop but noise is manageable. The timeframe is never hardcoded, so the strategy will operate on whatever chart period you attach it to.
Because market character changes over time, results will vary considerably across different symbols, timeframes, and periods. A configuration that behaves well on one instrument may behave very differently on another. Treat any chart setting as a starting point for your own study rather than a fixed recommendation.
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. By insisting on three aligned filters — trend, pullback, and reclaim — the strategy is structurally selective. The minimum-slope requirement is designed to keep it out of directionless markets, and the "don't-chase" gate discourages entries far from the mean. ATR-based stops and targets mean the risk framework adapts to changing volatility rather than using fixed distances. These are sensible, widely taught principles worth studying in a working example.
Known limitations. Every trend-continuation method shares the same fundamental weakness: it assumes the trend will persist after the pullback. When a trend quietly ends, a "pullback" is really the start of a reversal, and the reclaim trigger can lead directly into a losing trade. RSI-based timing can also produce false crosses in fast, gappy conditions. Low-frequency strategies like this one can go through long stretches with few signals, which tests patience and makes performance harder to evaluate over short samples.
Where it may underperform. Range-bound, choppy, or news-driven whipsaw markets are the natural enemy of this design. The slope filter helps, but no filter is perfect, and a market that alternates between weak trends and reversals may generate a string of losses. Sharp volatility spikes can widen ATR-based stops in ways that change the effective risk of a trade.
Risk Management Tips
Regardless of the strategy, sound risk management is what keeps a trading account alive long enough to learn:
- Size positions conservatively. A common educational guideline is to risk no more than 1–2% of account equity on any single trade. Set your lot sizing so a full stop-loss stays within that limit.
- Test on a demo account first. Run the EA on a demo or paper account across many different market conditions before considering any live use. This is how you learn the strategy's behaviour without financial consequences.
- Understand drawdown. Every strategy experiences losing streaks. Study how deep the equity dips can get so you are mentally and financially prepared for them.
- Never over-leverage. Leverage amplifies losses as much as gains. Keep it modest while you are still learning.
- Only commit capital you can afford to lose. Treat trading as a skill to be developed, not a solution to financial pressure.
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: TrendPullbackReclaim.ex5 (0 downloads)
- Source Code: TrendPullbackReclaim.mq5 (0 downloads)
- Documentation: TrendPullbackReclaim.pdf (1 downloads)