The Laguerre RSI (Relative Strength Index) is a technical indicator developed by John F. Ehlers that enhances the traditional RSI by applying a Laguerre filter. This modification aims to reduce noise and lag, resulting in a more responsive and smoother oscillator. The Laguerre RSI is particularly useful for identifying overbought and oversold conditions in various market environments.
Key Features:
Laguerre Filtering: Applies advanced smoothing techniques to minimize market noise and enhance signal clarity.
Adaptive Responsiveness: Adjusts more swiftly to price changes compared to the traditional RSI, making it suitable for short-term trading strategies.
Defined Boundaries: Oscillates between 0 and 1, with readings above 0.8 indicating overbought conditions and below 0.2 indicating oversold conditions.
Versatility: Effective in both trending and ranging markets due to its noise-reduction capabilities.
Calculation Overview: The Laguerre RSI is computed by applying a Laguerre filter to the price data, which involves a series of recursive calculations using a damping factor, commonly referred to as gamma (γ). This process results in a smoothed representation of price movements, which is then used to calculate the RSI values. For a detailed mathematical explanation, refer to Ehlers' paper "Time Warp – Without Space Travel."
Interpretation Guidelines:
Overbought Zone (>0.8): Signals potential selling opportunities as the asset may be overvalued.
Oversold Zone (<0.2): Indicates potential buying opportunities as the asset may be undervalued.
Crossing 0.5 Level:
Above 0.5: Suggests increasing bullish momentum.
Below 0.5: Indicates growing bearish momentum.
Advantages:
Noise Reduction: Provides clearer signals by filtering out market noise.
Timely Responses: Offers quicker reactions to market changes, beneficial for traders seeking to capitalize on short-term movements.
Customizable Smoothing: The gamma parameter allows traders to adjust the sensitivity of the indicator to align with specific trading strategies.
Limitations:
Gamma Sensitivity: Selecting an inappropriate gamma value can lead to either excessive sensitivity or excessive lag in the indicator's responses.
Complementary Use: While powerful, the Laguerre RSI is most effective when used in conjunction with other technical analysis tools, such as moving averages or trend indicators, to confirm signals.
namespace CC.Indicators.LaguerreRSI;
using Tickblaze.Scripts.Indicators;
/// <summary>
/// Laguerre Relative Strength Index [CC.LRSI]
/// </summary>
///
public partial class cLaguerreRSI : Indicator
{
[Parameter("Alpha"), NumericRange(0, 1, 0.1)]
public double Alpha { get; set; } = 0.2;
[Plot("Result")]
public PlotSeries Result { get; set; } = new(Color.Blue);
[Plot("Overbought level")]
public PlotLevel OverboughtLevel { get; set; } = new(0.7, Color.Red, LineStyle.Dash, 1);
[Plot("Middle level")]
public PlotLevel MiddleLevel { get; set; } = new(0.5, Color.Gray, LineStyle.Dash, 1);
[Plot("Oversold level")]
public PlotLevel OversoldLevel { get; set; } = new(0.3, Color.Green, LineStyle.Dash, 1);
private DataSeries _L0, _L1, _L2, _L3;
private double _CU, _CD;
public cLaguerreRSI()
{
Name = "Laguerre Relative Strength Index";
ShortName = "CC.LRSI";
IsOverlay = false;
IsPercentage = true;
}
protected override void Initialize()
{
_L0 = new DataSeries();
_L1 = new DataSeries();
_L2 = new DataSeries();
_L3 = new DataSeries();
}
protected override void Calculate(int index)
{
if (index == 0)
{
_L0[index] = 0;
_L1[index] = 0;
_L2[index] = 0;
_L3[index] = 0;
Result[index] = 0.5;
}
else
{
_L0[index] = (1 - Alpha) * Bars[index].Close + Alpha * _L0[index - 1];
_L1[index] = - Alpha * _L0[index] + _L0[index - 1] + Alpha * _L1[index - 1];
_L2[index] = - Alpha * _L1[index] + _L1[index - 1] + Alpha * _L2[index - 1];
_L3[index] = - Alpha * _L2[index] + _L2[index - 1] + Alpha * _L3[index - 1];
_CU = 0;
_CD = 0;
if (_L0[index] >= _L1[index]) _CU = _L0[index] - _L1[index];
else _CD = _L1[index] - _L0[index];
if (_L1[index] >= _L2[index]) _CU = _CU + _L1[index] - _L2[index];
else _CD = _CD + _L2[index] - _L1[index];
if (_L2[index] >= _L3[index]) _CU = _CU + _L2[index] - _L3[index];
else _CD = _CD + _L3[index] - _L2[index];
if ((_CU + _CD) != 0) Result[index] = _CU / (_CU + _CD);
else Result[index] = Result[index - 1];
Result.Colors[index] = (Result[index] > OverboughtLevel.Value && Result[index - 1] > OverboughtLevel.Value) ? Color.Red
: (Result[index] < OversoldLevel.Value && Result[index - 1] < OversoldLevel.Value) ? Color.Green
: Result.Color;
}
}
}