Author: Adeolu Gbadebo
Most retail tools that use autocorrelation plot it the textbook way - correlation on the y-axis, lag on the x-axis, computed once over a fixed history. That's useful for a one-time diagnostic, but it doesn't tell you what the market is doing right now. This indicator flips the axes: it fixes the lag (usually 1) and instead tracks how that single autocorrelation reading evolves bar by bar, over a rolling window. The result behaves like a normal oscillator you'd read off the right edge of the chart, except what it's measuring is a genuine statistical property of returns rather than price momentum.
The mechanics are straightforward. At each bar, the indicator pulls the last N return observations, pairs each one with its own value lagged by the configured number of bars, and runs a standard Pearson correlation between the two series. A positive reading means an up-return tends to be followed by another up-return at that lag - the statistical signature of a trending, momentum-driven stretch. A negative reading means an up-return tends to be followed by a down-return - the signature of a mean-reverting, choppy stretch. Because the window is finite, a raw correlation reading has genuine sampling noise even in a perfectly random market, so the indicator plots dynamically-computed significance bands at ±Z/√N - only readings that push past those bands are more likely to reflect a real regime than window-size noise.
A raw per-bar reading on its own is jumpy, so a second, EMA-smoothed line rides on top of it. That smoothed line is the one worth watching for regime persistence; the raw dotted line is there mainly to show how much the underlying estimate is bouncing around bar to bar.
| Input | Default | Purpose |
|---|---|---|
| InpWindowSize | 50 | Number of return observations in the rolling window used for each autocorrelation estimate |
| InpLag | 1 | Return lag correlated against (in bars); 1 captures bar-to-bar persistence, higher values capture slower cycles |
| InpSmoothPeriod | 5 | EMA smoothing period applied to the raw autocorrelation reading |
| InpConfidenceZ | 1.96 | Z-score used to compute the significance bands (1.96 approximates a 95% confidence level) |
| InpUseLogReturns | true | Uses log returns when true; uses simple price differences when false |
Start with the defaults on an hourly chart and watch how the smoothed line behaves around known trending versus choppy stretches you already recognize - that builds an intuitive feel for where the bands sit on your instrument before you rely on it. Shorter windows react faster to regime shifts but produce noisier raw readings and wider significance bands (since the band scales with 1/√N); longer windows are steadier but slower to flag a change. This indicator says nothing about direction, only about the character of recent price behavior, so it's best paired with a directional or level-based tool: use it to decide whether a breakout or a fade is the higher-probability approach right now, rather than as a standalone signal generator.

MT5 EA Acceptance Harness
Deterministic synthetic acceptance checks for MT5 EA entry-state logic, with no market, account or order access.
FX Dashboard
This is a FX Dashboard style terminal panel on the MT5 chart, plus lines drawn on the chart (EMA, Bollinger, Donchian).
Order Block Mitigation Tracker
An MT5 indicator that detects ATR-filtered institutional order blocks and tracks, in real time, whether each zone has been mitigated by returning price.
Broker Execution Diagnostics MT5
Read-only MT5 script reporting broker volume, price, stops, freeze, spread and execution constraints.