I am using wilder's simple RSI formula (Eup/Eup+Edown) where E=summation
here is my simple code
rsi() is an array, it's size is dependent on period, in this case is 14, it samples price every minute, not SMAed nor EMAed, not averaged. could this be a problem?
Do
If rsi(i - 1) - rsi(i) > 0 Then
cu = cu + (rsi(i - 1) - rsi(i))
End If
If rsi(i - 1) - rsi(i) < 0 Then
cd = cd + (rsi(i) - rsi(i - 1))
End If
i = i - 1
Loop Until i = 0
rsi=cu/cu+cd
the problem with this code/formula is inherent, when price change is very small, the RSI swings can be extreme from 0 to 100, How can I smooth my RSI without much lag. any help appreciated.
here is my simple code
rsi() is an array, it's size is dependent on period, in this case is 14, it samples price every minute, not SMAed nor EMAed, not averaged. could this be a problem?
Do
If rsi(i - 1) - rsi(i) > 0 Then
cu = cu + (rsi(i - 1) - rsi(i))
End If
If rsi(i - 1) - rsi(i) < 0 Then
cd = cd + (rsi(i) - rsi(i - 1))
End If
i = i - 1
Loop Until i = 0
rsi=cu/cu+cd
the problem with this code/formula is inherent, when price change is very small, the RSI swings can be extreme from 0 to 100, How can I smooth my RSI without much lag. any help appreciated.