Alan Greenspan isn't the first name that comes to mind when you think of great investors. But the longtime Fed chairman is certainly one of the greatest minds in history when it comes to economics. He's the guy that coined the term "irrational exuberance," after all.

While Greenspan might not have the investment track record of a Warren Buffett or Philip Fisher, it's worth paying attention to what he says about the stock market. Here's the best investment advice from Alan Greenspan.

Front facade of the Federal Reserve building in Washington, D.C.

Alan Greenspan served as Chairman of the Federal Reserve from 1987 to 2006. Image source: Getty Images.

"If you did nothing else..."

Greenspan has repeated the same thing in several different ways. The basic tenet is the average investor will do better if he buys stock and never sells rather than try to time the market.

It strikes me that if you did nothing else you never sell. That is, if you can grit your teeth through and just disregard short-term declines in the market or even long-term declines in the market, you will come out well.

I mean you just stick all your money in stocks and go home and don't look at your portfolio you'll do far better than if you try to trade it.

The market pays a premium to those willing to endure the angst of watching their net worth fluctuate beyond what Wall Streeters call the 'sleeping point.'

The advice is easy in theory, but much harder in practice. The "sleeping point" Greenspan references in that final quote refers to the point at which individual investors start to lose sleep over their portfolios and decide to sell everything. Individuals that can endure that pain and fear will come out well ahead of the average investor.

You can spot a bubble

Many investors are afraid we're in the midst of yet another economic bubble brought on by low interest rates following the fallout of the 2008 financial crisis. They might be right, but knowing we're in a bubble is the easy part.

You can spot a bubble. They're obvious in every respect. But it is impossible for the majority of participants in the market to call the date when it blows. Every bubble by definition deflates. But when that deflation occurs, it requires a point at which the vast majority of market participants do not expect it to happen. Almost everybody is bullish, expects the market to go up, and is fully committed. At that point if you took a survey of what the outlook was, you'd get an overwhelming positive response the day before it falls on its face.

If you can take Greenspan's first piece of advice, you don't even need to concern yourself with what he says here. But the fact that calling the top of a bubble is necessarily impossible should give you yet another reason not to try to time the market.

Get rid of your home bias

Investors have a natural tendency to favor companies from their home country or some familiar environment. Don't let this prevent you from geographic diversification.

When people are familiar with an investment environment, they harbor less uncertainty, and hence, less risk than they do for objectively comparable investments in distant, less-accessible environs.

Diversifying a portfolio beyond your home country ensures that your entire portfolio isn't subject to underlying economic factors of just one nation. Of course, many U.S. companies have become global entities operating all over the world. These big multinational corporations can provide significant exposure to other markets, and should be considered when diversifying with foreign investments.

Following the advice of Alan Greenspan can help you outperform the average investor. Buy stocks and hold them forever, don't try to time the market, and properly diversify geographically by overcoming your home bias, and you'll surely do well with your investments.