There is an old saying on Wall Street that the market is driven by just two emotions: fear and greed. Although this is an oversimplification, it can often be true. Succumbing to these emotions can have a profound and detrimental effect on investors' portfolios and the stock market.

In the investing world, one often hears about the juxtaposition between value investing and growth investing, and although understanding these two strategies is fundamental to building a personal investment strategy, it is as important to understand the influence of fear and greed on the financial markets. There are countless books and courses devoted to this topic. Here our goal is to demonstrate what happens when an investor gets overwhelmed by one or both of these emotions.

Greed's Influence

So often, investors get caught up in greed (excessive desire). After all, most of us have a desire to acquire as much wealth as possible in the shortest amount of time.

The internet boom of the late 1990s is a perfect example. At the time, it seemed all an advisor had to do was simply pitch any investment with a "dot-com" at the end of it, and investors leaped at the opportunity. Buying activity in internet-related stocks, many just startups, reached a fever pitch. Investors got greedy, fueling further greed and leading to securities being grossly overpriced, which created a bubble. It burst in mid-2000 and kept leading indexes depressed through 2001. (See also: Greatest Market Crashes.)

This get-rich-quick mentality makes it hard to maintain gains and keep to a strict investment plan over the long term, especially amid such a frenzy, or as the former Federal Reserve chairman Alan Greenspan put it, the "irrational exuberance" of the overall market. It's times like these when it is crucial to maintain an even keel and stick to the fundamentals of investing, such as maintaining a long-term horizon, dollar-cost averaging and avoiding getting swept up in the latest craze.

A Lesson From the 'Oracle of Omaha'

We would be remiss if we discussed the topic of not getting caught up in the latest craze without mentioning a very successful investor who stuck to his strategy and profited greatly. Warren Buffett showed us just how important and beneficial it is to stick to a plan in times like the dotcom boom. Buffett was once heavily criticized for refusing to invest in high-flying tech stocks. But once the tech bubble burst, his critics were silenced. Buffett stuck with his comfort zone: his long-term plan. By avoiding the dominant market emotion of the time—greed—he was able to avoid the losses felt by those hit by the bust. (See also: Coattail Investor.)

Fear's Influence

Just as the market can become overwhelmed with greed, the same can happen with fear ("an unpleasant, often strong emotion, of anticipation or awareness of danger"). When stocks suffer large losses for a sustained period, the overall market can become more fearful of sustaining further losses. But being too fearful can be just as costly as being too greedy.

Just as greed dominated the market during the dot-com boom, the same can be said of the prevalence of fear following its bust. In a bid to stem their losses, investors quickly moved out of the equity (stock) markets in search of less risky buys. Money poured into money market securities, stable value funds and principal-protected funds—all low-risk and low-return securities.

This mass exodus out of the stock market shows a complete disregard for a long-term investing plan based on fundamentals. Investors threw their plans out the window because they were scared, overrun by a fear of sustaining further losses. Granted, losing a large portion of your equity portfolio's worth is a tough pill to swallow, but even harder to digest is the thought that the new instruments that initially received the inflows have very little chance of ever rebuilding that wealth.

Just as scrapping your investment plan to hop on the latest get-rich-quick investment can tear a large hole in your portfolio, so too can getting swept up in the prevailing fear of the overall market by switching to low-risk, low-return investments.

The Importance of Comfort Level

All of this talk of fear and greed relates to the volatility inherent in the stock market. When investors lose their comfort level due to losses or market instability, they become vulnerable to these emotions, often resulting in very costly mistakes.

Avoid getting swept up in the dominant market sentiment of the day, which can be driven by a mentality of fear or greed, and stick to the basic fundamentals of investing. It is also important to choose a suitable asset allocation mix. For example, if you are an extremely risk averse person, you are likely to be more susceptible to being overrun by the fear dominating the market, and therefore your exposure to equity securities should not be as great as those who can tolerate more risk.

Buffett was once quoted as saying, "Unless you can watch your stock holding decline by 50% without becoming panic-stricken, you should not be in the stock market." This isn't as easy as it sounds. There's a fine line between controlling your emotions and being just plain stubborn. Remember also to re-evaluate your investment strategy and allow yourself to be flexible—to a point—and remain rational when making decisions to change your plan of action. (See also: Asset Allocation Strategies and Five Things to Know About Asset Allocation.)

The Bottom Line

You are the final decision-maker for your portfolio, and thus responsible for any gains or losses in your investments. Sticking to sound investment decisions while controlling your emotions, whether greed or fear, and not blindly following market sentiment is crucial to successful investing and maintaining your long-term strategy. But beware: Never wavering from an investment strategy during times of high emotions in the market can also spell disaster. It's a balancing act that requires you to keep your wits about you.