When markets are behaving well and stock prices are moving steadily upward, it's easy to be a buy-and-hold investor. But when times get tough and portfolio gains get harder to come by, many investors make the mistake of trying to become professional market timers -- often at precisely the worst moment.

As we've discussed before, investors often trade too much because of a sense of overconfidence. Thinking that they possess superior information or insight into the markets, traders jump in and out of stocks, trying to pluck pennies of gains from actively traded issues enough times in a row to make a small profit.

A tale of two markets
When stocks are rising, this behavior can be costly -- but not always noticeably so. In a bull market, the most common problem with trading too frequently is that you end up accepting small gains when a long-term investor would've had larger gains. Take a look, for instance, at these stocks:

Stock

Change 1/1/07 to 6/30/07

Change 1/1/07 to Present

Mechel OAO (NYSE:MTL)

43%

461%

ArcelorMittal (NYSE:MT)

52%

108%

Potash (NYSE:POT)

63%

270%

As you can see, by jumping out of these stocks early, you would have risked missing out on much larger potential gains. But at least you wouldn’t have lost any money.

That changes when markets start to drop. Two things make trading much more dangerous during choppy markets. First, when traders lose the tailwind of rising market prices, it becomes a lot more difficult for them to find profitable trades. That challenges their overconfidence, as they discover that they can indeed lose money in the market.

Even worse, though, traders often respond to losing positions irrationally. Like gamblers trying to win a double-or-nothing bet, traders who've gotten burned by falling financials like Citigroup (NYSE:C) and Washington Mutual (NYSE:WM) can be sorely tempted to buy more shares as they get cheaper, putting dangerous levels of capital at risk. If a stock fails to recover, then traders end up with far larger losses on such positions than they otherwise would have -- simply because they were trying to get back to even.

Don't chase
The reason trading is so attractive is because hindsight is perfect. You can call up the 2006 chart of Chesapeake Energy (NYSE:CHK), for instance, and see that if you had just bought every time the stock hit the upper $20s and sold when it reached the low to mid-$30s, you could've made money during a year when the stock basically stayed flat.

But trading strategies like these leave you with substantial downside risk. If Chesapeake had fallen below the upper $20s, for example, you would've been stuck with the losses. On the other hand, if Chesapeake had kept going up -- which is what really happened -- you would have already sold out, capping your gains.

It's hard to stay put when markets are churning and stock prices aren't going anywhere. At some point, however, stocks will start rising again -- and when it happens, the odds are good that it'll be an explosive move that takes many by surprise. You can't predict when it'll happen, though -- so the best way to make sure you're there to benefit from it is to stop trading and make a long-term commitment to the market. Ten years from now, I bet you'll be glad you did.

For more tips on smart trading, read about