Creating a Variable RSI for Dynamic Trading. A Study in Python.

How to Create a Dynamic RSI to Enhance Trading Signals.

Sofien Kaabar, CFA
The Startup

--

In the last article, we have seen together how to create a Volatility-Adjusted Stochastic Oscillator. In this article, we will use the same reasoning on the RSI but we will adjust for correlation rather than volatility. The basic idea is to see whether we want to weigh the RSI’s lookback period based on a rolling correlation measure.

Our plan of attack will be to learn how to code an RSI that changes its lookback period at every period in time based on the latest rolling correlation measure between the price and a momentum calculation. The reason I have chosen a momentum calculation is that because we do not know the lookback period on the RSI yet and therefore, we cannot really calculate a correlation measure on it specifically. When we know the correlation between the momentum and the market price, we can transform this information into variable lookback periods for the RSI. We will see this in greater details below.

I have just published a new book after the success of New Technical Indicators in Python. It features a more complete description and addition of complex trading strategies with a Github page dedicated to the continuously updated code. If you feel that this interests you, feel free to visit the below link, or if you prefer to buy the PDF version, you could contact me on Linkedin.

--

--