The last time the S&P 500 (^GSPC 1.20%) traded at current levels was December 2007.

Depending on how you look at it, that means either stocks are at their highest level in five years (good!), or they haven't gone anywhere in five years (bad!).

That's actually an important distinction to make. There are two big arguments among analysts right now. One says the market has gotten out of hand and is overvalued. The other says stocks are just getting back to normal levels as the economy heals and profits boom.

The distance between the two groups is intense. JPMorgan strategist Thomas Lee told CNBC yesterday: "We still don't find investors overweight stocks. ... There's still a lot of memories of 2008, and I think we still have a taint on owning stocks." On the other side, an article in The New York Times on how individual investors are jumping back into stocks led one commenter to conclude, "Reminiscent of the shoeshine kid giving Joe Kennedy a stock tip."

Who is right?

A total of $22 billion flowed into equity mutual funds and ETFs during the first week of the year -- one of the biggest inflows ever. More has likely come in over the last week. But context is needed: These big flow numbers come after investors added basically nothing to stocks for four years straight. By no rational measure are individuals heavily invested in stocks.

And January is almost always a big month for equity inflows as people make their annual IRA contributions. 2010 and 2011 -- both years in which equity flows were negative -- saw heavy inflows during the first few weeks of January. Even the annus horribilis of 2009 saw positive flows in early January. What we've experienced in the last few weeks is just a minor uptick in a multiyear trend. It's not yet clear that it's anything more than that.

The last decade has been filled with so many market crashes that people now seem to automatically equate "stocks near all-time high" with "irrational bubble." But in a market where prices are supposed to appreciate over time, all-time highs happen pretty regularly.  Since 1928 the S&P 500 has closed at a new all-time high 1,024 times, or 4.8% of all trading days:

Source: S&P Capital IQ; author's calculations.

And why shouldn't stocks be nearing all-time highs? Profits are at all-time highs. Dividends are at all-time highs. GDP is at an all-time high. Household debt payments are at a three-decade low. U.S. energy production is rising for the first time in 25 years. The housing market has stabilized. And, most importantly, valuations aren't anything wild. The S&P trades at 13 times this year's expected earnings and still has a dividend yield higher than what can be earned on 10-year Treasury bonds. As the Financial Times pointed out last week:

The earnings yield on US stocks (the inverse of its earnings multiple) is 6.8 per cent, more than the 5.89 per cent yield available on junk bonds, a new sign of the way in which the very low yields on offer in bond markets have distorted traditional perceptions of value.

This says more about the valuation of bonds than it does about the valuation of stocks, but it explains what's going on. People aren't necessarily buying stocks because they have inflated views of stocks' potential. They're buying stocks because they'll offer the greatest return potential among asset classes as the economy strengthens. It's a pretty rational move.

It's just unfortunate timing. Ever since the 2008 crash, it's been obvious how the relationship between stocks and individual investors would play out: People would avoid cheap stocks like the plague, then rekindle their love only after they rebounded, almost intentionally avoiding an opportunity to make a fortune.

Here's the average annual return on the S&P 500 you would have earned through yesterday if you bought on Jan. 1 of any of the last 22 years, adjusted for inflation and dividends:

Source: Robert Shiller; author's calculations.

The biggest takeaway from the market's big surge isn't that insightful, but it gets forgotten like clockwork: If you buy stocks when they're cheap, you'll do well. If you buy then when they're expensive, you'll do much less well. It's the same story again and again.

link