External Strategy Rule Evaluation. Too many rules?

A common question I get is where do I find all my research ideas. My main source is Quantocracy. He does a great job of curating posts because the work is manually done. Then there the Better System Trader and Trend Following Radio podcasts. Usually from these sources I get a nugget of an idea to research or a simple strategy. Sometimes the post/podcast will recommend a book.

From one of these sources came the recommendation of the book “Trade Like A Stock Market Wizard” by Mark Minervini. Fortunately for me, my local library carried it. The strategy he covers in the book is a mixed of fundamentals, chart reading and technical analysis. Not something I would normally care about. I really enjoyed the chapters on risk management. In one chapter, he has very specific technical rules that all stocks must follow. On seeing this, I wondered could these rules be a basis for a trend following stock strategy? My second thought was, there are lots of rules there. Are all the rules necessary? The latter question is what I will focus on this post.

Understand that I am not testing the full strategy from the book because it contains fundamental rules too. I want to know if the technical rules alone could produce interesting results. The results that follow say nothing to the full strategy in the book.

The Rules

These are the technical rules from the book.

  1. Stock is above the 150-day moving average(MA)
  2. Stock is above the 200-day MA
  3. The 150-day MA is above the 200-day MA
  4. The 200-day MA is higher than it was 1 month ago
  5. The 50-day MA is above the 150-day MA
  6. The 50-day MA is above the 200-day MA
  7. Stock is above the 50-day MA
  8. Stock price is at least 30% above the 52-week low
  9. Stock price is within 25% of the 52-week high

To these rules, I added these two

  • Stock must be a member of the Russell 3000 index
  • The S&P500 index is trading above the 200-day MA

I added the market timing rule because trend following does best in a bull market.

When all the above rules are met, we buy on the next open. A maximum of 20 positions with 5% per position. If there are more signals then we have room for, we rank from high to low using the 1 year return. The ranking comes from the book preferring high relative strength stocks. The position sizing is my own.

Exit on the next open if one the following conditions happens. Both ideas are from the book

  • Close under the 200-day MA
  • Close with a 10% plus loss

My First Thoughts

Whenever I get a strategy to test, one of my first thoughts are all the rules necessary. I have no idea how someone has come up with all the rules. Did they start with them all? Did they add them one by one? This strategy seems to have lots of entry rules.

There are two ways I test whether all the rules are necessary. Method one, code up all the rules and then remove each rule one at a time to see how the removal changes from the having all the rules.

The second method is to run an optimization in AmiBroker were I turn each rule on and off. The strategy has nine rules but I cannot turn them all off because then we would have no entry rule. Given that one of the sell rules is a close under the 200-day MA, I will always have the entry rule that the stock is above the 200-day MA.

This gives us 8 rules to turn on and off for a total of 256 combinations.

All rules vs One rule

The first question is how does using all the rules compare to using just the single MA200 rule.

The good news is there is a significant improvement. The bad news as a basis for a trend following strategy these numbers are not good.

Are all those rules needed?

Using 2 rules only

What are the results of using two rules only?

The two grey rows beat the all rules version. Rule 9, stock near 52-week high and rule 1, stock above MA150 gave a good boost to the results.

 

Using 3 rules only

Here are all the only 3 rule versions that beat the all rule version.

Top 10 versions

From looking at the top 10 version, we can see that the best CAR is 14% above the best 2 rule version. Rule 3, MA 150 above MA200 does not get used. Since the top 4 variations have the same results, we can then assume that rule 4, MA200 up over last month, and rule 8, stock not near 52-week low, are not needed.

Spreadsheet

Fill the form below to get the spreadsheet to see all the results. I have also analyzed S&P500 stock universe and without the 200 day market timing rule. Lots more stats included.

Thank You

This is the last post for the year. Thank you to all you readers, those of you who posted comments, those of you that sent questions and those who sent in research suggestions. I really enjoy doing the research, writing the posts and interacting with traders.

Final thoughts

The main idea of the post was to show how to evaluate a strategy to determine if all the rules are needed or not. Here, I would only use two or three rules. I like less rules. When evaluating any strategy (even mine), it is always a good idea to test removal of rules to see if they really do add much. I do this with my own strategies after they are done. Even if the rule does seem to really improve the results, care must be taken to make sure it is not over-fitting the data to avoid a bad trade or get into a good one. A secondary goal was to find a base for a trend following strategy but that did not happen.

 

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

Good quant trading,

Fill in for free spreadsheet:

spreadsheeticon

 
Visited 45 times, 1 visit(s) today

Click Here to Leave a Comment Below

Pedro - December 8, 2017 Reply

Hi

Can you tive Ana example of Core on how to do this: “The second method is to run an optimization in AmiBroker were I turn each rule on and off.”

Thanks

    Cesar Alvarez - December 8, 2017 Reply

    Here is some sampel code
    use1 = Optimize(“Use1”, 1, 0, 1, 1);
    use2 = Optimize(“Use2”, 1, 0, 1, 1);
    use3 = Optimize(“Use3”, 1, 0, 1, 1);

    Buy =
    IIf(use1, C > MA(C,150), true) and
    IIf(use2, C > MA(C,200), true) and
    IIf(use3, MA(C,150) > MA(C,200), true) ;

Leave a Reply: