The S&P 500 and Nasdaq look historically expensive.
But the top stocks are still firing on all cylinders.
Over the past 12 months, the S&P 500 and Nasdaq have risen about 25% and 35%, respectively. Both indexes are hovering near record highs and trading at historically high valuations, even amid inflation, geopolitical conflicts, and other fierce macro headwinds.
Therefore, investors might be wondering if it's smarter to lock in their gains before the summer or simply let their winners ride over the next few years. Let's review the key catalysts that propelled the indexes to their all-time highs -- and if that momentum will last.
Will AI create the world's first trillionaire? Our team just released a report on the one little-known company, called an "Indispensable Monopoly" providing the critical technology Nvidia and Intel both need. Continue »
Image source: Getty Images.
The rapid growth of the artificial intelligence (AI) market -- which generated tailwinds for the cloud infrastructure, data center, chipmaking, networking, and energy markets -- drove many of those top stocks to their record highs over the past year. Those hot stocks included Nvidia (NASDAQ: NVDA), Broadcom, and Alphabet -- which all easily outperformed the S&P 500 and Nasdaq.
The growth of those tech giants offset the weaker growth of companies that were more exposed to soaring oil prices, inflation, and geopolitical conflicts. At the same time, rising oil prices drove big oil stocks higher, while soaring energy demand from power-hungry AI and data center markets drove the bulls toward a broader range of energy and electrification stocks.
Some investors might think it's smarter to "sell in May and go away" in this frothy market. However, those who followed that mantra left a lot of money on the table over the long term.
While May has a reputation as a bad month for stocks (because investors habitually lock in profits before the summer), it's a short-term seasonal trend. Over the past ten years, the S&P 500 and Nasdaq have risen about 260% and 430%, respectively -- even as the pandemic, inflation, soaring inflation rates, and military conflicts rattled the global economy.
Past performance never guarantees future gains, but the main sectors driving the market's rally are still firing on all cylinders. The AI, data center, and energy markets won't cool off anytime soon, and that secular expansion will drive those stocks higher -- even if the market's non-AI stocks fizzle out. So if you plan to hold your stocks for at least a few more years, there's no reason to "lock in" your gains before the summer. Instead, you should simply tune out the near-term noise and have some faith in your top-performing investments.
Before you buy stock in Nvidia, 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 Nvidia 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 $469,293!* 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,381,332!*
Now, it’s worth noting Stock Advisor’s total average return is 993% — a market-crushing outperformance compared to 207% 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 May 18, 2026.
Leo Sun has no position in any of the stocks mentioned. The Motley Fool has positions in and recommends Alphabet, Broadcom, and Nvidia. The Motley Fool has a disclosure policy.