Relative Strength Index (RSI)
factor.formula
UM (Upward Momentum):
DM (Downward Momentum):
UA(N) (N-day average upward momentum):
DA(N) (N-day average downward momentum):
RSI (Relative Strength Index):
UA initial value:
DA initial value:
default value:
In the formula:
- :
The closing price of the day. It is the basic price data for calculating the Relative Strength Index (RSI).
- :
Yesterday's closing price, used to calculate today's price change.
- :
Upward Momentum: If the closing price of the day is higher than the previous day, the difference between the closing price of the day and the closing price of the previous day is taken; if the closing price of the day is equal to or lower than the previous day, the value is 0. That is, only the increase in price is considered.
- :
Downward Momentum: If the closing price of the day is lower than the previous day, the difference between the previous day's closing price and the current day's closing price is taken; if the closing price of the day is equal to or higher than the previous day, the value is 0. That is, only the magnitude of the price decline is considered.
- :
N-day average upward momentum. The average upward momentum of the last N trading days is calculated using the exponential moving average (EMA) method.
- :
N-day average downside momentum. The average downside momentum over the last N trading days is calculated using the exponential moving average (EMA) method.
- :
The initial value of UA is calculated by using the simple moving average (SMA) to calculate the average of UM over N days as the initial value.
- :
The initial value of DA is calculated by using the simple moving average (SMA) to calculate the mean of N-day DM as the initial value.
- :
The time period for RSI calculation, the default is 14. It indicates the time span of price changes used to calculate RSI, usually set to 14 trading days. Shorter periods make RSI more sensitive, while longer periods make it smoother.
factor.explanation
The Relative Strength Index (RSI) measures the strength of market prices by comparing the average increase to the average decrease over a period of time, with a value range of 0 to 100. The interpretation of RSI values is as follows:
-
Overbought: When the RSI value is above 70, it is generally considered to be an overbought state, indicating that the market price may be overvalued and a decline or correction may occur in the future. The overbought state may indicate that buying power is exhausted and the market is about to turn.
-
Oversold: When the RSI value is below 30, it is generally considered to be an oversold state, indicating that the market price may be undervalued and a rebound or recovery may occur in the future. The oversold state may indicate that selling power is exhausted and the market is about to reverse.
-
Neutral zone: When the RSI value is between 30 and 70, it is considered to be a neutral zone, indicating that the market is in a state of consolidation or unclear trend.
The RSI indicator can be used to identify potential trend reversal points, but it is not a perfect indicator and should be used in conjunction with other technical analysis tools. For example, when RSI diverges, that is, when prices reach new highs/new lows, but RSI fails to reach new highs/new lows simultaneously, it can be used as a signal of trend reversal. In addition, the performance of the RSI indicator may vary in different markets and time periods, and the parameters and interpretation should be adjusted according to the specific situation.