Hopefully you learned from my previous post that a relentless bull market can cause bloggers who are tired of making money or are not making money (for whatever reason) to begin calling tops. Actually, I didn’t write that in that post, but I think there may be some truth to it. Luckily, I am not in either of those camps.
But what else do I write about during a raging bull market except a possible top?
Exactly.
So here we go. When we start to examine markets to try and gauge when exhaustion might begin, one of the ways I like the most is to count the number of days above a major moving average and then use that as a buy setup. It is very simple, easily re-created, and there are usually plenty of samples with which to work.
With that in mind…
The Rules:
- Buy $SPY or $SPX at the close when it has closed 77 days above its 200 day moving average.
- Sell X days later at the close.
- All $SPY history (~20 years) and all $SPX history (~80 years) used.
- No commissions or slippage included.
The Results:
The results surprised me. Even though I have become inured to backtests that almost always show an upward bias, I was really expecting these results to show some increasing volatility, at the very least.
And I can’t even use sample size as a limiting factor for this study. The results are bullish and I feel comfortable saying so.
Some stats:
- SPY Samples: 898 occurrences with 41 held for the full 50 days
- $SPX Samples: 4011 occurrences with 187 held for the full 50 days
- $SPX Percentage of Winning Trades: 62.36%
- $SPX Average Winning Trade: 6.13%
- $SPX Average Losing Trade: -6.50%
At this point in the market history, with $SPX 77 days above its 200 day moving average, the market was higher 50 days later every 2 out of 3 trades. And on the downside, the losing trades were not very large relative to the winning trades.
Finally, lets take a look at the equity curve generated using $SPX:
The system occasionally catches huge winning trades: 1950-1960, 1980-1990, and 1990-2000.
Let’s look at the drawdowns:
The setup has been in a fairly significant drawdown since 2010. There has only been one other instance during the 1940s where the drawdown got worse. Should we expect that the current trade may be the one that begins erasing the drawdown rather than increasing it? If that is the case, this bull has much farther to run.
That is interesting… I prefer long/short systems, so I’m curious what the short results would look like w/ SPX/SPY below 200dma for 77 days??
Hmm. Don’t know. I’ll check.
I just ran the test. Results for shorts are very neutral. You would have lost money over the past 80 years, but not everything.
Hello, interesting study. I was trying to understand your results. are you saying the signal is “exactly 77 days above 200ma” or the signal is “at least 77 days above 200ma”. In other words discrete or overlapping periods?
Thanks, Nat
Good question. The code used “at least 76 days above 200ma.”
So there will be some trades where the trade is sold on the 126th day and then bought again the next day and held again for 50 days.
I don’t know how many but I could count them if you are really interested.
Nat, had more time to think about your question while driving today.
There are overlapping periods in the chart I made in excel but not in the equity curve.
The excel chart is an average of all times the setup is true. Let me explain.
If on the 77th day it is above the 200MA, then it starts recording performance. If on the 78th day it is still true, we now have 1 trade open for 2 days and a new one open for 1 day. If on the 79th day it is still true, we have 1 open for 3 days, 1 open for 2 days, and 1 open for 1 day. This pattern repeats until the setup is no longer true. This is why we have 898 occurrences on the 1st day but only 41 held for the full 50 days. So there is quite a bit of overlap, but it is the great amount of overlap that provides an average with enough samples to consider reliable.
898 occurrences over 20 years is 45 times a year, so this is pretty common. I’m surprised it’s so bullish. The last paragraph seems like a reasonable conclusion to me. Maybe it’s been so long since the last bull market we’ve all forgotten what they feel like.
Nice analysis, as usual.
Keep in mind that if we have a market trading above its 200MA for 177 days, that will count as 101 samples. Each day > 76 days is a new sample.
Why has it had such a big drawdown since 2010 when the market has gone up over 30% since then?
It has just had a run of bad luck where the market has corrected soon after it was above its 200MA for more than 76 days.
Or you just don’t recognise we’re in a cyclical bull within a secular bear…5 more years to go.
Wood it might be worth adding in a % above calc as well. If we are just above the 200 MA then we may have a nice steady climb or if we are well above then it may be more short sharp spike and more of a top.
Just an idea
That’s a good one too Twister. I could add that to the test as an additional factor.
I particularly like the % above calc for shorter term like the 20 or 50.
If the study is at least 77 days above I’m not really surprised by the results as mentioned this is quite common and basically indicating we’re in a solid uptrend. I would like to see some stats however on long up streaks such as the one for the DOW being up 9 days in a row. Not very common scenario.
Stats on DOW being up 9 days in a row: http://ibankcoin.com/woodshedderblog/2013/03/13/dow-jones-makes-9-consecutive-higher-closes-what-happens-the-next-50-days/
More common than you might think!
Hasn’t happened in 17 years!! Common? ???? Thanks!!