Fear and greed are said to be the two key urges that drive investors and markets: apprehension over losing everything while lusting for the big score.

Emotion-driven investment decisions often lead to risky behavior that harms sound financial planning. Whether it's irrational exuberance or a sense of overwhelming doom, you're bound to come out the worse for wear if you base all your decisions on emotions. As you chart your own course in the stock market, try to avoid these irrational ways of behaving:

  • Closing your mind. In the midst of the bull market of the late 1990s, there was a general feeling that things were "different this time." Investors picked stocks unworthy of their valuations, buying JDS Uniphase at $1,100 a share or Lucent shares at $75 a pop. Alternatively, if events turn against a stock, some investors will ignore the news and abide only those opinions that support their position, holding on all the way down.
  • Anchoring to the past. When you finally make the decision to buy a company, you usually believe that the price is low and should subsequently go up. That price becomes the "right" price for the stock, and so you may hold on if it falls below the purchase price. You may not consider that the new, lower price may really be the "right" price after all. For instance, some investors undoubtedly still think that Ariba at $500 a share was the "right" price.
  • Looking for patterns. Like the ancients who saw an eclipse as the moon eating the sun, investors like to look for patterns to explain the inexplicable. For instance, some believe that things like the Super Bowl Effect or which party gets elected to the presidency will foretell the course of the markets. Worse, every stock chart has a pattern that can be interpreted in countless ways.
  • Avoiding losses. We feel the pain of a stock's loss more keenly than we do the elation of a gain, so we strive harder to avoid losses than to achieve gains. That leads to investing too conservatively, putting our money in Treasury bills instead of Starbucks stock, or under the mattress instead of in the market at all.
  • Overconfidence. Conversely, we also generally feel that we're above-average investors -- even though everyone can't truly be better than average. By feeling that you're superior to your investing neighbor, you may take on irrational risks, like putting all of your money into just one investment or one sector.

We're all controlled to some extent by our emotions. It's part of our job as investors, however, to rein in the extremes and stay on an even keel. Investing on emotion is almost assuredly one of the quickest ways to go broke.

Here are just a few ways to counteract the extremes of fear and greed:

  • Have a long time horizon. By realizing that you don't have to make a decision today, right now, you can relax when one of your holdings has made a big move and consider the implications of what's happening. Also, by thinking in terms of decades of ownership -- Warren Buffett famously said his "favorite time for selling is never" -- you can eventually learn to ignore the daily fluctuations of a stock's price.
  • Become a business owner. If you think of the stocks you own as if you were a part owner of the company -- because, in fact, you are -- you'll concentrate on what drives the business, not the stock. Take care of the business, and the business will take care of the stock. Give up the thought of trading your stocks as though your portfolio were a baseball card collection.
  • Invest only the money you don't need. By only putting money you won't need for at least five years (and preferably longer) into stocks, you'll be less dependent on making a killing on any one investment. You don't have to be right every time. As Peter Lynch has said, you can be extremely successful even if four of every 10 stocks you buy go belly-up. But you can't be trying to double next month's mortgage payment doing so.

Fear and greed. They provide thrills and excitement -- but such adrenaline rushes should be left for roller-coaster rides, not your investment portfolio.

The slate of Motley Fool investment services helps keep your emotions in check by providing sound analysis, regular updates, and thought-provoking discussions. A 30-day trial subscription lets you choose the one that best meets your objectives, risk-free.

While Fool contributor Rich Duprey has owned JDS Uniphase and Ariba at various times in his investing career at ridiculous valuations, he does not currently own any of the stocks mentioned in this article. You can see his holdings here. Starbucks is a Stock Advisor pick. The Motley Fool has a disclosure policy.