Back to Guides
Guide

The Laguerre RSI Formula, and What Gamma Is Worth

The Laguerre RSI formula in full: all seven equations, what gamma is worth in bars, and the four settings published sources disagree about.

The Laguerre RSI pushes price through a four-stage filter, then builds an RSI-style ratio out of the gaps between those stages instead of out of bar-to-bar price changes. The output runs 0 to 1, one setting controls everything, and the arithmetic is seven lines long.

The sources that publish this indicator agree on the arithmetic and then disagree about four settings: gamma's default, which price to feed it, where the threshold lines go, and what the oscillator does when its denominator hits zero. Gamma, the only knob, comes with no translation into bars, so anyone arriving from a period-based indicator has nothing to anchor on. We measured what each of those is worth on our own historical EUR/USD data.

The formula

L0 = (1 - g) * P + g * L0[1]
L1 = -g * L0 + L0[1] + g * L1[1]
L2 = -g * L1 + L1[1] + g * L2[1]
L3 = -g * L2 + L2[1] + g * L3[1]

CU = max(L0 - L1, 0) + max(L1 - L2, 0) + max(L2 - L3, 0)
CD = max(L1 - L0, 0) + max(L2 - L1, 0) + max(L3 - L2, 0)

LaRSI = CU / (CU + CD)

P is the price on the current bar and g is gamma, somewhere between 0 and 1. L0 to L3 are the four filter stages, and the suffix [1] means that stage's value on the previous bar. CU collects the upward gaps between neighbouring stages, CD the downward ones, and the plotted value is CU divided by their total.

Take the same four stages and blend them instead of comparing them, and you have the Laguerre filter:

Laguerre = (L0 + 2 * L1 + 2 * L2 + L3) / 6

That is why these two indicators belong together. LuxAlgo puts it in four words: "Same ladder, different readout." Backtrader ships both from a single module under the aliases LRSI and LAGF, and Ehlers' own EasyLanguage listings compute the stages identically before diverging at the last line.

John Ehlers published the design in a paper titled Time Warp Without Space Travel and in the book Cybernetic Analysis for Stocks and Futures. Sierra Chart describes the result as something that "can be loosely thought of as an RSI in which the Average Type is a Laguerre Moving Average".

Where the Laguerre RSI is in ChartLabs

ChartLabs has it built in, under the name Laguerre RSI. Open the chart's Indicators menu, go to the Standard list, and look under the Momentum & Oscillators heading. It draws in its own pane below the price, with guide lines at 0.8 and 0.2 already on the pane.

Ours follows Ehlers' LRSI listing. Gamma is 0.5 by default, settable from 0 to 0.99 in steps of 0.05, and Source is the close, so his (H+L)/2 input is one change away. As in his code every stage starts at zero and the reading keeps its last value on a bar where CU and CD are both zero, which is why the zero case never fires on our build.

The Laguerre filter, the blended readout of the same ladder, has no menu entry of its own.

What gamma is worth, in bars

Ask what gamma to use and you get a range rather than a number. LuxAlgo says flatly that "There is no universally best value", then offers 0.5 to 0.8 as common starting points. Backtrader documents a different band for both of its classes: "gamma is meant to have values between 0.2 and 0.8, with the best balance found theoretically at the default of 0.5".

Nobody supplies the figure that would make those numbers mean something: how much memory a given gamma actually buys. That is a property of the filter rather than of any market, so it can be computed exactly. Feed the filter a single unit impulse, read the weights it spreads over the bars that follow, and take their centre of mass.

gammamean lag, in barssame mean lag as
0.01.500a 4-period average
0.22.500a 6-period average
0.44.167a 9.3-period average
0.55.500a 12-period average
0.67.500a 16-period average
0.710.833a 22.7-period average
0.817.500a 36-period average
0.937.500a 76-period average

The right-hand column is the simple average and the exponential average that share that centre of mass, which happen to coincide, so one number serves for both.

Gamma is awkward to tune at the top of that range. Nudging gamma from 0.8 to 0.9 looks like a small adjustment and lands you roughly where a 36-period average becomes a 76-period one. LuxAlgo describes the same trap from the inside: "Because gamma feeds every stage, small changes compound, and settings should be adjusted gradually and tested."

At the other end the behaviour is exact rather than approximate. Set gamma to zero and the filter collapses to a fixed four-bar weighted average with weights 1, 2, 2, 1. Ehlers plotted that comparison himself, computing FIR = (Price + 2*Price[1] + 2*Price[2] + Price[3]) / 6; alongside the filter. Run the two against each other on 832 daily EUR/USD bars and the largest gap between them is 0.000000e+00 price units.

Why it sits at 0 and 1 so much

A standard RSI rarely reaches its extremes. The Laguerre version lives there, and the reason is in the formula rather than in the market: each of the three stage gaps goes entirely to CU or entirely to CD, so any bar where the four stages are in strict order sends the other sum to exactly zero.

How often that happens is worth a number, because the published descriptions of the pinning stop at describing it. At gamma 0.5 on the close, with the first 200 bars dropped as warm-up:

Bar intervalexactly 1.0exactly 0.0between 0.2 and 0.8
Daily, 635 bars17.95%15.59%41.10%
Hourly, 16,406 bars18.80%18.27%37.46%
1-minute, 991,437 bars19.17%18.61%37.78%

A third of daily bars sit on one of the two hard extremes and well under half sit anywhere in the middle. Treat that as the indicator's normal behaviour during a trend rather than as a reading about how stretched price is. LuxAlgo warns about the same misreading: the thresholds "are decision thresholds, not classic reversal zones. Above 0.8 does not mean stretched and due to fall; it usually means a strong advance in progress."

Where the lines go, and which setting actually matters

Nobody should call either published pair the levels. LuxAlgo gives 0.8 and 0.2, and backtrader's documented example uses the same two. Ehlers' own listing plots Plot2(.9); Plot3(.1);, so 0.9 and 0.1. Sierra Chart exposes two configurable lines and names no default at all.

On daily EUR/USD the oscillator sits above 0.8 on 30.39% of bars and above 0.9 on 23.62%, with 28.50% below 0.2 and 20.63% below 0.1. The line drops back through 0.9 thirty-nine times and through 0.8 only thirty-seven, and on 1-minute bars it is 54,546 against 50,984. The tighter line fires more often, not less, because the series spends so long pinned at exactly 1.0 that any excursion stalling between 0.8 and 0.9 crosses the higher line alone.

The price you feed in moves the reading more than the threshold does. Ehlers' filter listing opens Inputs: Price((H+L)/2), gamma(.8); while his oscillator listing opens Inputs: gamma(.5); and runs on the close. LuxAlgo describes the attribution the other way round, saying Ehlers used the bar midpoint with the close as a common default. Run both inputs on the same daily bars at the same gamma and they differ by 0.0601 on average on a 0-to-1 scale, by 0.4374 at worst, and they disagree about whether the oscillator is above 0.8 on 6.61% of days.

Is it better than an EMA?

It is a trade rather than an upgrade. LuxAlgo says the same: "It is a different trade-off, not a strict upgrade." The design goal is more smoothing for each unit of lag, and that much is testable without going anywhere near trading results.

Match an EMA to the Laguerre line on output noise, measured as the mean absolute second difference of the line itself, then measure how far each one actually lags price by finding the shift that minimises mean squared error. On daily EUR/USD:

gammaEMA matched on noiseLaguerre lagEMA lag
0.524-period5 bars8 bars
0.637-period7 bars13 bars
0.761-period10 bars22 bars
0.8123-period16 bars43 bars

Hourly bars give the same shape. So the design claim holds, and the saving grows with gamma: three bars at 0.5 and twenty-seven bars at 0.8. That is a statement about the smoothness and lag of two lines, and it says nothing about what either does to a set of trades.

The zero case, and why the recommended setup triggers it

When CU and CD are both zero there is no ratio to compute, and three sources handle it three ways. Sierra Chart prints 0. LuxAlgo holds the previous value. Ehlers' code guards the division with If CU + CD <> 0 then RSI = CU / (CU + CD); and declares RSI(0), so the last value carries over from a starting point of zero.

Printing 0 means printing maximum oversold on a bar where nothing separated the stages, which is a real difference from holding the last reading.

In practice it almost never comes up. Past a 200-bar warm-up, CU and CD are never both zero on our data: not on any of 991,437 minutes, 16,406 hours or 635 daily bars. It only arises in the first bar or two, and the trigger is the setup instruction itself. LuxAlgo tells you to initialise all four stages to the first price to limit warm-up artefacts. Do that and the stages begin exactly coincident, so the branch fires immediately: once on hourly and daily, and three times running on 1-minute bars, where the first three minutes all closed at the same price and kept the stages together. Start the stages at zero instead and the branch never fires anywhere.

A repeated price does not pull the stages back together once they have separated, which is why the branch stays quiet afterwards even though EUR/USD closes exactly on its open about nine minutes in every hundred. Each stage is carrying a different history by then.

Does it repaint?

No. LuxAlgo answers it directly: "It is a causal recursion over confirmed prices: each value uses only current and past data, so history never redraws." The usual live-bar caveat applies, since the current value keeps updating until the bar closes.

What to write down before you test anything

Five settings decide what the line does, and all five are live disagreements rather than conventions: gamma, the price input, the threshold pair, how the stages were seeded, and the bar interval. Two traders can both say the Laguerre RSI dropped back through its upper line today and be describing measurably different events.

Testing the indicator half needs a platform that draws the line. Testing the price half does not, because a level, a time window and what price did when it got there are all recorded in ordinary bars, and that part you can check by hand.

Backtrader's documentation carries a worked example that sells above 0.8 and buys below 0.2. It is there to show the API rather than to be traded, and our own measurement is the reason to be careful with it: the line is above 0.8 on 30.39% of daily bars, so that branch is satisfied on nearly a third of them. LuxAlgo says those signals "fail badly in trends".

Testing it in ChartLabs

Drawing the line takes one menu entry, described above: Laguerre RSI in its own pane, at Ehlers' gamma of 0.5 on the close.

Laguerre RSI in its own pane under a ChartLabs EURUSD 1-hour chart, at the default Gamma 0.5, moving between 0 and 1 with dashed guide lines near 0.2 and 0.8

There is no automatic backtesting, so nothing there will run a strategy or grade a signal for you.

The testing itself is manual. You step historical charts forward bar by bar with the future hidden, take the trades your rule asks for, and every trade keeps the chart exactly as it looked when you took it. An indicator that fires on nearly a third of bars produces a lot of trades to review, which is also a lot of trades to pay costs on.

Start with the beginner's guide to backtesting a trading strategy for the method, the forex backtesting guide for pair and session choices, and backtesting accuracy, slippage and data quality for why those costs decide whether a tested rule survives.

To test the half of your rule that your data can support, start a free trial of ChartLabs. One plan, everything included.

Related Topics

laguerre-rsilaguerre-filterehlers-indicatorsdamping-factorindicator-settingsmanual-backtesting