Laguerre Filter And Laguerre RSI
Ehlers published the Laguerre filter as a way to get EMA-style smoothing with noticeably less lag, by running price through four cascaded "leg" stages (L0 through L3) whose mix is controlled by a single damping factor, gamma. The plotted filter line is a weighted combination of the four legs: (L0 + 2*L1 + 2*L2 + L3) / 6. The Laguerre RSI reuses those same four legs instead of computing a second, independent RSI. It compares each adjacent pair of legs (L0 vs L1, L1 vs L2, L2 vs L3), sums the "up" differences and the "down" differences across all three pairs, and expresses the result as up / (up + down) - a value between 0 and 1, not the familiar 0-100 scale of a classic RSI. This is Ehlers' own published construction, not a Laguerre-smoothed version of Welles Wilder's RSI. Because MQL4 restricts a single indicator file to one window type, this submission plots the Laguerre filter line on the price chart (where a smoothed price line belongs) and keeps the Laguerre RSI in a second, non-plotted internal buffer that a chart EA or another indicator can read via iCustom(..., 1, shift) - the RSI value is computed on every bar exactly as published, it is simply not drawn on the price chart itself, since a 0-1 oscillator has no sensible shared scale with price. Both outputs are recomputed from bar zero on every call, because the L0-L3 recursion carries state forward from the previous bar - it cannot be correctly resumed from an arbitrary mid-history point. Notes and limitations - Gamma is a fixed input here, chosen once by the user - it does not adapt to volatility bar to bar. See the companion Adaptive Laguerre Filter submission for the self-tuning version. - The Laguerre RSI is not plotted on the chart in this submission (only the filter line is); read it via iCustom as described above, or add a second file with indicator_separate_window if a plotted 0-1 subwindow oscillator is wanted alongside a plotted price overlay. - Needs at least 5 bars of history before it produces a value.
Indicator · MT5 · v1.0 · Free
About Laguerre Filter And Laguerre RSI
Laguerre Filter And Laguerre RSI is an indicator for MetaTrader 5. It has 1 setting, such as Gamma. MQL source code included.
Files in the download: LaguerreFilterRsi.ex5, LaguerreFilterRsi.mq5, LaguerreFilterRsi.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Gamma | 0.7 | Damping factor gamma (0..1): higher = smoother, more lag |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: RSI · Moving Average · Oscillator · MT5 Indicator · MQL5 Source Code