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 Trend State Forecast Pullback strategy is a trend-following pullback system built on Holt's Linear Trend method — a form of double exponential smoothing that maintains two evolving "state" values on every bar: a smoothed price Level and a separately smoothed Trend (per-bar slope, or drift). Rather than reacting to a single moving-average line, the strategy models where price is and how fast it is moving, then uses that modelled slope to define the trading regime. It is designed for markets that develop persistent, orderly directional moves rather than choppy, sideways conditions.
The core idea is classic and conservative: trade the pullback, not the breakout. When the model detects a statistically meaningful drift, the strategy waits for a shallow retracement back to its own baseline and then enters in the direction of the established trend once price reclaims that baseline. Because entries occur on dips rather than on stretched momentum spikes, the approach aims for a favorable, structurally-defined stop-loss placement and a lower drawdown profile.
As a learning tool, this strategy is well suited to traders who want to understand how forecasting-based smoothing differs from ordinary moving averages. Holt's method leads a same-period Exponential Moving Average (EMA) in a trend because it projects the slope forward, and its explicit trend state is used here as a regime filter. Studying it is a good way to see how volatility normalization (via the Average True Range, or ATR), pullback confirmation, and forecast-based entry filtering can be combined into a single rules-based system.
How It Works
The strategy advances the Holt Level and Trend states once per completed bar, then checks a sequence of conditions. Every rule is fully symmetric for long and short setups.
Building the model each bar:
- The Level is updated as a low-lag adaptive baseline:
Level = a Close + (1 - a) (Level + Trend). - The Trend (slope) is smoothed on its own:
Trend = b (Level change) + (1 - b) Trend. - The forecast projects forward:
Forecast = Level + h * Trend, wherehis the forecast horizon.
Regime filter (are we trending?):
- The Trend state is normalized by ATR to produce a dimensionless slope:
s = Trend / ATR. - A long regime is active only when
sis greater than or equal to the SlopeGate. - A short regime is active only when
sis less than or equal to the negative SlopeGate. - Flat or choppy drift falls between the gates and is ignored, so the strategy signals no trades in directionless conditions.
Reclaim filter (is this a genuine pullback?):
- The prior completed bar must have closed on the counter-trend side of the Level line (evidence of a real dip).
- The current completed bar must close back through the Level in the trend direction — a fresh one-bar reclaim of the model baseline.
- The candle body must confirm resumption: a bullish body for longs (close above open), a bearish body for shorts.
No-chase filter (is there still room to run?):
- For a long, the close must remain at or below the forecast (
Close <= Level + h * Trend), meaning price has not already overshot where the model projects. - For a short, the mirror condition applies. This blocks entries on already-stretched bars.
Stop-loss logic:
- The stop is placed just beyond the recent pullback extreme — the lowest low (for longs) or highest high (for shorts) over the lookback window — plus a small ATR buffer. This is a natural invalidation point.
- If the resulting stop distance would be wider than
MaxStopAtr * ATR, the setup is rejected entirely to keep per-trade risk bounded.
Take-profit and trade management:
- The take-profit is set as a reward-to-risk multiple of the stop distance (RewardRatio).
- Once price advances by BreakevenR multiples of the initial risk, the stop is moved to break-even.
- After that, the stop trails price by
TrailAtrMult * ATR, locking in favorable movement while giving the trend room to continue.
The strategy allows only one open position per magic number at a time and requires a warmup period before it begins evaluating signals.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| LevelAlpha | 0.25 | 0.05 | 0.60 | Level smoothing constant (a). Higher values make the baseline more responsive to recent price. |
| TrendBeta | 0.10 | 0.02 | 0.40 | Trend (slope) smoothing constant (b). Higher values let the modelled slope react faster. |
| SlopeGate | 0.08 | 0.02 | 0.30 | Minimum absolute Trend/ATR per-bar slope required for a valid trend regime. |
| AtrPeriod | 14 | 5 | 40 | ATR period — the volatility unit used for the slope gate, stops, and trailing. |
| PullbackBars | 3 | 1 | 8 | Lookback (completed bars) used to locate the structural pullback extreme for the stop. |
| ForecastHorizon | 3 | 1 | 10 | Forecast horizon (h) used in the no-chase filter, Level + h*Trend. |
| MaxStopAtr | 2.5 | 1.0 | 5.0 | Rejects any setup whose structural stop is wider than this many ATR. |
| StopBufferAtr | 0.15 | 0.0 | 0.60 | Extra stop buffer placed beyond the pullback extreme, in ATR. |
| RewardRatio | 2.0 | 1.0 | 4.0 | Take-profit expressed as a reward-to-risk multiple of the stop distance. |
| BreakevenR | 1.0 | 0.3 | 2.0 | Moves the stop to break-even after price advances this multiple of risk. |
| TrailAtrMult | 2.0 | 0.5 | 4.0 | ATR multiple for the trailing stop once break-even is armed. |
| Lots | 0.10 | 0.01 | 1.0 | Order volume (position size) in lots. |

Recommended Chart Settings
This strategy was designed with liquid intraday forex and index trends in mind — for example, EURUSD or US100 (US Tech 100) on the M15 to H1 timeframes. However, the timeframe is never hardcoded; the system uses whatever timeframe the chart or backtest selects, so you are free to test it elsewhere.
Because the approach depends on persistent directional drift, it tends to behave differently across market conditions. Trending sessions provide the clean pullbacks the model is built to detect, while ranging or highly erratic conditions produce fewer valid signals. Always remember that results will vary across symbols, timeframes, and market regimes, and that no single configuration performs the same in all environments.
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 Trend State Forecast Pullback method has several thoughtful design features. By modelling slope explicitly and normalizing it with ATR, it adapts its regime filter to current volatility rather than relying on a fixed threshold. Entering on pullbacks (reclaims of the baseline) rather than breakouts historically places stops at natural structural points, which can support a lower-drawdown risk profile. The no-chase forecast filter is an intelligent touch that discourages entries on already-extended bars, and the break-even-plus-trail management logic aims to protect gains once a move develops.
Known limitations. Like all trend-following systems, this strategy depends on trends actually forming and persisting. In prolonged sideways or whipsaw markets, the slope gate may keep it flat for long stretches, or it may trigger reclaims that quickly reverse. Double exponential smoothing reduces lag compared with a plain moving average but does not eliminate it, so entries can still arrive after part of a move has already occurred. The requirement for a with-trend candle body and a fresh baseline reclaim means some genuine trends will be missed because the exact confirmation sequence did not appear.
Where it may underperform. Choppy ranges, news-driven volatility spikes, and low-liquidity sessions can all generate misleading signals or wider-than-expected stops (which the MaxStopAtr filter will then reject, reducing trade frequency). Parameter choices such as LevelAlpha, TrendBeta, and SlopeGate materially change behavior, and values tuned to one market may not transfer to another. Treat this EA as a framework for studying trend-and-pullback logic, not as a finished, hands-off solution.
Risk Management Tips
Sound risk management matters far more than any single entry technique. Consider the following general principles as part of your education:
- Position sizing: Keep individual trade risk small relative to your account. A common guideline is risking no more than 1–2% of account equity per trade, adjusting the Lots parameter accordingly.
- Understand drawdown: Every strategy experiences losing streaks. Review how large a drawdown you could tolerate emotionally and financially before committing real capital.
- Test on a demo account first: Run the EA on a demo or simulated environment to observe how it behaves across different conditions before considering live use.
- Respect the structural stop: The strategy's stop placement is part of its logic. Disabling or widening stops manually undermines the risk controls the system is built around.
- Diversify and avoid over-leverage: Concentrating risk in a single symbol, timeframe, or highly leveraged position can amplify losses quickly.
- Keep expectations realistic: No parameter set eliminates losing trades. Focus on process discipline and consistent risk control rather than any single outcome.
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: TrendStateForecastPullback.ex5 (17 downloads)
- Source Code: TrendStateForecastPullback.mq5 (22 downloads)
- Documentation: TrendStateForecastPullback.pdf (22 downloads)