Calculating the RSI
Any trading platform or technical analysis website you use is likely to include the RSI, so you probably won’t ever need to calculate it. However, knowing how it is calculated can help you understand exactly what the indicator measures.
The standard parameter or lookback period for an RSI is 14, though any number from 2 to 50 could be used. Commonly used parameters are 2, 5, 8, 14, and 21.
The RSI at any point in time compares the average positive movements to the average negative movements during the lookback period. To calculate it, you first separate the positive and negative movements and then average each.
Let’s say you are calculating the RSI for the following 5 price movements: 5, -2, -4, 3, 6
The positive average is (5+3+6)/3 = 4.67
The negative average is (2+4)/2 = 3
That gives a ratio of 4.67/3 or 1.56 which we call the RS. However, this number needs to be “normalised” to fall between 0 and 100.
To do this, we calculate 100 - (100/(1+RS)), which in this case is:
100 – (100/1+1.56) = 60.87
This is the RSI level at that point in time.