It seems like paying attention to prevailing trends would be a good thing for an investor to do. If you're not careful, though, it can sabotage your investment returns rather than enhance them.

What the past two years have taught us
You can hardly find another instance in which the stock market went through such extremes as it has during the past two years. After suffering one of the worst drops in its history in 2008, 2009 has provided investors with a stunning recovery.

In many ways, the market has gone through a textbook response to rapidly changing market conditions. As the market melted down in the autumn of 2008, investors bid down stock prices indiscriminately, throwing the baby out with the bathwater as good companies followed bad ones downward.

Then, though, at the moment of maximum pessimism, the market hit bottom. What many thought would be merely a brief bounce before the market kept falling, instead turned into a powerful rally that has continued for over nine months and still seems to have some legs left.

In theory, then, investors who stayed the course and kept their long-term investments untouched throughout the panic and ensuing recovery have held up reasonably well. Moreover, those who took advantage of the panic to pick up shares of great companies on the cheap should be laughing all the way to the bank.

Theory's great, but where's the money?
Unfortunately, that doesn't seem to be what happened. Instead of capitalizing on the opportunity, investors held back -- and missed out on some huge gains.

One way you can tell how individual investors have done with their attempts to time the market is by going to Morningstar and looking at the dollar-weighted returns of mutual funds compared with their stated total returns. What the dollar-weighted figures show you is how investors actually did on their investment overall. So, for instance, if a fund has spectacular performance but investors don't buy shares of the fund until after it's already had that big run, then the dollar-weighted returns will be much lower than the fund's total return.

And in fact, as you might expect, the figures do show a tendency for investors to be late to the game, especially in hot sectors of the market. For instance:

  • Emerging-market stocks like Vale (NYSE:VALE) and America Movil (NYSE:AMX) have seen even more spectacular gains over the past year than the U.S. stock market, pushing the Vanguard Emerging Market Stock Index Fund (VEIEX) to an 84% gain in the year ending Nov. 30. Yet the average investor return was over 10 percentage points lower, and over the past three years, the dollar-weighted return on the fund is actually a loss, compared with a 5% annual gain on a total-return basis.

  • Gold and precious-metals stocks have also been on a tear, with stocks like Southern Copper (NYSE:PCU), Silver Wheaton (NYSE:SLW), and Hecla Mining (NYSE:HL) having more than doubled so far this year. The Rydex Precious Metals Fund (RYMNX), however, has seen its dollar-weighted return lag its total return by 14 percentage points over the past year.

  • Often, small-cap funds are most prone to see this effect, as their assets under management tend to balloon upward when they perform well. The Select Fund (DESYX), for instance, has posted a 54% gain over the past year on the performance of Flextronics International (NASDAQ:FLEX), Cognizant Technology Solutions (NASDAQ:CTSH), and several other multibagger stocks. But the typical investor has seen only a 43% gain.

With bigger funds, the effect isn't as extreme since inflows and outflows aren't all that large compared to the size of the fund. Yet, especially over longer periods, you can often see evidence that shareholders chase performance.

Don't do it
There's a huge temptation to jump into hot sectors after they've been talked up all over the financial news. But if you're the last one to hear about a big trend, you're setting yourself up for disaster. To be truly successful at investing, you have to find great stocks ahead of the crowd. Then, you'll have the herd working for you rather than against you.

Have you been asleep for the past 10 years? Catch up with Morgan Housel as he sums up the lost decade in 50 headlines

Fool contributor Dan Caplinger never owned a Beanie Baby and hasn't watched a single episode of Lost -- yet. He doesn't own shares of the companies mentioned in this article. America Movil S.A.B. de C.V is a Motley Fool Global Gains pick. Try any of our Foolish newsletters today, free for 30 days. The Fool's disclosure policy has declared ignorance Public Enemy No. 1.