Blog / Strategy
Strategy

Adaptive Serial Correlation Switch

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 Adaptive Serial Correlation Switch is an algorithmic MetaTrader 5 (MT5) strategy built around a single statistical measurement: the lag-1 autocorrelation of returns. Rather than relying on chart patterns, moving averages, support and resistance, or discretionary "smart money" concepts, it treats the stream of bar-to-bar price changes as a raw stochastic process and asks one question on every completed bar — is the market currently persistent (trending) or anti-persistent (mean-reverting)? Autocorrelation is simply a measure of how strongly a value is related to the value that came before it; here it is applied to log returns, the natural logarithm of each bar's close divided by the previous close.

Because this single number can drift from positive to negative over time, the strategy is designed to switch behavior automatically. When the recent returns tend to repeat their direction, it trades with the latest impulse (trend-following). When recent returns tend to reverse, it trades against the latest impulse (mean reversion). When the signal sits inside a defined "dead zone," it simply stands aside. This makes it a self-adapting regime classifier rather than a fixed directional system.

As a learning tool, the Adaptive Serial Correlation Switch is well suited to traders and students who want to understand statistical thinking applied to markets — regime detection, volatility-adaptive filters, and conviction-scaled risk. It is intended for study and analysis on liquid instruments such as major forex pairs, metals, or crypto, and this article frames it as a strategy analysis, not a profit opportunity.

How It Works

The strategy evaluates the market once per newly-closed bar. On each closed bar it performs the following steps:

For risk and trade management:

adaptive autocorrelation MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
CorrWindow 30 10 100 Number of log returns (N) used in the autocorrelation window. Larger values smooth the regime reading; smaller values react faster.
ImpulseSpan 3 1 10 Number of bars (k) spanned by the "recent impulse" measurement that defines trade direction.
RegimeThreshold 0.15 0.0 0.6 Dead-zone theta. The absolute autocorrelation must exceed this before a trending or reverting regime is declared.
ImpulseAtrFrac 0.25 0.0 1.5 The impulse must exceed this fraction of ATR to be treated as a valid, non-noise signal.
AtrPeriod 14 7 40 Number of bars used to compute the ATR volatility measure.
AtrSlMult 2.0 0.8 5.0 ATR multiple used to set the stop-loss distance from entry.
AtrTpMult 3.0 1.0 6.0 Base ATR multiple for the take-profit before conviction scaling.
Lots 0.10 0.01 1.0 Fixed trade volume in lots per position.
adaptive autocorrelation MT5 EA — MQL5 source code

Recommended Chart Settings

The Adaptive Serial Correlation Switch operates on a single primary timeframe — whatever chart it is attached to at run time — and does not reference higher or lower timeframes. It is designed for liquid instruments where returns are well-behaved and spreads are tight, such as major forex pairs (for example EUR/USD or GBP/USD), metals like gold (XAU/USD), or major crypto pairs.

There is no single "correct" timeframe; the autocorrelation logic can be studied across many, from intraday charts such as M15 and H1 up to H4 and daily. Because the strategy measures serial dependence that genuinely varies by instrument and timeframe, results will vary meaningfully across different markets and market conditions. Treat the default parameters as a starting point for study and always test on your own data before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The core strength of this approach is that it does not assume a fixed edge. Most retail systems are permanently trend-following or permanently mean-reverting, and they suffer whenever the market switches character. By measuring serial correlation directly, the Adaptive Serial Correlation Switch attempts to adapt to whichever regime is currently present. The volatility-adaptive impulse gate and the conviction-scaled take-profit are also thoughtful touches: the strategy tries to act only on meaningful moves and to size its ambitions to the strength of the signal.

That said, this method has real limitations you should understand:

This is best viewed as an educational framework for studying market regimes, not a finished product to deploy unexamined.

Risk Management Tips

Sound risk management matters more than any single entry rule. As you study this strategy, keep these general principles in mind:

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