Blog / Strategy
Strategy

Linear Correlation Trend Rider

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 Linear Correlation Trend Rider is a trend-following expert advisor for MetaTrader 5 built around Ehlers' Correlation Trend Indicator (CTI), a momentum tool that measures how straight and directional recent price action has been. Instead of comparing two market series, the CTI calculates the Pearson correlation — a statistic that ranges from -1 to +1 and describes how closely two data sets move together — between the last several closing prices and a simple rising time ramp (the numbers 0, 1, 2, and so on). In plain terms, it asks: "Have prices been marching up or down in a nearly straight line over time?"

Because the reading is bounded between -1 and +1 and is self-normalizing, the same threshold values behave consistently across different symbols, timeframes, and volatility conditions. A CTI near +1 describes a clean, mature uptrend; a reading near -1 describes a clean downtrend; and a value near 0 signals chop, ranging, or a market that is turning. This makes the indicator an intuitive lens for studying trend quality rather than just trend direction.

This strategy is designed for trending market conditions and is best suited as a learning tool for traders who want to understand how a correlation-based filter can time the ignition of a trend — the moment a directional move tightens into a genuine line. It is an educational study of momentum engagement and disciplined exits, not a shortcut to results. Anyone exploring how statistical indicators translate into concrete entry and exit rules will find it a clear, self-contained example.

How It Works

The strategy acts once per newly closed bar, using the just-closed candle rather than the still-forming one. On each closed bar it recalculates the CTI over the chosen window and compares it to the prior bar's value to detect a fresh change in trend structure. Here is how the logic breaks down.

Long entry ("ignition") — the strategy signals a buy when all of the following align:

Short entry — the mirror image:

Exit — a linearity-decay rule:

Stop-loss and take-profit — volatility-based:

Additional controls: A spread filter skips new entries when the current spread is wider than the allowed maximum, keeping simulated fills realistic. The strategy holds a single position per magic number and works on one primary timeframe throughout.

correlation trend indicator MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
CorrLength 24 8 80 Number of closing prices in the CTI correlation window. Longer values smooth the reading and respond to slower trends; shorter values react faster but are noisier.
EntryLevel 0.55 0.30 0.90 The absolute CTI threshold that must be freshly crossed to arm a trade. Higher values demand a cleaner, more established straight-line trend before entry.
ExitLevel 0.20 -0.20 0.60 The absolute CTI level at which the trend is judged to have decayed, closing the position. Lower values give the trade more room; higher values exit sooner.
AtrPeriod 14 5 40 Lookback period for the ATR used to size the stop-loss and take-profit distances.
AtrSlMult 2.0 0.5 6.0 Stop-loss distance as a multiple of ATR. Larger multiples set a wider stop.
AtrTpMult 3.5 0.5 10.0 Take-profit distance as a multiple of ATR. Together with the stop multiple this defines the reward-to-risk shape.
MaxSpreadPoints 30 0 200 Maximum allowed spread (in points) for a new entry; set to 0 to disable the filter.
Lots 0.10 0.01 1.0 Fixed trade volume in lots for each position.
correlation trend indicator MT5 EA — MQL5 source code

Recommended Chart Settings

The Linear Correlation Trend Rider is symbol- and timeframe-agnostic by design — because the CTI is bounded and self-normalizing, its thresholds behave consistently across instruments. That said, correlation-based trend indicators tend to be studied most cleanly on liquid major forex pairs (such as EUR/USD or GBP/USD) on intraday-to-swing timeframes like H1 or H4, where trends have room to develop into recognizable straight lines and spreads stay tight.

The default correlation window of 24 bars pairs naturally with these higher timeframes. As always, results will vary considerably across different symbols, sessions, and market conditions, so treat any single chart configuration as a starting point for your own testing rather than a fixed recommendation.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The CTI is an elegant, bounded statistic that reads trend quality in a single number, so the same thresholds transfer across markets without rescaling. The "ignition" logic — requiring a fresh cross and a strengthening correlation and a confirming candle — is deliberately selective, which helps filter out weak or fading signals. The linearity-decay exit is a thoughtful design choice: it releases a position when the trend structure breaks down, rather than waiting passively for a stop.

Known limitations. Like all trend-following systems, this strategy is built for directional markets and will historically struggle in choppy, sideways conditions, where fresh crosses can appear and quickly fail. Because the CTI correlates price against time, sharp but brief spikes may register as clean trends that do not persist. The exit rule can close a healthy position early during a temporary pullback that dips the correlation below the exit level. And with a single fixed lot size and no trailing stop, the risk profile is static — it does not adapt to account growth or lock in open profit as a trade develops.

Where it may underperform. Expect weaker behavior during range-bound sessions, around major news releases that produce erratic candles, and on very low timeframes where noise dominates and spreads eat into ATR-scaled targets. No indicator anticipates reversals, and the CTI is no exception — it describes what price has done, not what it will do next.

Risk Management Tips

Sound risk management matters more than any single indicator setting. Consider these general principles as you study this strategy:

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

← Back to Blog