For a few months now I’ve been tracking my own market breadth/diffusion index by hand in a spreadsheet. I realized a few days ago that I could automate it and also create historical composite data by using certain commands in AmiBroker. Since then I’ve been ruining my eyesight gazing at charts and spreadsheets, and I’ve come up with something that looks interesting.
Here’s a chart to prove I’ve been working hard:
Here’s what I do:
For the set of Russell 3000 stocks, each day I have AmiBroker count up the number of tickers that closed at least 4% above their closing price from yesterday, as well as the stocks that closed at least 4% down. Then I calculate the ratio of advancers to advancers+decliners. Ratio=A / (A + D). That’s the column on the far right of the spreadsheet above.
I then look for divergences between this ratio and the closing price of the S&P 500. Most of the time it’s in sync, but every once in awhile it diverges. The S&P will go down while the ratio goes up, and vice versa.
The upward red lines show potential bullish divergence, where the S&P went down and the ratio went up. The downward red lines show the opposite. The blue line is the closing price of SPY between 9/2/2014 and 4/13/15.
Ok so yes there’s a divergence from time to time, but does it hold any predictive value?
60.00% of the divergence signals are followed by an up day for the S&P. Hmm, that could be useful, right? Now keep in mind I’ve only done this for the period in question, so it’s just a preliminary dip of the toe in the statistical water.
And I’m sure you’re asking yourself: is this actually better than pure chance? What if the market had “up” days 60% of the time? I’d better measure that as well.
Turns out during this period of time, the S&P closes up from the previous day 51.30% of the time. So 60% vs 51% seems pretty significant (pending further testing).
The reverse wasn’t true however. The negative divergence signal was predictive only 47.62% of the time. Perhaps the predictive power is dependent on the longer-term trend.
I don’t know if this measurement would be strong enough to trade SPY on its own, but perhaps it offers some short-term market-timing abilities when used in conjunction with other techniques. For those of you who like to crunch numbers, it’s something to explore.