Equity market Technical analysis in Python (series 2— RSI)

Eric Chen, CFA, FRM
5 min readJun 19, 2024

In this technical analysis series I first introduced SMA and demonstrated simply relying on SMA may not work as well as one would hope compared to a simple buy and hold strategy. In this article I’ll explore another technical analysis method and back test the profitability by this method alone, then further back test the combination of SMA and RSI. So if you are not that familiar with SMA, have a quick read to this link below and establish the foundation.

2. RSI

The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. Here’s a brief overview of its key features:

  1. Calculation:

RSI = 100 − 100 / (1 + RS)

  • where RS (Relative Strength) is the average of x days’ up closes divided by the average of x days’ down closes. The default period for RSI calculation is 14 days, but this can be adjusted to fit different trading strategies.

2. Interpretation: RSI values range from 0 to 100. Traditionally:

  • An RSI above 70 indicates that a security is overbought and may be primed for a trend reversal or corrective pullback.

--

--