The resurgence belies how much caution still runs through markets, however. The strongest performers in recent months have been companies that pay big dividends and are more likely to hold up during downturns. Investors, meanwhile, remain hesitant to plow their money into stocks.
"We've slowly crept up to these all-time highs, but there's still a lot of uncertainty," said Emily Roland, co-chief investment strategist at John Hancock Investment Management. "We're open to the idea that there could be a reacceleration in global economic growth, but we haven't seen confirmation yet."
Some glimmers of increased optimism have shone through the past couple of days, such as improved performance for smaller companies and tech stocks, but plenty of apprehension is still apparent in the catalysts for the S&P 500's return to a record high:
— Defense has been the best offense. Of the 11 sectors that make up the S&P 500, the ones seen as the stodgiest have been the best recently. Since July 26, utilities have jumped 6.3%. Profits for these kinds of companies are generally steadier than for the rest of the market, but also slower growing. That's why they don't typically do better than the overall market when times are good.
But their relatively high dividends look more alluring now that the Federal Reserve has cut interest rates twice since August, in hopes of protecting the economy. The only other sector in the S&P 500 to rise more than 1.4% is another high-dividend sector, real-estate, which is up 5.6%.
— Stocks THAT RISE WITH A STRONG ECONOMY are scuffling. If investors were feeling gung ho, they'd likely be piling into areas of the market closely tied to the strength of the economy, which are known as "cyclical" stocks. They are not.
Energy stocks have been the worst performers in the S&P 500 since July 26, down 5%, for example. And tech stocks lagged the S&P 500 from late July until last week, after surging ahead of the rest of the market in the early part of this year.
The struggles tie into all the uncertainty that still exists about how much trade wars will hurt the economy, said Willie Delwiche, investment strategist at Baird. That would hurt cyclical stocks more than defensive stocks.
— Low interest rates DRIVE the market as much as anything else. In addition to utilities and real-estate investment trusts, homebuilders have been among the market's best performers recently. Lennar, PulteGroup and D.R. Horton are all up more than 16% in the last three months as lower mortgage rates have drummed up more business for them. The average 30-year fixed mortgage has a rate of 3.75%, down from 4.51% at the start of the year, according to Freddie Mac.
— Euphoria is still lacking. Investors are still cautious, and they're not chasing after the rising stock market. In four of the seven weeks through Oct. 16, they pulled more money out of U.S. stock funds and ETFs than they put in, according to the latest estimates from the Investment Company Institute.
Before that, investors yanked a net $101 billion through the year's first eight months and instead poured money into the safety of bond funds. To a contrarian, this is actually an encouraging sign. It means stocks could push even higher if investors do decide to get more aggressive with their portfolios. Recent performance suggests they might need a confidence-booster, such as a U.S.-China trade deal.
"We're not seeing an excessive amount of optimism out there," said John Hancock Investment Management's Roland. "That's one reason the market could still have some legs here. We're open to that, but we're just waiting for some confirmation that the backdrop can support earnings growth going forward."
AP Business Writer Alex Veiga contributed.