Financial Time Series Toolbox | ![]() ![]() |
Relative Strength Index (RSI)
The Relative Strength Index (RSI) is a momentum indicator that measures an equity's price relative to itself and its past performance. The function name is rsindex
.
The rsindex
function needs a series that contains the closing price of a stock. The default period length for the RSI calculation is 14 periods. This length can be changed by providing a second input argument to the function. Similar to the previous commands, if your closing price series is not named Close
, you can provide the correct name.
Calculate and plot the RSI for IBM along with the price range using these commands:
rsi_ibm = rsindex(part_ibm); subplot(2, 1, 1); plot(rsi_ibm); title('RSI of IBM stock, 10/01/95-12/31/95'); datetick('x', 'mm/dd/yy'); hold on; plot(rsi_ibm.dates, 30*ones(1, length(wpctr_ibm)),... 'color', [0.5 0 0], 'linewidth', 2) plot(rsi_ibm.dates, 70*ones(1, length(wpctr_ibm)),... 'color',[0 0.5 0], 'linewidth', 2) subplot(2, 1, 2); highlow(part_ibm); title('IBM Stock Prices, 10/01/95-12/31/95'); datetick('x', 'mm/dd/yy');
Figure 3-3, Relative Strength Index (RSI) and IBM Stock Prices shows the resulting figure.
Figure 3-3: Relative Strength Index (RSI) and IBM Stock Prices
![]() | William's %R | On-Balance Volume (OBV) | ![]() |