-
Notifications
You must be signed in to change notification settings - Fork 0
Indicator Rwi
Mike Poulos' Random Walk Index — measures how many standard deviations the current move is away from a random walk of the same length. Higher RWI means the directional move is statistically more significant than noise.
| Field | Value |
|---|---|
| Family | Trend & Directional |
| Input type | Candle |
| Output type | RwiOutput { high, low } |
| Output range |
>= 0 (each line) |
| Default parameters |
period = 14 (must be >= 2) |
| Warmup period | period |
| Interpretation |
RWI_High > 1 and dominant = real uptrend; mirror for downtrend. Both lines below 1 = ranging. |
For each lookback i ∈ [2, period]:
RWI_High_t(i) = (high_t − low_{t-i+1}) / (ATR_i(t) * sqrt(i))
RWI_Low_t(i) = (high_{t-i+1} − low_t) / (ATR_i(t) * sqrt(i))
where ATR_i(t) is the simple mean of true-range over the most recent
i bars. The per-bar emission is the maximum of these ratios across
all lookbacks i ∈ [2, period]:
RWI_High_t = max_{i ∈ [2, period]} RWI_High_t(i)
RWI_Low_t = max_{i ∈ [2, period]} RWI_Low_t(i)
A flat window (zero ATR) short-circuits each lookback to zero, so the
indicator reports (0, 0) on a perfectly motionless market.
| Name | Type | Default | Valid range | Description |
|---|---|---|---|---|
period |
usize |
14 |
>= 2 |
Max lookback. period < 2 returns Error::InvalidPeriod because lookback i = 2 is the shortest meaningful comparison. |
-
RWI_Highcrossing aboveRWI_Lowsignals a fresh uptrend. -
RWI_High > 2is the typical "strong trend" threshold used by Poulos in the original 1991 Stocks & Commodities article. -
Both lines
< 1— neither direction beats random-walk noise; treat the market as ranging and avoid trend-following signals.
E. Michael Poulos, "Of Trends and Random Walks", Technical Analysis
of Stocks & Commodities, February 1991 — original publication of the
indicator. The sqrt(i) denominator comes from the expectation that a
random walk of i steps drifts a distance proportional to sqrt(i).
- Adx — alternative trend-strength gauge, smoothed rather than threshold-based.
- ChoppinessIndex — log-scaled trend-vs.-range complement.
-
Warmup Periods — the
periodRWI entry.
Wickra on GitHub · crates.io · PyPI · npm · License: PolyForm-Noncommercial-1.0.0
- Alligator
- Alma
- Dema
- Ema
- Evwma
- Frama
- Hma
- Jma
- Kama
- McGinleyDynamic
- Sma
- Smma
- T3
- Tema
- Trima
- Vidya
- Vwma
- Wma
- Zlema
- AwesomeOscillator
- Cci
- Cmo
- ConnorsRSI
- Inertia
- Kst
- LaguerreRSI
- Mfi
- Mom
- Pgo
- Pmo
- Roc
- Rsi
- Rvi
- Smi
- Stochastic
- StochRsi
- Tsi
- UltimateOscillator
- WilliamsR
- Adx
- Adxr
- Aroon
- AroonOscillator
- ChoppinessIndex
- MacdIndicator
- MassIndex
- Rwi
- Tii
- Trix
- VerticalHorizontalFilter
- Vortex
- WaveTrend
- Atr
- BollingerBands
- BollingerBandwidth
- ChaikinVolatility
- Donchian
- GarmanKlassVolatility
- HistoricalVolatility
- Keltner
- Natr
- ParkinsonVolatility
- PercentB
- RogersSatchellVolatility
- RviVolatility
- StdDev
- TrueRange
- UlcerIndex
- YangZhangVolatility