Investing in a diversified portfolio of stocks is key to saving enough for retirement, especially when so-called "safe" investments like bonds are providing a historically low rate of return. While stocks have historically provided high rates of return over long periods of time, they carry an inherent risk: You could lose your fortune if you make big mistakes. 

Money in 401k envelope

Image Source: Getty Images.

Fortunately, avoiding unforced errors in investing is pretty easy with a little research. In fact, you can learn right here how to avoid three big investment mistakes that could ruin your portfolio's performance and leave your retirement underfunded.

1. Investing in stocks with money you'll need soon

The stock market is a great place to park your money -- if you don't need the cash right away. Any money that you'll need within the next few years should be kept in an accessible savings account (if you'll need it within a year or so) or put into a safe investment like a certificate of deposit. You should only invest in the stock market with money that you can leave alone in case of a downturn.

If your investments take a bit hit -- like when the stock market plummeted 40% in the second half of 2008 -- you'll going to be in a lot of financial trouble if you need that money right away. While the market has since recovered since the 2008 crash, it took many years to reach and exceed its pre-crash levels, and some stocks never recovered in full or at all. If you can't wait out the recovery process because you need to raise cash by selling stocks, you'll be forced to absorb huge losses.

Stocks grow at a much higher rate than most other investments, but their average annual returns of about 10% have been achieved over the course of decades. There are years when the market drops and years when it soars, and you need to stay invested for years so that you can ride out the lows and profit from the highs, rather than being forced to sell when the market has reached a trough.

2. Taking stock advice from unreliable sources

Your brother-in-law, friend, or boss may promise to have a great stock tip, but chances are that tip is based on speculation or comes from a dubious source. It's hard for even skilled investors to beat the stock market, so unless your friend or family member is working in the financial industry and has a long, proven track record of successful performance, you don't want to make investments based on their advice. Not only could this lead to financial disaster, but if the investment crashes and burns, it could strain your relationship with the would-be stock-picker.

Financial advice from laypersons can be dangerous, but you also need to be skeptical of financial advisors. Investors have lost fortunes by putting their faith in the wrong advisors, from the investors bilked of $17 billion by Bernie Madoff to the 1,347 Australians who recently lost a collective $30 million to the bad advice of unqualified investment advisors.

It's important to make sure anyone you turn to for advice has impeccable credentials and a designation such as a chartered financial analyst, certified public accountant, or certified financial planner. You should also watch for red flags that could suggest your advisor may not have your best interests at heart, and you should understand all the fees you're being charged, as high fees could cost you hundreds of thousands of dollars over the life of your investments. 

3. Letting your emotions rule your investments

On Oct. 19, 1987, the Dow Jones Industrial Average dropped 22.6%. The market recovered from this dramatic drop, which occurred on a day that came to be known as Black Monday. In fact, the market gained back 57% of its losses within just two trading sessions, and the pre-crash highs were surpassed less than two years later.

Imagine if you had panicked as you saw your retirement funds or your child's college savings account plummet, and you sold your stocks out of fear of losing more. You'd have locked in your losses and missed out on the rapid recovery. Unfortunately, if you allow emotions like fear and greed to rule your investment choices, this type of thing can happen to you over and over.

Selling at a low isn't the only mistake caused by fear, either: Fear of losses may prompt you to invest too conservatively, missing out on the potential for tremendous capital gains. If you're unwilling to take risks, you could end up invested in "safe" investments like long-term government bonds, which have returned about 5% per year since 1926, compared with about 10% for stocks. If you invested $5,500 annually in a traditional IRA from age 25 to age 65 and earned a 5% rate of return, you'd have around $619,617 in your IRA before taxes at the end of 40 years. If you earned a 10% rate of return, you'd have over $2.6 million in your IRA. 

Does that number motivate you to increase your investments in stocks for fear of missing out on bigger gains? If so, you're again reacting based on emotion: This time, fear of missing out. This feeling could, unfortunately, prompt you to jump on bandwagons and begin investing even once a bubble already exists within a sector or when a company is overvalued.

Investors clamoring to get in on Twitter because they didn't want to miss out on the social network stock's expected upward trajectory are a good example: The stock price went up almost 150% after its IPO in 2013, but shares plummeted just three months later after a bad earnings report. Although shares have bounced up for brief periods, Twitter has yet to regain its IPO price. If you bought in when the company debuted on the market -- or, even worse, if you bought when the stock was at its peak -- then you're in the red. 

Instead of acting based on fear or any emotions, create a sound investment strategy and stick to it. Decide how much risk you're willing to take -- which should vary based on your age -- and allocate your assets appropriately. Judge a company you're considering investing in by its fundamentals, and pick an investment strategy that will guide you when to buy and sell different assets. Then stick to your strategy through thick and thin.

You don't have to worry about the markets daily ups and downs if you're investing for the long term, and you shouldn't buy or sell any investments unless your actions are driven by a careful analysis of how your decision fits into your overall investing goals. While it can be hard not to react to news -- whether it's bad or good -- take time for introspection instead of making a rash decision you might later come to regret.