- Laguerre RSI is an adaptive oscillator invented by John Ehlers that replaces standard RSI's Wilder-smoothed gain/loss averages with a 4-stage casca...
Laguerre RSI is an adaptive oscillator invented by John Ehlers that replaces standard RSI's Wilder-smoothed gain/loss averages with a 4-stage cascaded Laguerre filter. A single γ (gamma) parameter controls the entire responsiveness-smoothness trade-off. Output is dimensionless, always in [0, 1]. No period selection required.
## Historical Context
John Ehlers introduced Laguerre RSI in *Cybernetic Analysis for Stocks and Futures* (2004, Wiley), drawing on the earlier Laguerre polynomial filter described in the same book. The core insight was that classical RSI's Wilder smoothing is a fixed-lag IIR filter that cannot be tuned without changing the period; Laguerre's four cascaded all-pass stages deliver a free parameter γ that continuously trades lag against noise rejection.
Standard RSI uses only two price-derived time series (upward and downward RMAs of one-bar differences). Laguerre RSI produces four correlated time series (the filter stages L0–L3) and derives its RSI-like signal from the cumulative up and down differences across consecutive stages. This gives it substantially more information per bar while remaining entirely O(1).
No external C# library (Skender, TA-Lib, Tulip, OoplesFinance) implements LRSI. Validation is therefore self-consistency only: all four computation modes (streaming, batch TSeries, span, eventing) must produce bit-identical results, and output must remain strictly in [0, 1] under all conditions.
## Architecture & Physics
### 1. Laguerre Filter Stages
Each stage is a first-order all-pass IIR element parameterised by γ:
The stages implement an orthonormal basis: each successive output is a delayed, damped projection of the input with the previous stage's component subtracted. The coefficient γ ∈ [0, 1) acts as a reflection coefficient in the all-pass lattice.
Five doubles only. No circular buffers. Bar correction (`isNew=false`) reduces to a single struct copy — the simplest possible rollback in the library.
### 5. FMA Usage
The all-pass recurrence `−γ·L_k + L_{k-1}[n-1] + γ·L_k[n-1]` maps directly to two FMA calls per stage:
For stage 0, the transfer function is a simple lowpass:
$$H_0(z) = \frac{1-\gamma}{1 - \gamma z^{-1}}$$
Cascading four stages shifts the phase progressively while retaining the same magnitude response, spreading spectral energy across the orthogonal basis. The RSI formula then reads out the directional momentum component of this spread.
## Performance Profile
### Operation Count (Streaming Mode)
Laguerre RSI uses a 4-pole Laguerre filter to compute a fast RSI-like oscillator.
| Interpretability | 7 (same overbought/oversold logic as RSI but [0,1] not [0,100]) |
SIMD analysis: the four stage computations are sequentially dependent (each stage requires the result of the previous). SIMD across a single bar is not applicable. Across bars: the stage recurrence has a feedback term that prevents loop vectorisation. A pure batch SIMD path is therefore infeasible; the scalar loop with FMA is the correct implementation.
## Validation
No external C# library implements Laguerre RSI. Validation protocol:
1.**Confusing [0,1] with [0,100]**: LRSI outputs in unit range; overbought/oversold levels are near 0.8/0.2, not 80/20. Plotting alongside standard RSI without rescaling produces vertical misalignment.
2.**γ = 1.0 produces constant 0.5**: All stages converge to a weighted mean; cu = cd = 0 for any non-spike input. The implementation returns 0.5 by convention; this is mathematically correct but operationally useless. Warn users who set γ ≥ 0.95.
3.**Expecting WarmupPeriod to gate output**: LRSI emits valid output from bar 1 (stages begin updating immediately). `WarmupPeriod = 4` is informational — it marks when all four stages have received at least one distinct value. Unlike period-based indicators, there is no discontinuity at the warmup boundary.
4.**Bar correction rollback is trivially cheap**: Because state is five scalars, `isNew=false` is just `_s = _ps` — no Array.Copy required. Any performance concerns from frequent bar corrections are unfounded for LRSI.
5.**Recursive filter cannot be vectorised**: Do not attempt a SIMD batch path. The stage-to-stage dependency chain is a strict serial recurrence. The only valid performance improvement is FMA (already applied) and ensuring the JIT promotes the state struct to registers (enabled by the local copy pattern).
6.**NaN substitution uses last valid close, not 0.5**: Substituting 0 or 0.5 on a NaN bar would distort the filter state. The last seen finite price is the correct substitution — it keeps the filter state continuous.
7.**γ behaviour is not monotone in lag for all signals**: Lower γ produces a faster filter, but also a noisier RSI signal. The optimum γ for a given instrument depends on frequency content of the underlying price series — there is no universally correct value.
## References
- Ehlers, J.F. (2004). *Cybernetic Analysis for Stocks and Futures*. Wiley. Chapter 14.