Learn the stock market › Test a strategy › Lesson 2 of 5
Five ways to fool yourself
1. Only the survivors
If you test a rule on today's largest companies, you are testing it on winners. Companies that fell and disappeared are missing, and they are exactly what a rule would have had to get through. This is how the 15 largest US companies of today that existed 20 years ago did:
| Company | Times the money |
|---|---|
| Nvidia | 364 |
| Netflix | 163 |
| Apple | 144 |
| Amazon | 136 |
| Mastercard | 75 |
| Eli Lilly | 42 |
| Costco | 29 |
| Microsoft | 26 |
| Alphabet | 24 |
| AMD | 21 |
| Walmart | 12 |
| JPMorgan Chase | 12 |
| Oracle | 8.1 |
| Berkshire Hathaway | 8.0 |
| Exxon Mobil | 4.5 |
| S&P 500 with dividends | 7.8 |
The middle company grew 26 times, and 14 of the 15 beat the index. The whole S&P 500 with dividends grew 7.8 times. The index also held the companies that did badly and dropped out along the way. Nobody in 2006 could know which ones would end up largest.
The US companies in this course are today's largest too, and so are those in the study on technical analysis. That is why the rule is also tested on a whole index, where nothing has been sorted out.
2. A peek into the future
It is easy to use, by accident, a price that didn't exist when the decision was made. If the test owns the stock on the very day the price crosses the average, and counts that day's rise, it has looked one day ahead. On the S&P 500 since 1928, the 200-day rule returned 6.9% a year. With one day's peek ahead it returned 16.5%, and its largest fall shrank from −54% to −26%. The mistake fits in one spreadsheet cell.
3. Too many tries
Why 200 days? We tried 12 lengths of the average, from 25 to 300 days, and split the history into two halves:
| Days in the average | 1929–1978 | 1978–2026 |
|---|---|---|
| 25 | 4.9% | 3.9% |
| 50 | 5.4% | 4.5% |
| 75 | 6.0% | 5.0% |
| 100 | 5.8% | 4.9% |
| 125 | 5.7% | 5.5% |
| 150 | 6.2% | 7.1% |
| 175 | 5.6% | 7.7% |
| 200 | 5.6% | 7.8% |
| 225 | 5.6% | 7.4% |
| 250 | 5.6% | 6.7% |
| 275 | 4.5% | 6.9% |
| 300 | 4.2% | 7.5% |
| Buy and hold | 2.5% | 9.5% |
The best in the first half was 150 days, at 6.2% a year. In the second half the same length came in at number 5 of 12. The best there was 200 days, which had been number 5 in the first half.
Try many variants and keep the best, and you have largely picked the one that was lucky during that time. The more tries, the better the best one looks, without the rule getting any better. That is why you set aside part of the history and don't look at it until the rule is fixed.
4. No costs
The rule made 589 buys and sells in 98 years, about 6 a year. Each trade costs a commission and the spread, and a gain is taxed. How much that takes is in the lesson on costs and tax in the test.
5. The period that suits
The same rule, decade by decade:
| Decade | The rule | Buy and hold |
|---|---|---|
| 1930s | 3.3% | −5.0% |
| 1940s | 4.4% | 2.8% |
| 1950s | 11.8% | 13.7% |
| 1960s | 5.9% | 4.5% |
| 1970s | 2.4% | 1.3% |
| 1980s | 12.8% | 13.0% |
| 1990s | 10.8% | 15.0% |
| 2000s | 2.5% | −2.5% |
| 2010s | 6.5% | 11.1% |
| 2020s | 8.6% | 12.7% |
The rule beat holding the index in five of the ten decades: 1930s, 1940s, 1960s, 1970s and 2000s. It fell behind in 1950s, 1980s, 1990s, 2010s and 2020s. A test that covers only some of them can show almost any answer, depending on where it starts.
Looking for what supports what you already believe is confirmation bias, and feeling afterwards that the outcome was obvious is hindsight bias. Both make it easy to choose the period and the variant that look best.
Test yourself
A rule made far more than the index in a test on today's ten largest companies. What do you check first?