Investors spend a lifetime developing a suitable philosophy that helps shape their financial decisions. To develop their views, they seek the sage advice of successful investors.

The best advice has a quality of timelessness and can be thought about in virtually any economic environment.

Here are five of my favorite pieces of advice, starting with perhaps the world's most famous investor.

Warren Buffett

'The line separating investment and speculation, which is never bright and clear, becomes blurred still further when most market participants have recently enjoyed triumphs. Nothing sedates rationality like large doses of effortless money.' -- in a letter to shareholders in March 2000

Buffett wrote that as the dot-com boom was in its final stages, and soon after this annual letter to shareholders was written, the market tumbled. Buffett's insights apply to today's market as well. Whenever the market goes up for an extended period (as it has for the past four years), investors develop a sense of hubris and begin to believe that investing is easy.

Yet successful investing isn't about riding the waves. It's about knowing when to go against the waves. Indeed, when the markets make investing look easy, you should grow concerned. Few investors like to think about selling stock and holding high levels of cash when the market is hitting new heights, but those are the lucky few who can be bold and dive in when the market is creating a lot of carnage. Having cash available when stocks are plunging is one of the best ways to make money over the long-term.

Peter Lynch

'Know what you own, and know why you own it.'

This is the actual phrase uttered by the legendary Fidelity Investments mutual fund manager, who is often misquoted as saying 'Buy what you know.'

Lynch's point is simple and direct. If you don't really understand the industry in which a company operates, then you are guessing that this investment will fare well. For him, that meant little exposure to technology stocks, and a strong preference for companies that produce goods that are popular with consumers.

Yet it's the second part of that phrase that is also crucial: Don't simply buy the stock because you like the company's product. Do your homework and assess whether demand for the product is rising, whether competition is a concern, and whether the company can sell these products at a solid profit. One of Lynch's favorite angles was to determine the size of the potential market opportunity and to stick with only those companies that were facing a very large opportunity.

Beverage company SodaStream (Nasdaq: SODA) is a perfect example of the kind of company Lynch would love. It emerged on the scene with a compelling product (that carbonates water and other beverages at home) in a market that could grow quite large. SodaStream's sales now exceed $500 million annually, and analysts have begun to talk about a $1 billion sales base in just a few years. Any consumers who were early fans of this product could just as easily been early investors in the company.

John Bogle

'If you have trouble imagining a 20% loss in the stock market, you shouldn't be in stocks.'

The founder of Vanguard Investments has many great phrases to his credit, but this is one of my favorites. Many people steer clear of the stock market because the notion of a really bad year is just too hard to stomach. You need the right intestinal fortitude to handle the market's never-ending gyrations.

Yet looked at another way, Bogle isn't suggesting that bad markets should scare you. Instead, he is bracing investors to stay strong, even when the market is not. That was surely the case in late 2008 and early 2009. The S&P 500 plunged so sharply that many portfolios lost a huge chunk of value. Many used that experience as a reason to simply give up on investing, but the investors who chose to ride out the crisis were treated to stunning gains in the subsequent years.

David Tepper

'This company looks cheap, that company looks cheap, but the overall economy could completely screw it up. The key is to wait. Sometimes the hardest thing to do is to do nothing.'

You may not know David Tepper's name, but you should. He was ranked as the top hedge fund manager by The New York Times in 2009 and again by Forbes magazine in 2012. His success doesn't stem from buying a little piece of a lot of companies. He makes concentrated investments in a select group of stocks, and he waits (sometimes for a very long time) until he feels that the stars are perfectly aligned.

That means there are periods when he's actually doing very little buying or selling. That's in sharp contrast to fund managers who see the need to continually churn their portfolio every quarter with buys and sells.

Sir John Templeton

'The time of maximum pessimism is the best time to buy, and the time of maximum optimism is the best time to sell.'

Templeton, who built his firm into a global financial powerhouse, simply states the most important lesson any investor can learn. Pivoting back to that financial crisis of 2008 and 2009, most investors abandoned ship, and stocks like Ford (NYSE: F), Domino's Pizza (NYSE: DPZ) and Hertz (NYSE: HTZ) fell to just a few dollars a share.

Were these companies going out of business? No way. Yet investors were acting so fearfully that the stock prices implied looming bankruptcy filings. Any investors who stepped in at a time of 'maximum pessimism,' as Templeton notes, doubled, tripled or even quadrupled their money in these seemingly distressed investments.

Of course, the dot-com boom typifies the other side of the coin. Tech stocks, as embodied by the Nasdaq index, rose 55% in 1998 and 57% in 1999. Those gains were irresistible to many, and fresh money poured into the stock market in the first few months at a furious pace in 2000. Within months, that 'maximum optimism' would lead to ruin for many tech-heavy portfolios.

The Investing Answer: There are several clear themes here. Avoid the herd, invest in companies you understand, zig when others are zagging, and don't let fear dictate your actions when the going gets tough.