The **relative strength index** (**RSI**) is a technical indicator used in the analysis of financial markets. It is intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period. The indicator should not be confused with relative strength.

The RSI is classified as a momentum oscillator, measuring the velocity and magnitude of directional price movements. Momentum is the rate of the rise or fall in price. The RSI computes momentum as the ratio of higher closes to lower closes: stocks which have had more or stronger positive changes have a higher RSI than stocks which have had more or stronger negative changes.

The RSI is most typically used on a 14-day timeframe, measured on a scale from 0 to 100, with high and low levels marked at 70 and 30, respectively. Shorter or longer timeframes are used for alternately shorter or longer outlooks. More extreme high and low levels—80 and 20, or 90 and 10—occur less frequently but indicate stronger momentum.

The relative strength index was developed by J. Welles Wilder and published in a 1978 book, *New Concepts in Technical Trading Systems*, and in *Commodities* magazine (now *Futures* magazine) in the June 1978 issue. It has become one of the most popular oscillator indices.

The RSI provides signals that tell investors to buy when the currency is oversold and to sell when it is overbought.

## Calculation

For each trading period an upward change *U* or downward change *D* is calculated. Up periods are characterized by the close being higher than the previous close:

Conversely, a down period is characterized by the close being lower than the previous period's close (note that D is nonetheless a positive number),

If the last close is the same as the previous, both *U* and *D* are zero. The average *U* and *D* are calculated using an *n*-period smoothed or modified moving average (SMMA or MMA) which is an exponentially smoothed Moving Average with *?* = 1/period. Some commercial packages, like AIQ, use a standard exponential moving average (EMA) as the average instead of Wilder's SMMA.

Wilder originally formulated the calculation of the moving average as: newval = (prevval * (period - 1) + newdata) / period. This is fully equivalent to the aforementioned exponential smoothing. New data is simply divided by period which is equal to the alpha calculated value of 1/period. Previous average values are modified by (period -1)/period which in effect is period/period - 1/period and finally 1 - 1/period which is 1 - alpha.

The ratio of these averages is the *relative strength* or *relative strength factor*:

If the average of *D* values is zero, then according to the equation, the RS value will approach infinity, so that the resulting RSI, as computed below, will approach 100.

The relative strength factor is then converted to a relative strength index between 0 and 100:^{[1]}

The smoothed moving averages should be appropriately initialized with a simple moving average using the first *n* values in the price series.

more details