# Random Walk Index

Plots the two Random Walk Index lines, RWI High and RWI Low, scanning every lookback from 8 to 64 bars and keeping each line's maximum, so displacement is judged against an ATR-scaled random walk at its least-random horizon. A dashed threshold at 1 anchors the regime calls, optional exhaustion checks flag fading trends, and seven alerts cover confirmations, crossovers and exhaustion.

- Indicator in the LuxAlgo Library, by LuxAlgo, published May 22, 2026.
- Access: free.
- Concepts: [Random Walk Index](https://www.luxalgo.com/library/concept/random-walk-index/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=a8g82x3fozdj3ug9tzqmbesa
- Page: https://www.luxalgo.com/library/indicator/random-walk-index/

**Random Walk Index** tests every move against the displacement pure noise would have produced. Each bar, the build scans lookbacks between the configured bounds, computes the [Random Walk Index](https://www.luxalgo.com/library/concept/random-walk-index/) of highs and of lows at every horizon (ground covered divided by ATR × √n) and keeps each line's maximum, so RWI High and RWI Low each speak from whichever horizon is hardest to dismiss as noise. A dashed benchmark line, a dominance gradient and a dashboard pairing each reading with its lookback (n) and regime call complete the pane.

## How to Trade the Random Walk Index?

- **RWI High above the threshold**: upward travel larger than a random walk explains. The regime reads Trending Up while it leads, alerted as Uptrend Confirmed; RWI Low mirrors the logic.
- **Both lines below the threshold**: displacement consistent with noise. The Random Walk Regime alert marks the shift, a cue to trade the range or step back.
- **Filtered crossovers**: one line overtaking the other above the threshold prints optional circles, alerted both ways; sub-threshold crossings are ignored.
- **Exhaustion checks**: a declining RWI peak at a new price extreme draws a dashed line and label when enabled, alerted even with drawings hidden.

## Random Walk Index Settings

- **Minimum Lookback** (default 8) and **Maximum Lookback** (default 64): bounds of the scan; equal values fix one horizon.
- **Random Walk Threshold** (default 1.0): the benchmark anchoring regime events and filtering crossovers.
- **Show Exhaustion Checks** (default off) with **Peak Pivot Length** (default 5) and **Max Peak Distance** (default 80): drawings, peak confirmation, and max spacing between paired peaks.
- **Show Dashboard** (on) with **Location** (Top Right) and **Size** (Small); **Crossover Markers** (off), **Gradient Fill** (on).

## Frequently Asked Questions

### How does this differ from the Vertical Horizontal Filter?

The [Vertical Horizontal Filter](https://www.luxalgo.com/library/indicator/vertical-horizontal-filter/) scores path efficiency with no volatility scaling and no direction. This build instead scales every move by an ATR-based random-walk yardstick and holds the up and down lines apart, reporting both that a trend exists and which side owns it.

### Why do the dashboard readings show different n values?

Each line's scan peaks independently at whatever horizon flatters its own displacement most. An aging decline and a young advance can register on very different lookbacks at once.

### Do the exhaustion checks repaint?

A peak confirms Peak Pivot Length bars after printing, so events arrive with that delay; drawings never move afterward. A pair only counts when the earlier peak cleared the threshold and both sit within Max Peak Distance bars.

## Related indicators

- [Structure & Trend Dashboard](https://www.luxalgo.com/library/indicator/structure-trend-dashboard/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/structure-trend-dashboard.md
- [Trending Market Toolkit](https://www.luxalgo.com/library/indicator/trending-market-toolkit/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/trending-market-toolkit.md
- [Change-Point Detection (CUSUM)](https://www.luxalgo.com/library/indicator/change-point-detection-cusum/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/change-point-detection-cusum.md
- [Correlation Trend Indicator](https://www.luxalgo.com/library/indicator/correlation-trend-indicator/) (Trend): markdown at https://www.luxalgo.com/library/indicator/correlation-trend-indicator.md
- [HyperTrend](https://www.luxalgo.com/library/indicator/hypertrend/) (Trend Regime Label): markdown at https://www.luxalgo.com/library/indicator/hypertrend.md
- [HTF Candle Consistency](https://www.luxalgo.com/library/indicator/htf-candle-consistency/) (Higher-timeframe Trend Filter): markdown at https://www.luxalgo.com/library/indicator/htf-candle-consistency.md
- [Average Directional Index](https://www.luxalgo.com/library/indicator/average-directional-index/) (ADX / DMI System): markdown at https://www.luxalgo.com/library/indicator/average-directional-index.md
- [Anchored Powered KAMA](https://www.luxalgo.com/library/indicator/anchored-powered-kama/) (Kaufman Efficiency Ratio): markdown at https://www.luxalgo.com/library/indicator/anchored-powered-kama.md

---

Source: https://www.luxalgo.com/library/indicator/random-walk-index/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
