Loading…

Random Walk Index

Most trend-strength indicators answer "how far has price moved" without ever asking whether that move is actually larger than random noise over the same stretch would produce anyway. The Random Walk Index answers that directly: it compares the actual high-to-low move over N bars against N steps of a random walk sized by that period's own average true range, using the statistical fact that a random walk's expected range grows with the square root of the number of steps, not linearly. A reading above 1.0 means the observed move is larger than random walk noise would explain at that horizon - a genuine signal of directional persistence, not just volatility. Poulos' original method computes this across several different horizons (the published examples typically span roughly 2 to 30 periods) and reports the strongest reading found across that whole band, separately for the up-direction test and the down-direction test. A single fixed lookback only answers the question at one specific horizon, and the horizon at which persistence is clearest shifts as the market's own cycle length changes - scanning a band and keeping the maximum is what makes the reading horizon-independent rather than tied to one arbitrary choice. Notes and limitations - Average true range at each tested horizon is computed as a plain average over that horizon's own bars, not a Wilder-smoothed ATR, to match Poulos' original published formula exactly. - The indicator scans every horizon in the input band at every bar; a wide InpMinPeriod-to-InpMaxPeriod band with a small InpStep on a long history can take a moment to fully recalculate on first attach, though ongoing tick-by-tick updates only recompute the newest bar. - A reading above 1.0 says the move is larger than random-walk noise would produce, not that it will continue - it is a persistence test on the bars already closed, not a forecast.

Indicator · MT5 · v1.0 · Free

About Random Walk Index

Random Walk Index is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Min period, Max period and Step. MQL source code included.

Files in the download: RandomWalkIndex.ex5, RandomWalkIndex.mq5, RandomWalkIndex.txt.

Settings

SettingDefaultWhat it does
Min period2Shortest horizon N tested, in bars
Max period20Longest horizon N tested, in bars
Step2Step between tested horizons
AlertstrueAlert once per closed bar when either line crosses above 1.0

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: ATR · Trend · Alerts · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria