Recently I have been re-reading the book Quantitative Technical Analysis by Dr. Howard Bandy. This is a hefty book filled with quality information and important ideas on the topic of system development.
When I first got the book I may have been a bit overwhelmed by all the information, particularly the sections devoted to machine learning and using python. However, it is worth spending some time with this book in order to extract out all of the good stuff.
Testing The RSI Model In Quantitative Technical Analysis
Of particular interest in the book is the section on model development and Dr. Howard Bandy provides a number of working trading systems written in Amibroker AFL.
A number of the trading systems are based on standard technical indicators like the RSI.
The RSI model system originally appeared in Bandy’s other book Mean Reversion Trading Systems. I originally tested the system on my own machine and received some great results so I thought I would revisit the system and share some findings in this article.
Dr Bandy’s RSI Model is a classic mean reversion strategy that seeks to buy a security low and sell high with a short-term holding period.
The system is unique in that it uses lambda in order to exploit non-integer lookback lengths. This allows a lookback length that is not determined by the number of bars or days.
In the book, Dr. Bandy shows some promising results for the system when optimised in-sample including a win rate of 72% and an average gain per trade of 0.75%. Furthermore, the system was shown to be profitable in 432 of S&P 500 tickers.
This was acheived with values shown in the book as 0.47 for lambda, 16 for RSI buy level and 40 for RSI sell increment.
The book also shows some promising results in walk-forward tests. The optimisation of lambda and the RSI buy and sell levels attempts to keep the system in sync with the market as we move it through different out-of-sample windows.
For example, a walk-forward test on the ticker XLF (shown in the book) produced an average profit of 0.89% per trade over 10 years with an average holding period of 6 bars and a smooth equity curve.
I tested the system on a number of different tickers and also achieved good results.
In each test lambda values were optimised between 0.4 and 0.8 in increments of 0.01, the RSI buy level was optimised between 1 and 99 in increments of 1 and the RSI sell increment was optimised between 0 and 40 in increments of 1.
The system was optimised to find the best parameters over one year and then moved forward to test the same parameters on the proceeding year (out-of-sample). This process was repeated between 2003 and 2016.
By concatenating the walk-forward results together (year by year) we can get an idea of how the system has performed out-of-sample.
This is automatically calculated in Amibroker and can be viewed via the Report Explorer as one equity curve. This is one of the huge benefits of using Amibroker as walk-forward analysis is very simple.
RSI Model On Pepsico $PEP
Running a walk-forward of the RSI model on Pepsico Inc. between 2003 and 2016 gave an average profit of 0.3% per trade in the out-of-sample. 67.5% of trades were winners and the average trade length was 8.75 bars.
RSI Model On Verizon $VZ
Running a walk-forward of the RSI model on Verizon Inc. between 2003 and 2016 gave an average profit of 0.18% per trade in the out-of-sample. 67.2% of trades were winners and the average trade length was 3.28 bars.
RSI Model On Tesla $TSLA
Running a walk-forward of the RSI model on Tesla Inc. between 6/2010 and 6/2016 gave an average profit of 0.22% per trade in the out-of-sample. 83.33% of trades were winners and the average trade length was 2.83 bars.
RSI Model On Astrazeneca plc $AZN
Running a walk-forward of the RSI model on Astrazeneca plc. between 2003 and 2016 gave an average profit of 0.29% per trade in the out-of-sample walk forward. 62.5% of trades were winners and the average trade length was 3.15 bars.
RSI Model On Lockheed Martin Corp $LMT
Running a walk-forward of the RSI model on Lockheed Martin Corp. between 2003 and 2016 gave an average profit of 0.60% per trade in the out-of-sample. 78.2% of trades were winners and the average trade length was 6.58 bars.
In this short article we have run the RSI model as described in Quantitative Technical Analysis by Dr. Howard Bandy. It’s clear that this is a decent system that benefits from a short holding period and a high win rate.
We tested the system on a number of different tickers and found some promising results consistent with what was shown in the book. The results are also consistent with my previous analysis and they also extend past the publication date of the book which gives us extra confidence.
Thank You For Reading
Joe Marwood is an independent trader and the founder of Decoding Markets. He worked as a professional futures trader and has a passion for investing and building mechanical trading strategies. If you are interested in more quantitative trading strategies, investing ideas and tutorials make sure to check out our program Marwood Research.
This post expresses the opinions of the writer and is for information, entertainment purposes only. Joe Marwood is not a registered financial advisor or certified analyst. The reader agrees to assume all risk resulting from the application of any of the information provided. Past performance is not a reliable indicator of future returns and financial trading is full of risk. Margin trading can lead to losses more than in your account. Mistakes in backtesting and presenting of analysis regularly occur. Please read the Full disclaimer.