The Relative Strength Index (RSI) is a momentum oscillator used in technical analysis that measures the speed and change of price movements. The RSI oscillates between zero and 100 and is typically used to identify overbought or oversold conditions in a market, potential buy or sell signals, and possible price reversals.
RSI[N](price)
Where N represents the number of periods over which the RSI is calculated, and price specifies the price type (e.g., close, open, high, low).
The RSI is calculated using the formula:
RSI = 100 - (100 / (1 + (Average Gain / Average Loss)))
This formula calculates the ratio of average gains and average losses over the specified period N.
myRSI = RSI[14](close)
SmoothRSI = Average[10](myRSI)
RETURN myRSI, SmoothRSI coloured(121,45,180)
This example calculates the 14-period RSI of the closing prices and then applies a 10-period average to smooth the RSI values. The results are colored using RGB values (121, 45, 180).
This indicator is widely used in the analysis of financial markets to provide insights into the current and future price movements of assets.