Blog / Strategy
Strategy

Dispersion Scaling Rotation

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?

Dispersion Scaling Rotation is an MT5 expert advisor built around a single statistical measurement called the anomalous-diffusion exponent (often written as alpha), combined with a volatility-adaptive ATR (Average True Range) stop. Rather than relying on classic chart indicators, moving averages, or price-action patterns, it treats the log-price of a market as the position of a diffusing particle and asks one question: over several timescales at once, is price spreading out faster or slower than a plain random walk would predict? That measurement decides whether the strategy behaves as a trend follower or a mean-reversion fader.

The core idea comes from physics. In ordinary diffusion, the mean-squared displacement (how far a particle drifts, squared and averaged) grows in direct proportion to the time you wait. Financial order flow bends that relationship. When displacement compounds faster than a random walk (alpha above 1, "super-diffusive"), price is behaving ballistically and a directional move may be underway. When displacement is suppressed (alpha below 1, "sub-diffusive"), price is acting "caged" and stretched moves may snap back. When alpha sits near 1, there is no exploitable structure and the strategy stands aside.

This EA is best understood as a learning tool for traders curious about regime detection and adaptive systems. It is designed for liquid markets — major forex pairs, metals, indices, and crypto — where a diffusion picture of price is meaningful. It suits students who want to study how one measurement can rotate an algorithm between trending and reverting behavior, rather than anyone seeking a fixed, one-size-fits-all setup.

How It Works

The strategy evaluates the market once per newly closed bar. On each new bar it measures the diffusion exponent across the lags 1, 2, 4, and 8 bars, fits a straight line through the log-log scaling points, and reads the slope as alpha. Everything that follows is a rotation around that number.

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

Strategy Parameters

Parameter Default Min Max Description
Window 60 32 160 Analysis window in bars over which the mean-squared displacement and the z-score are measured.
ScalingBand 0.15 0.03 0.5 Neutral half-band around alpha = 1. The exponent must deviate by more than this before the strategy acts.
DriftSpan 4 1 20 Number of bars spanned by the net displacement (drift) used in the trend regime.
DriftAtrFrac 0.30 0.0 2.0 The drift must exceed this fraction of ATR to count as a genuine ballistic move.
RevertZScore 1.20 0.5 3.0 Z-score extreme required to fade price in the sub-diffusive (reversion) regime.
AtrPeriod 14 7 40 Number of bars used to compute the ATR that drives stop and target distances.
AtrSlMult 2.0 0.8 5.0 Stop-loss distance as a multiple of ATR.
Lots 0.10 0.01 1.0 Fixed trade size in lots.
diffusion exponent MT5 EA — MQL5 source code

Recommended Chart Settings

Dispersion Scaling Rotation runs on a single primary timeframe — whichever chart you attach it to at test time. There is no hard-coded symbol or period, which makes it flexible but also means the defaults are only a starting point. As a practical study setup, attach it to a liquid instrument such as EUR/USD, XAU/USD (gold), or a major index on an intraday-to-swing timeframe like M15, M30, or H1, where the diffusion behavior of price tends to be cleaner and spreads stay reasonable relative to ATR-based stops.

Because the strategy measures scaling across the 1, 2, 4, and 8-bar lags, its character changes with the timeframe you choose: the same market can read as super-diffusive on one period and sub-diffusive on another. Treat every timeframe and symbol as a separate experiment. Results will vary meaningfully across different instruments and market conditions, so test each combination independently rather than assuming one calibration transfers to another.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The appeal of this approach is that it does not assume a single, fixed edge. The same machinery trends in one regime and reverts in another, self-adapting to the measured diffusion character of price instead of forcing a trend model onto a ranging market or vice versa. The ATR-based stops and exponent-scaled targets also give it a coherent, volatility-aware risk framework, and the regime-flip exit means it will not stubbornly hold a position once the statistics turn against it.

That said, the method has real limitations you should understand. The diffusion exponent is a statistical estimate from a limited window, so it is noisy — especially with a short Window — and can flip regimes on borderline readings, producing whipsaws. During choppy, low-volatility periods, alpha may hover inside the neutral band and the EA will simply do nothing for long stretches, which can feel like underperformance but is by design. In the reversion regime, fading a statistical extreme historically carries the classic risk that a "stretched" market keeps stretching — a strong trend can run well past any z-score threshold before it reverts, if it reverts at all.

Transaction costs matter too. Because the strategy can act every new bar and includes an adaptive exit, spreads, commissions, and slippage may erode edges that look clean in a frictionless backtest. It has no news filter, no session filter, and no equity-based circuit breaker, so it will trade through high-impact events unless you add those guardrails yourself. Think of it as a framework to study and stress-test, not a finished, hands-off system.

Risk Management Tips

Sound risk management matters far more than any single entry rule. Consider these general principles as you study this or any EA:

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