This is an implementation of John Ehlers’ Smoothed RSI, as described in RSI Smoothing.
// Smoothed Relative Strength Index (SRSI)
// RSI Smoothing
// John F. Ehlers
// http://www.stockspotter.com/Files/rsismoothing.pdf
// Parameter
Len = 14
Smooth23 = (Close + 2*Close[1] + 2*Close[2] + Close[3])/6
CU23 = 0
CD23 = 0
For count = 0 to Len - 1 do
If Smooth23[count] > Smooth23[count + 1] then
CU23 = CU23 + Smooth23[count] - Smooth23[count + 1]
Endif
If Smooth23[count] < Smooth23[count + 1] then
CD23 = CD23 + Smooth23[count + 1] - Smooth23[count]
Endif
Next
If CU23 + CD23 <> 0 then
SRSI = CU23/(CU23 + CD23)
Endif
return SRSI*100 as "SRSI"
The attached screenshot shows J. Welles Wilder’s RSI (black) and John Ehlers’ Smoothed RSI (red) with a period of 14.