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 Continuation Factor Rider is a trend-following expert advisor (EA) built around the Trend Continuation Factor (TCF), a momentum-persistence indicator introduced by M. H. Pee in Stocks & Commodities magazine. Unlike a classic momentum oscillator that simply measures how far price has moved, the TCF measures how uninterrupted that movement has been. The core insight is that a genuine trend is not just net displacement — it is displacement that arrives in a clean, same-direction run without constant back-and-forth. This EA is designed to identify the moment a persistent, one-directional regime switches on and to ride that continuation.
The strategy is built for trending market conditions — periods when a symbol makes a series of higher closes (or lower closes) with relatively little counter-movement. It tends to sit on the sidelines during choppy, range-bound phases because the indicator's design penalises any move against the prevailing direction. That makes it a poor fit for tight sideways markets but potentially well-suited to instruments and timeframes that produce sustained directional swings.
As a learning tool, the Trend Continuation Factor Rider is a useful case study for traders who want to understand the difference between raw momentum and momentum persistence, and how a scale-free, ATR-based framework can make a single strategy behave consistently across different symbols and timeframes. It is best treated as an educational example of trend-emergence logic rather than a finished, ready-to-fund system.
How It Works
The strategy processes one fully-closed bar at a time. On each new bar it rebuilds a "continuation force" series and evaluates the two legs of the Trend Continuation Factor. Here is the logic in plain English:
- Building continuation force: For each bar the strategy measures the change from the previous close. An up-move adds to a running up-continuation sum; a down-move adds to a running down-continuation sum. Crucially, any counter-move resets the opposite side's streak to zero. A single down bar wipes out the accumulated up-streak, and vice versa. A perfectly flat bar breaks continuation on both sides.
- The two TCF legs: Over the
Lengthlookback window, the strategy computesTCF+(net up force, penalised by down-continuation) andTCF-(net down force, penalised by up-continuation). In a clean uptrend, up moves string together while down streaks never build — soTCF+stays positive andTCF-is driven negative at the same time. A clean downtrend prints the mirror image. - Long entry signal: The strategy signals a long when the just-closed bar makes
TCF+positive andTCF-negative, while the previous bar did not satisfy both. This "fresh" transition marks the moment up-continuation switches on rather than a trend already well underway. - Short entry signal: The strategy signals a short when the just-closed bar makes
TCF-positive andTCF+negative, while the previous bar did not — the moment down-continuation switches on. - Strength gate: A scale-free filter requires the dominant TCF value to exceed
MinStrengthAtr × ATR(Average True Range, a volatility measure). This screens out weak, ambiguous flips on any symbol or timeframe. Setting it to 0 disables the gate. - Flip management: Opposite fresh signals flip the book — the strategy closes the existing side and opens the new one — so it stays aligned with the live continuation regime. It will not stack multiple positions on the same side.
- Stop-loss logic: When a trade opens, the stop is placed
AtrStopMult × ATRaway from entry. Because it scales with current volatility, the stop widens in fast markets and tightens in calm ones. - Take-profit logic: The target is placed
AtrTpMult × ATRfrom entry. With the defaults (stop 2× ATR, target 3× ATR), each trade carries a roughly 1.5-to-1 reward-to-risk shape before spread and slippage.
Because every calculation reads from the primary timeframe selected at runtime, the strategy is timeframe-agnostic — nothing about the entry logic is hardcoded to a specific chart period.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| Length | 12 | 5 | 40 | Lookback window over which the continuation force is summed. Larger values demand a longer, more established run before signalling. |
| MinStrengthAtr | 1.00 | 0.00 | 5.00 | The dominant TCF must exceed this multiple of ATR to trade. Higher values filter out weaker flips; 0 disables the gate. |
| AtrPeriod | 14 | 5 | 30 | ATR period used for the strength gate and for stop/target distances. |
| AtrStopMult | 2.00 | 0.50 | 5.00 | Stop-loss distance as a multiple of ATR. Larger values give trades more room but risk more per position. |
| AtrTpMult | 3.00 | 0.50 | 8.00 | Take-profit distance as a multiple of ATR. Sets the profit target relative to volatility. |
| Lots | 0.10 | 0.01 | 1.00 | Fixed position size in lots. |
| Magic | 20514 | 0 | 9,999,999 | Magic number tag that identifies this strategy's positions. |

Recommended Chart Settings
The Trend Continuation Factor Rider was designed with FX majors and metals on the H1 to H4 timeframes in mind, where directional swings tend to persist long enough for a continuation regime to establish. That said, nothing in the code is hardcoded to a symbol or timeframe — the strength gate is expressed in ATR units specifically so the logic remains scale-free across instruments.
Because the strategy depends on sustained persistence, it will behave very differently on a quiet, range-bound pair than on a trending one. Always test on the exact symbol, timeframe, and broker feed you intend to use, and remember that results will vary considerably across different market conditions and volatility regimes.
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. The TCF's persistence logic is conceptually elegant: by resetting a streak the moment price moves against it, the indicator naturally distinguishes clean trends from noisy drift. The requirement that both legs agree (TCF+ > 0 and TCF- < 0) is a stricter filter than a single-line crossover, which may reduce whipsaw entries. The ATR-based strength gate and ATR-based stops make the strategy adapt to volatility rather than assuming fixed pip distances, which is helpful when moving between symbols.
Limitations. Like all trend-following systems, this approach can struggle in range-bound or choppy markets, where fresh continuation flips may appear and then quickly reverse — producing a string of small losing trades. Entering on the emergence of a trend means the strategy is early by design, and early signals sometimes fail to develop into real trends. The flip-the-book behaviour keeps the EA aligned with the current regime but can also churn through positions during indecisive periods, adding spread and commission cost. The fixed lot size does not scale risk to account equity, and the fixed reward-to-risk ratio makes no attempt to trail winners.
Where it may underperform. Tight consolidations, low-volatility sessions, and news-driven spikes that snap back can all generate false continuation signals. No indicator can distinguish a durable trend from the opening leg of a failed one in advance, so expect periods of drawdown. Treat this EA as an educational framework for studying continuation logic — not as a system to deploy with real capital before extensive, independent testing.
Risk Management Tips
Sound risk management matters more than any single entry rule. Consider these general principles as part of your education:
- Position sizing: Size each trade so that a stop-out costs only a small, predefined fraction of your account. Many educational sources suggest risking no more than 1–2% of equity per trade.
- Understand drawdown: Even a well-behaved trend strategy will string together losing trades during ranging markets. Know the maximum drawdown you are willing to tolerate before you begin.
- Demo first: Run the EA on a demo account across varied market conditions before ever considering live capital, so you understand how it behaves through both trends and chop.
- Respect leverage: Leverage magnifies both gains and losses. Use it conservatively and never commit funds you cannot afford to lose.
- Review and adapt: Markets change. Periodically re-evaluate the parameters and confirm the strategy still behaves as expected on your chosen symbol and timeframe.
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: TrendContinuationFactorRider.ex5 (33 downloads)
- Source Code: TrendContinuationFactorRider.mq5 (30 downloads)
- Documentation: TrendContinuationFactorRider.pdf (36 downloads)