Investors have rushed to get in on AI stocks over the past few years, pushing the S&P 500 higher.
The index’s momentum has continued this year, but headwinds have emerged.
The S&P 500 has been on fire in recent years, rocketing higher amid enthusiasm about artificial intelligence (AI) companies -- investors have seen this technology as the next big revolution, likening it to the printing press, the telephone, and the internet. The idea is that AI may transform the way many things are done across the business world and even throughout our daily lives. The result could be significant earnings growth for the developers and users of this hot technology.
Some companies have offered us a taste of this potential. Chip designer Nvidia and cloud computing player Alphabet are good examples, as their offerings of AI products and services have supercharged growth. As a result, investors have piled in, sending these stocks to triple-digit gains over the past three years.
Missed Nvidia in 2009? This Rare Signal Is Flashing Again. In 2009, a "Double Down" signal flashed for a little-known chipmaker called Nvidia. For the first time in years, that same "Total Conviction" signal is flashing for a company 1/100th the size of Nvidia. Continue »
But, against this exciting backdrop, trouble could be brewing. In fact, the stock market just flashed a warning sign only seen once before in 155 years -- and history is very clear about what happens next.
Image source: Getty Images.
So, first, let's take a quick look at the current and recent stock market environment. As mentioned, the S&P 500 has soared over the past few years amid the AI boom. But over the past several months, cracks have begun to appear in the earlier smooth surface. Headwinds have swept in, with some general and others more specific to AI companies.
Geopolitical tensions have made investors more cautious, prompting them to rotate into sectors seen as offering "safety," such as healthcare. Patients always need their treatments and services, and this leads to ongoing revenue growth for companies in the industry -- regardless of the economic backdrop. And speaking of the economy, investors have worried about the direction of interest rates as inflation gained ground -- inflation in May reached its highest level in three years. And a new chair at the helm of the Federal Reserve -- Kevin Warsh took on the role as Jerome Powell's term came to an end -- added to uncertainty as investors speculated about the direction of policy ahead.
Investors have also worried about technology companies' levels of spending on AI and have questioned whether it will match the revenue opportunity over time. Alphabet, Microsoft, Meta Platforms, and Amazon announced spending of nearly $700 billion this year on AI build-outs. Though these and many other tech giants have reported solid earnings, and AI demand continues to climb, investors are more cautious about AI stocks than they were several quarters ago.
Still, overall, AI stocks and other growth players have continued to march higher. This year, companies providing the memory and storage needed for AI have been the stars, with Sandisk and Micron Technology each soaring in the triple-digits in the first half.
And this movement has led to a very rare happening. The S&P 500 just flashed a warning sign only seen once before in 155 years, and it has to do with valuation. The S&P 500 Shiller CAPE ratio, an inflation-adjusted view of earnings per share in relation to price, recently surpassed the level of 41.

S&P 500 Shiller CAPE Ratio data by YCharts
The only other time this has happened was during the dot-com boom. This means that right now, just like during that period 26 years ago, stocks are looking very expensive. Analyses of the data over 155 years show the average reading at about 17, and today we're very far from that level.
Now, let's consider what history tells us about what happens next. When the S&P 500 Shiller CAPE ratio peaked in the past, declines in the S&P 500 have always followed.

S&P 500 Shiller CAPE Ratio data by YCharts
So today, with stocks at their second-priciest level ever, history is very clear: The S&P 500 may be heading for a drop, led by certain overvalued stocks.
Luckily, this isn't necessarily a recipe for disaster, particularly if you're a long-term investor. This is because history also shows us that holding onto quality stocks for the long term generally translates into an investing win -- the S&P 500 has always gone on to recover and advance over the years. All of this means that while this recent warning sign may signal a decline ahead, the long-term investing picture remains bright.
Before you buy stock in S&P 500 Index, consider this:
The Motley Fool Stock Advisor analyst team just identified what they believe are the 10 best stocks for investors to buy now… and S&P 500 Index wasn’t one of them. The 10 stocks that made the cut could produce monster returns in the coming years.
Consider when Netflix made this list on December 17, 2004... if you invested $1,000 at the time of our recommendation, you’d have $410,833!* Or when Nvidia made this list on April 15, 2005... if you invested $1,000 at the time of our recommendation, you’d have $1,208,693!*
Now, it’s worth noting Stock Advisor’s total average return is 917% — a market-crushing outperformance compared to 209% for the S&P 500. Don't miss the latest top 10 list, available with Stock Advisor, and join an investing community built by individual investors for individual investors.
See the 10 stocks »
*Stock Advisor returns as of July 8, 2026.
Adria Cimino has positions in Amazon. The Motley Fool has positions in and recommends Alphabet, Amazon, Meta Platforms, Micron Technology, Microsoft, and Nvidia. The Motley Fool has a disclosure policy.