By STEVE ROTHWELL
AP Markets Writer

NEW YORK (AP) _ One of the oldest trading strategies in the book is showing a yellow flag for stock investors, but analysts say it’s not quite time to sell yet.

The Dow Jones industrial average closed at an all-time high last month, extending a bull market that stretches back more than six years. However, another gauge that tracks airlines, railroad and freight companies _ the Dow Jones transportation average _ has gone the other way, slumping to a seven-month low at the end of May.

The theory is that the transportation sector is a leading indicator for the economy. If consumers and business are buying more, then goods have to be transported by plane, rail or ship. That should benefit the companies moving the goods.

If they’re buying less, the thinking goes, there’s less demand for transportation services, meaning trouble ahead for the economy and the stock market.

That thought is the underpinning of Dow Theory, a system for timing when to get in and get out of the stock market. It’s based on the musings of Charles Dow, the co-founder of Dow Jones & Co., who started assembling stock indexes in the late 1800s. Adherents to the strategy say that it signaled big stock market sell-offs in 1929, 1937 and 2000.

The Dow Jones transportation average, which consists of 20 stocks, was down as much as 9.6 percent from a recent peak in February through the end of May. It has recovered some of those loses this week, but is still down 7.7 percent for the year.

Kansas City Southern, a rail company that operates in the central and southern U.S., has been the worst performer in the index, falling 24 percent so far this year. United Continental, the railroad Union Pacific and freight company UPS are among other stocks that have dropped.

The slump in transports contrasts with the performance of the 30-member Dow Jones industrial average, which includes stocks in many industries including sporting goods, banking, entertainment and technology. The index is up 0.5 percent this year and closed at an all-time high of 18,312 on May 19.

Still, many analysts remain sanguine about the outlook for the broader market.

While the divergence between the Dow Jones industrial average and the transportation index is one indicator of uncertainty, you need to see more danger signs before you get out of stocks, said Bruce McCain, chief investment strategist at KeyPrivate Bank. For example, weakness in other sectors that are particularly sensitive to economic growth, such as technology and industrial stocks.

“It’s the cockroach theory of divergences,” said McCain. “When you see one, you watch and you’re careful about it, but you don’t worry unless you see five or six.”

McCain says that the slump is due to a recent rise in the price of oil that could push up fuel costs for the sector. Transportation companies benefited last year as oil prices plunged amid a supply glut. Now, though oil is rebounding and trading at close to $60 a barrel after falling as low as $42 in March.

The transportation index is the descendent of the first stock index assembled by Charles Dow. That index, which was created in 1884, consisted of nine railroads, Pacific Mail Steamship and Western Union.

Detractors of Dow Theory say that the world has changed significantly since the Gilded Age and the heyday of the railroads in the late 19th and early 20th centuries, when they were among America’s biggest companies. While the sector is still significant for the economy, other industries such as technology are now equally, if not more, important.

“Times have changed,” said Katie Stockton, a technical strategist at brokerage firm BTIG.