• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Decoding Markets

  • Access All Areas
  • Courses
  • Free Book
  • Resources
    • Best Books
  • Blog
    • About
    • Free Class
    • Top Posts
You are here: Home / Amibroker / Testing A Powerful RSI Model By Howard Bandy

November 21, 2016 By Joe Marwood 3 Comments

Testing A Powerful RSI Model By Howard Bandy

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.

quantitative technical analysis bookWhen 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.

RSI Model

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.

Walk-Forward Results

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 pepsico

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 verizon

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 tesla

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 azn

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.

rsi model on lmt

Final Thoughts

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.

 

Tests in this article were produced in Amibroker using data from Norgate Premium. Commissions were set at $0.005 per share.


Thank You For Reading

joe marwood profile pictureJoe 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.


Disclaimer

This post expresses the opinions of the writer and is for information or entertainment purposes only. It is not a recommendation or personalised investment advice. 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, historical or simulated results  are not a reliable indicator of future returns and may not account for real world settings. Financial trading is full of risk and margin trading can lead to financial losses totalling more than what is in your investment account. We take care to present accurate analysis but mistakes in backtesting and presenting of analysis regularly occur. Please read the Full disclaimer.


Comment Policy

Thank you to everyone who takes the time to leave a comment. Your feedback, constructive criticism and identification of mistakes is welcome. In order to concentrate on work I may not have time to respond to all comments.

Filed Under: Amibroker, Stocks, Strategies/ Systems, Top Posts Tagged With: amibroker, systems

Recommended Educational Resources:


  • Discover New Trading Strategies
  • Learn Japanese Candlesticks (Free)
  • Mental Models For Trading (Free)
  • Indicators For Amibroker (Free)
  • Tools For Options Traders (Free)
  • Historical Data For 8000 Stocks (Free)

Reader Interactions

Comments

  1. Jay says

    November 24, 2016 at 1:52 am

    Thanks for sharing your results Joe. Definitely looks like a pretty high win rate on a consistent basis. As long as the average loss isn’t too big this looks like it could be a neat trading system use or build-on. Thanks again!

    Reply
  2. iq says

    November 26, 2016 at 12:45 am

    You should try backtesting and optimising an equity portfolio using Bandy’s algorithms. I have added preselection so that only ten positions are active at any one time. Using the a backtesting engine I have written in C# which has a genetic optimiser, I get excellent results using the walk-forward sample!

    Reply
    • JB Marwood says

      November 27, 2016 at 9:26 pm

      Very interesting, thanks. I did start out with a portfolio but it was taking too long to optimise all the parameters. How do you approach issue selection?

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Decoding Markets

We build trading strategies that give you more profit with less stress.

joe marwood beach

Popular

The Truth About Intraday Momentum

RSI trade divergence example

3 Simple Ways To Trade Divergence

26 Stock Market Strategies Designed To Make You Money

Should You Invest In Dividend Aristocrats?

trade example in the us ten year

Shorting The US Ten Year With ATR – A Simple System That Shows A Profitable Edge

Easy Amibroker Tutorial – Learn Amibroker In Under An Hour

Financial Disclaimer

Financial trading is risky and short-term trading is hard. You can lose money. Joe Marwood is not a registered investment advisor and nothing on this site is to be regarded as personalized investment advice. Past performance is not indicative of future results. Data errors and mistakes do occur. Please see the full disclaimer.

Footer

About The Author

Joe Marwood is an independent trader and investor specialising in financial market analysis and trading systems. He worked as a professional futures trader for a trading firm in London and has a passion for building mechanical trading strategies. He has been in the market since 2008 and working with Amibroker since 2011.

Joe Marwood Profile PIc

Recent Posts

  • Contagion In Crypto
  • Can You Predict Cryptocurrencies?
  • Do Sell-Side Analysts Know Better?
  • Using Fundamental Data To Improve Momentum Investing Strategies
  • 5 Economic Indicators That Matter To Investors
  • How To Make Money In REITs
  • Follow The Leader To Make Money In Stocks
  • Can You Make Money From Short Seller Reports?

Categories

Search

Topics

  • Amibroker
  • Investing Books
  • Mean Reversion
  • Stock Trading Strategies
  • Technical Analysis
  • Trend Following
  • Quant Trading

Privacy policy | Contact | Disclaimer | All Rights reserved. Decoding Markets.