The S&P 500 is off to a terrific start in 2024, gaining 7% in under two months. If it keeps rising at the rate it's been rising, we could see a stock market gain of 42% by the time 2024 is done!

Admittedly, "past performance is no guarantee of future results." You can't simply assume that 7% profits in two months implies 42% profits over 12 months. But at least one analyst thinks stock market investors can expect continued -- if somewhat less exciting -- gains for the rest of this year. On Wednesday, Swiss investment ban UBS predicted that the S&P 500 will close out 2024 at 5,400.

Applied to the SPDR S&P 500 ETF Trust (SPY 0.95%), this implies a closing price of $538.70 by the end of this year -- and another 5.6% profit on top of the 7% gain that we've already got.

Upgrading the S&P 500

So is it time to break out the champagne? Not necessarily.

For one thing, UBS calculates that total earnings for S&P 500 index will be only $240 this year, implying a rather high P/E ratio of 22.5. (For most of recorded history, valuations in the mid-teens were more the norm).

Also, you should know that UBS's forecast is a bit of an outlier. Actually, it's the highest forecast for the S&P 500 of any investment bank that's been polled, as StreetInsider has pointed out. Earlier this year, Forbes reported that the average forecast of all investment banks is for the S&P to reach only 5,090 this year.

If that ends up being the correct number (implying a total of 8.5% gains this year) then we're already about nearly three-quarters of the way there, and future gains could be very slim indeed.