Relative Strength Index
The Relative Strength Index or RSI is calculated with the following formula, where RS = Average Gain / Average Loss. 14 periods is generally used to calculate RSI but other periods may used, as long as the period is consistent throughout the calculation. The concept of Relative Strength Index is credited to J. Welles Wilder.
Average Gain = (SUM of the Total Gains for the preceding 14 periods)/ 14
Average Loss (|SUM of the Total Losses for the preceding 14 periods |) / 14
RS=Average Gain / Average Loss
RSI = 100 - ( 100 / 1 + RS )