If you are a pulmonologist and a subscriber to Real Money or the other products at TheStreet, I apologize. We are not talking about the market breathing, but rather the number of securities rising or falling on any given day. Stocks, commodities, bonds or whatever is being traded can do one of three things: close higher than the previous session, lower or unchanged. Pretty basic stuff.

A stock that closes higher is an advancing issue and a stock that closes lower is a declining issue. Advancing and declining data are called the breadth of the market. A market has good breadth when we see more advancing stocks than declining stocks. There are some 3,000-plus stocks listed on the Big Board across the street from our offices in New York, and this can give you a better representation of "the broad market" than just 30 well-known companies.

Market breadth is an interesting and very important part of technical analysis that fewer and fewer people know about or make the time to follow. A market breadth line can be constructed for any stock market index or the stocks within an industry or sector, or even for an index of commodities like the old CRB Index. An advance/decline line based on the numbers from the New York Stock Exchange is the most widely followed and is an important leading indicator for major market tops. Please remember that this indicator does not work well at bottoms.

The research work for this indicator dates back to the 1920s when Col. Leonard P. Ayres was probably one of the first people to calculate and construct a breadth line. Ayres noticed something called "negative divergence" between the breadth of a market and the market averages or indexes. The large capitalization stocks that make up the Dow Jones Industrial Average (DJIA) or the S&P 500 will continue to rise until the end of a bull market. Typically, before these larger companies peak in price, smaller, lesser-known companies falter and turn south.

Do you remember the stock market top back in 2007? The DJIA peaked around 14,000 in October 2007 before the economic news turned negative in 2008. The advance/decline line on the NYSE peaked earlier, around the middle of 2007 (see the chart below). The early peak of the breadth line is called a negative or bearish divergence -- prices are doing one thing (going up) while the indicator is doing something else (going down or even sideways). Over the decades, the advance/decline line has peaked on average about four to six months before major market peaks.

Image placeholder title

There are a number of ways to dice the data from the NYSE, where a lot of securities trade. If you had the time and were good with a spreadsheet you may want to look at just actual operating companies on the NYSE, ignoring the securities of mutual funds and the like. (Lowry Research does a good job with this.)

How do we know when the advance/decline line is turning down? Great question. We could draw a trendline to see when the uptrend in line was broken, but we would need to wait for an actual decline to develop.

Image placeholder title

We could use moving averages that smooth the data and then we would wait for the slope of the moving average to turn negative. We could also follow the momentum of the line, knowing that momentum will peak before the actual data peak. Notice in the lower panel, above, that rate of change of the advance/decline line has been declining for months?

Image placeholder title

We can follow the advance/decline data of all the securities on the NYSE, above. Or we can follow just the stocks that are listed.

Image placeholder title

So now you know as much about the advance/decline line and market breadth as I do. The trend of the AD line is still up, but momentum has been slowing. I noted that on average the AD line has led or forecast market tops by four to six months. There have been two exceptions that I know about. The first was way back in 1937, which was well before my time. The DJIA rallied from 1932 to 1937 and the AD line peaked at the same time as the DJIA. From the 1937 peak, the DJIA declined about 50% over the next 18 months. The second occasion, which I do remember, was 1977 when the market and the AD line turned down together. 

Could this be the third time? Or will the market continue higher to the end of 2017? Stay tuned to Real Money and consider adding the AD statistics to your tool chest of indicators.

(This article originally appeared at 4:57 p.m. ET Thursday on Real Money, our premium site for active traders. Click here to get great columns like this from Jim Cramer and other writers even earlier in the trading day.)

More of What's Trending on TheStreet:

Employees of TheStreet are restricted from trading individual securities.