Americans don’t envy Bill Gates or Michael Dell (or not very much). We know that their billions spring from tremendous personal effort and innovation. In our financial caste system, merit can justify money, in any amount.

But the undeserving rich drive us completely nuts. They’re steering their BMWs to their sailboats at their summer homes, only because they bought Microsoft at $3. Deep in your heart, you think, Grrrr, I could have done that, too. The green–in our eyes and other people’s wallets–brings out the worst in us. I don’t mean morally; I mean our worst instincts as investors.

In recent years academics have studied investor behavior, with sobering results. We think we make rational decisions. More often, we veer from hope to fear without putting our brains into gear at all. (That’s hope, not greed; the difference is important.)

Bull markets intensify these feelings, especially among investors who don’t have a lot of experience, says Thomas Gilovich, a professor of psychology at Cornell University and coauthor, with Gary Belsky, of “Why Smart People Make Big Money Mistakes.”* Tyros (described as people who can’t spell b-e-a-r) make up the majority of stock owners today. Most financial advisers are nouveaux, too. If you opened your heart, here’s what you’d find:

If we don’t sell our losers, what do we sell? Our winners, of course–and we sell them early, for fear of losing the capital gains we already have. As a result, we forgo what might have been even larger gains. (But early selling averts the danger of having to kick ourselves if the stock goes down.)

Loss aversion has one more perverse effect. In a bull market, where envy reigns, we take unusual investment risks, simply for fear of losing out. “If you don’t take the chance, you’ll feel that you’ve fallen behind,” Gilovich says.

You’re sure of it, if you’re windsurfing around the world after bagging a fortune on Internet IPOs. We hate to concede how much our gains depend on chance.

Odean has made four studies of investor behavior (two with Brad Barber, also a finance professor at UC). They’re drawn from the records of a major discount broker, so they show the kinds of decisions investors make themselves, with little or no input from brokers or financial planners.

Among the findings: overconfidence leads to more frequent trading, but the stocks people sell don’t do as well as the stocks they buy. On average, the more you trade, the less you make. Men trade more than women (boys will be boys), and their accounts don’t perform as well. But both sexes did poorly, compared with what they could have earned if they’d kept the stocks they owned at the start of each year.

These investors generally made money, Odean says, which they probably attribute to the effort they put in. In fact, the hours they spent trading stocks diminished their returns.

Poor investment choices aren’t woven into our DNA. “They’re more characteristic of beginners,” says economics professor Charles Plott, who replicates market behavior in his Laboratory for Experimental Economics and Political Science at the California Institute of Technology in Pasadena. “With experience, decisions become more thoughtful and performance improves.”

But it takes a lot longer to gain experience in the real world than in a lab–especially if you believe it’s your genius (not the bull market) that drives your success. Most investors don’t keep track of the path not taken, or even the path they’re on. They don’t average their losers with their winners to see how they’ve performed over time. They don’t check what their returns might have been if they hadn’t traded at all.

Without this information, your major learning experience will be spelled b-e-a-r. Market analyst Steve Leuthold, of the Leuthold Group in Minneapolis, probably has it right: “Investors,” he says, “behave wisely once they have exhausted all the alternatives.”

On the other hand, there may be no dummies in the market, only people who believe that others are. In that case, it’s a rational act to buy AOL at $110 because you expect to sell to a dummy at $150, who expects to sell to a dummy at $201. But before you reach for your mouse, hear this: the instant we think there’s not another dummy left, the bubble breaks. And where is envy then?