Backtest Results for Connors RSI2 Strategy

rustam

Newbie
Messages
2
Likes
0
Hello. I recently got into backtesting and have tested a few strategies with mixed results.

I wanted to test a strategy that was already fairly well known, to see if it still holds up. This is the RSI 2 strategy popularised by Larry Connors in the book “Short Term Trading Strategies That Work”. It’s a pretty simple strategy with very few rules.

Indicators:

The strategy uses 3 indicators:
  • 5 day moving average
  • 200 day moving average
  • 2 period RSI

Strategy Steps Are:
  1. Price must close above 200 day MA
  2. RSI must close below 5
  3. Enter at the close
  4. Exit when price closes above the 5 day MA

Trade Examples:

Example 1:

The price is above the 200 day MA (Yellow line) and the RSI has dipped below 5 (green arrow on bottom section). Buy at the close of the red candle, then hold until the price closes above the 5 day MA (blue line), which happens on the green candle.

example1.png


Example 2: Same setup as above. The 200 day MA isn’t visible here because price is well above it. Enter at the close of the red candle, exit the next day when price closes above the 5 day MA.

example2.png


Analysis

To test this out I ran a backtest in python over 34 years of S&P500 data, from 1990 to 2024. The RSI was a pain to code and after many failed attempts and some help from stackoverflow, I eventually got it calculated correctly (I hope).

Also, the strategy requires you to buy on the close, but this doesn’t seem realistic as you need the market to close to confirm the final values of your indicators. So I changed it to buy on the open of the next day.

This is the equity chart for the backtest. Looks good at first glance - pretty steady without too many big peaks and troughs.

Notice that the overall return over such a long time period isn’t particularly high though. (more on this below)

analysis.png


Results

Going by the equity chart, the strategy performs pretty well, here are a few metrics compared to buy and hold:

results.png

  • Annual return is very low compared to buy and hold. But this strategy takes very few trades as seen in the time in market.
  • When the returns are adjusted by the exposure (Time in the market), the strategy looks much stronger.
  • Drawdown is a lot better than buy and hold.
  • Combining return, exposure and drawdown into one metric puts the RSI strategy well ahead of buy and hold.
  • The winrate is very impressive. Often strategies advertise high winrates simply by setting massive stops and small profits, but the reward to risk ratio here is decent.

Variations

I tested a few variations to see how they affect the results.

Variation 1: Adding a stop loss. When the price closes below the 200day MA, exit the trade. This performed poorly and made the strategy worse on pretty much every metric. I believe the reason was that it cut trades early and took a loss before they had a chance to recover, so potentially winning trades became losers because of the stop.

Variation 2: Time based hold period. Rather than waiting for the price to close above 5 day MA, hold for x days. Tested up to 20 day hold periods. Found that the annual return didn’t really change much with the different periods, but all other metrics got worse since there was more exposure and bigger drawdowns with longer holds. The best result was a 0 day hold, meaning buy at the open and exit at the close of the same day. Result was quite similar to RSI2 so I stuck with the existing strategy.

Variation 3: On my previous backtests, a few comments pointed out that a long only strategy will always work in a bull market like S&P500. So I ran a short only test using the same indicators but with reversed rules. The variation comes out with a measly 0.67% annual return and 1.92% time in the market. But the fact that it returns anything in a bull market like the S&P500 shows that the method is fairly robust. Combining the long and short into a single strategy could improve overall results.

Variation 4: I then tested a range of RSI periods between 2 and 20 and entry thresholds between 5 and 40. As RSI period increases, the RSI line doesn’t go up and down as aggressively and so the RSI entry thresholds have to be increased. At lower thresholds there are no trades triggered, which is why there are so many zeros in the heatmap.

See heatmap below with RSI periods along the vertical y axis and the thresholds along the horizontal x axis. The values in the boxes are the annual return divided by time in the market. The higher the number, the better the result.

While there are some combinations that look like they perform well, some of them didn’t generate enough trades for a useful analysis. So their good performance is a result of overfitting to the dataset. But the analysis gives an interesting insight into the different RSI periods and gives a comparison for the RSI 2 strategy.

heatmap.png

Conclusion:

The strategy seems to hold up over a long testing period. It has been in the public domain since the book was published in 2010, and yet in my backtest it continues to perform well after that, suggesting that it is a robust method.

The annualised return is poor though. This is a result of the infrequent trades, and means that the strategy isn’t suitable for trading on its own and in only one market as it would easily be beaten by a simple buy and hold.

However, it produces high quality trades, so used in a basket of strategies and traded on a number of different instruments, it could be a powerful component of a trader’s toolkit.

Caveats:

There are some things I didn’t consider with my backtest:
  1. The test was done on the S&P 500 index, which can’t be traded directly. There are many ways to trade it (ETF, Futures, CFD, etc.) each with their own pros/cons, therefore I did the test on the underlying index.
  2. Trading fees - these will vary depending on how the trader chooses to trade the S&P500 index (as mentioned in point 1). So i didn’t model these and it’s up to each trader to account for their own expected fees.
  3. Tax implications - These vary from country to country. Not considered in the backtest.
  4. Dividend payments from S&P500. Not considered in the backtest. I’m not really sure how to do this from the yahoo finance data, but if someone knows, then I’d be happy to include it in future backtests.
  5. And of course - historic results don’t guarantee future returns :)
Code

The code for this backtest can be found on my github: https://github.com/russs123/RSI

More info

The post is really long again so for a more detailed explanation I have linked a video below. In that video I explain the setup steps, show a few examples of trades, and explain my code. So if you want to find out more or learn how to tweak the parameters of the system to test other indices and other markets, then take a look at the video here:

Video:

What do you all think about these results? Does anyone have experience trading RSI strategies?
 
Hi @rustam I get the same or as close to, as you do. however i notice that for 30 years prior 1965 to 1995 the results are considerably different
win rate 66% ( excellent for a daily timeframe) but overall a net loss and negative annual return but more importantly a system drawdown of almost 40%
so whereas the strategy performs recently, for 30 years it went nowhere and were it not for the recovery from 1980 onwards as you can see in the graph you would be trading one of the worst strategies you could possibly imagine
as it stands its a winning strategy, but we'd need to add more criteria to stop it tanking as it did back then
1727032940882.png
 
Thanks for testing it out, it's good to get some confirmation from someone else replicating similar results. It's a bummer to see how badly it performed previously though.
I didn't go that far back in my tests as I figured 30 ish years is plenty but looks like it was terrible in the decades before.

One main concern I have with this strategy is the lack of a stop loss. It's what results in the high win rate, since it holds a trade through drawdown which often times ends up coming back up into profit, but those few times when that doesn't happen and price just runs away downwards seem to be what kill the strategy.

I've had a few suggestions from others on ways I could try to improve it like trailing stops, using the RSI values as exits (i.e. RSI goes back up above 50+), but I'm yet to test them out. I think a stop loss will protect the downside but will also cut a lot of winning trades prematurely, which is what I observed when I added the 200 ma stop loss.

Some things for me to try out anyway. Appreciate the feedback!
 
Thanks for testing it out, it's good to get some confirmation from someone else replicating similar results. It's a bummer to see how badly it performed previously though.
I didn't go that far back in my tests as I figured 30 ish years is plenty but looks like it was terrible in the decades before.

One main concern I have with this strategy is the lack of a stop loss. It's what results in the high win rate, since it holds a trade through drawdown which often times ends up coming back up into profit, but those few times when that doesn't happen and price just runs away downwards seem to be what kill the strategy.

I've had a few suggestions from others on ways I could try to improve it like trailing stops, using the RSI values as exits (i.e. RSI goes back up above 50+), but I'm yet to test them out. I think a stop loss will protect the downside but will also cut a lot of winning trades prematurely, which is what I observed when I added the 200 ma stop loss.

Some things for me to try out anyway. Appreciate the feedback!
I agree, even though your stop loss of 200ma earlier gave less favourable results, it may have been the key component.
Happy to help and look at scenarios, rather than just being part of the problem. I love the backtesting process!
 
Top