RSI2 Strategy: Double returns with a simple rule change

While playing around with a 2 period RSI (Relative Strength Index) mean reversion strategy, I came up with a very simple rule change with a much larger impact on the results than expected. I doubled the compounded annual growth rate and cut the maximum drawdown in half. That never happens.

In my optimization runs the best CAR went from lows 10’s to the low 20’s with this rule change.

The Initial Pullback Strategy

Test range from 1/1/2007 to 6/30/2018.

I originally tested this.

Set up Rules

  1. Stock is member of the Russell 3000 index
  2. The as traded price is greater than $1
  3. The 21 day moving average of close*volume greater than $500K
  4. Close is greater than the 100 day moving average
  5. RSI2 is less than 10

Rule A gives us our trading universe.

Rules B & C are liquidity rules

Rule D is to keep us in uptrending stocks

Rule E is our sell off rule. Nothing fancy.

Entry Rules

  • If we have a set up, then enter a limit order for the next day at 5% below the close. Order good for one day only.
  • Only place enough orders so if they are all filled you are not in more than 10 positions
  • If have multiple set ups, then rank from high to low by the 100 day historical volatility.

We enter on additional intraday weakness.

Exit Rules

  • RSI is greater than 50 or after 10 trading days
  • Exit on next open

Simple mean reversion exit of waiting for the bounce. No stops. You may have also noticed there is no market timing rule.

Got a guess on which rule I changed?

The Results

These numbers are really disappointing. I was expecting to have a large drawdown but the CAR was much lower than I expected. Also, the returns in 2016 and 2017 are bad.

The Simple Rule Change

I could have tried to add more rules but I did not want to down that route. Recently I have been thinking a lot about preinclusion bias into an index. And then hearing about how GE got removed from the DOW. That got me thinking about something that I read long ago that stocks removed from an index tend to better than those added. So I thought, how about only trading stocks that were in the Russell 3000 index in their past but currently are not.

The change in rule A, from above, becomes stock is not in Russell 3000 index but was so in the past. These are ex-index stocks.

Ex-Index Stock Results

My main concern was would there even be enough of these stocks to trade? Would we just get into a lot of losers?

It is rarely that results like this happen. By every portfolio metric results got significantly better. Here are the improvements.

  • Exposure down 29%. I was right about exposure being less.
  • CAR up 121%. Holy cow!
  • MDD down 54%. WTH!
  • Ulcer Index down 56%
  • Avg % profit/loss up 150%
  • % winners up 5%
  • Sharpe Ratio up 172%

Additional Numbers

I know what you are thinking. I simply cherry picked the best results. Here are the cherry picked numbers. The change in the rule is from RSI2 < 10 to RSI2 < 15.

  • Exposure down 16%
  • CAR up 698%
  • MDD down 24%
  • Ulcer Index down 41%
  • Avg % profit/loss up 374%
  • % winners up 4%
  • Sharpe Ratio up 1129%

Spreadsheet

File the form below to get the spreadsheet with lots of additional information. See the results of all variations from the optimization run. This includes top drawdowns, trade statistics and more.

Final Thoughts

Sometimes it is not more rules or better indicator but simply a small conceptual change in a rule that makes the big difference. Try this idea on your strategies and see if it helps. One downside to this rule change is that some trades are OTC stocks. Having the right data for this test is important that is why I recommend Norgate Data. A good mean reversion strategy with a simple rule change.

Backtesting platform used: AmiBroker. Data provider: Norgate Data (referral link)

Good quant trading,

Fill in for free spreadsheet:

spreadsheeticon

 
Visited 265 times, 1 visit(s) today

Click Here to Leave a Comment Below

MP - August 1, 2018 Reply

I’m a bit confused. 1,947 trades in the original strat? That number seems really small; was it cut off?

Also, I’m not clear on what the Additional Numbers section is showing. Full universe, or just ex-index stocks? Why is the RSI threshold being changed, and what is the conclusion? Assuming the two rows are only different in RSI levels of trigger, the massive difference in returns between the two suggests it’s not a robust variable. Or…maybe I am missing something.

Thanks.

    Cesar Alvarez - August 2, 2018 Reply

    For the 1947 trades, that is correct. I am only placing orders such that if they all get filled I will only be 100% invested. So most orders do not fill.
    Rows with 2 in column Ah are those only trading ex-index stocks. A 1 in that column means they are currently in the index.
    Could you give me specifc variations that you are comparing to? It is hard to answer in the general.
    You can also use the contact me form to ask the questions directly.

mhp - August 1, 2018 Reply

Most of the difference comes from the subset of stocks where the as-traded entry price was under $10. I expect you’re right that many of these would have been OTC at the time. Therefore much larger slippage assumptions (or partial limit fill assumptions) need to be applied. Also, watch out for a huge outlier trade: CPXX on 3/15/16 for a 400% gain.

@mp, the low trade count is because if his requirement to never place more than 10 limit orders per day. Most will not be hit.

    Cesar Alvarez - August 2, 2018 Reply

    I did not investigate if most of the entries came with prices under $10. I would not be surprised. As to most of them being OTC, that is hard to really know for sure. For what I could tell it is appears to be about 10% of them but again hard to tell.

    None of the runs that I tested got into this trade. Of all 142 runs that largest winner is 150%. Of those that I showed in the post the largest winner is 100%.

Paul - August 2, 2018 Reply

Could the improved return be coming from stocks BEFORE they were in the index? Did your code only look at stocks after they dropped out of the index, and exclude those small caps which were destine to become Index constituents in the future?

    Cesar Alvarez - August 2, 2018 Reply

    The code only enters the stocks only if they are not currently in the index and have been sometime in the past.

Curt Carlson - August 2, 2018 Reply

You indicate that using RSI2 < 15 instead of RSI2 < 10 "cherry picking". What metric are you optimizing?

    Cesar Alvarez - August 2, 2018 Reply

    I optimized RSI Entry, MA Len, RSI Exit and Limit %. You can see all those values in the spreadsheet.

Thomas Musselman - June 26, 2019 Reply

If quantopian doesn’t have index historical constitutents and Norgate doesn’t either (do either?) how are you running this?

    Cesar Alvarez - June 26, 2019 Reply

    Norgate does have index constituent data.

Robert - June 26, 2019 Reply

Can you re-run the backtest excluding all OTC stocks from purchase eligibility? I know that Norgate makes it possible to exclude OTC stocks using their AmiBroker plug-in function NorgateMajorExchangeListedTimeSeries(). Thanks.

    Cesar Alvarez - June 27, 2019 Reply

    Norgate added that ability after I published this. Added that the stock is a major listed increases returns 65% instead of 100%.

Giles Archer - April 16, 2020 Reply

Hi Cesar,

Thank you for the great Post.

Can I ask what % of the average daily volume you are comfortable being with a strategy such as this one?

    Cesar Alvarez - April 16, 2020 Reply

    I don’t have a hard number but I would say about 1%.

Leave a Reply: