I could easily see Wayne Gretzky doubling as a successful investor in a different life. On the other hand, Warren Buffett in a hockey outfit ... just doesn't fit. What they have in common, though, is a unique lens through which they view their professional worlds.

First, some advice from the Oracle of Omaha
"Investors should try to be fearful when others are greedy and greedy when others are fearful."

This oft-quoted line from Berkshire Hathaway's (NYSE: BRK-B) 2004 annual report is the gold standard for contrarian investors. But really, all investors would benefit from taking this advice to heart.

Every week, The American Association of Independent Investors publishes a sentiment survey that it assembles. The survey, which was first published in 1987, measures the percentage of investors who are bullish, bearish, or neutral on the direction of the stock market over the next six months. The association, in an effort to iron out anomalies, also tracks the eight-week moving average of the bullish sentiment.

By analyzing the data, it becomes clear that when people aren't bullish, that's a great time to enter the market. Consider these data points from the five periods over the past 24 years where bullish sentiment was the lowest.

Date

Average Bullish Sentiment

1-Year Return

2-Year Return

Nov. 21, 1990 18% 21% 33%
Oct. 7, 1988 20% 32% 15%
Oct. 23, 1992 20% 13% 13%
March 5, 2009 25% 55% 80%
March 6, 2003 26% 36% 44%
       
Total   31% 37%

Source: AAII, Google Finance.

Both the one- and two-year returns coming out of these bearish time periods handily beat the typical market return of 10.5% and 22.1%, respectively. If you had been greedy for stocks when there was so much fear in the market, you would have been rewarded with market-thumping results.

But what about the inverse? What usually happens when the bulk of investors out there are bullish on the market? The chart below was assembled using data points from the five periods over the past 24 years where bullish sentiment was the highest.

Date

Average Bullish Sentiment

1-Year Return

2-Year Return

Jan. 8, 2004 64% 7% 16%
Jan. 13, 2000 61% (9%) (21%)
Jan. 3, 2002 59% (22%) (5%)
Sept. 25, 1987 57% (14%) 10%
July 24, 1997 55% 25% 48%
       
Total   (3%) 10%

Source: AAII, Google Finance.

Here, the one- and two-year returns dramatically underperform market averages. Contrarian investors who were fearful when others were getting greedy were able to typically lock in gains before the market started falling. Or, if they were Foolish buy-and-hold investors, instead of selling, they waited before putting new money into the market.

So where are we now? According to the latest AAII publication, the average eight-week bullish sentiment sits at 32%, well below the 24-year average of 39%. The past isn't a predictor of the future, but historically these numbers show that now may be a time to buy.

And now, a word from Gretzky
"Skate where the puck's going, not where it's been."

Or for those investors out there, "A good investor invests where the growth is now. A great investor invests where the growth is going to be." If you want your returns to beat the market, you need to fish where others aren't. So where are the deals now?

Well, during Motley Fool Money's weekly radio show a couple weeks ago, analyst Charly Travers asked when investors would stop bidding small-cap stocks up to nose-bleed valuations and look at "the great values staring them in the face."

Travers has a point. Small-cap, Internet communications company VirnetX (AMEX: VHC) has seen its shares rise more than 150% this year -- sporting a P/E north of 45 -- while fellow tech company Microsoft (Nasdaq: MSFT) has shares trading almost 5% below where they were on Jan. 1, and a mouth-watering P/E of just 10.6.

Travers offered up three more suggestions for investors looking to invest where the growth will be (and not where it is): Abbott Labs (NYSE: ABT), Coca-Cola (NYSE: KO), and Wal-Mart (NYSE: WMT). All three of these companies have attractive valuations, substantial dividend payments, and an underappreciated aspect to their growth plans: emerging market exposure.

To Travers' list, I would also add what I consider to be one of the most undervalued large caps right now: Apple (Nasdaq: AAPL). I have lots of reasons for liking Apple at its current prices, but that's for another article.

Foolish takeaway
Trying to time the market is never a very Foolish task to attempt. Instead, we here at The Motley Fool encourage buying great companies at good prices. With that in mind, I'm willing to offer you access to a special free report compiled by the Fool's top analysts: Five Stocks The Motley Fool Owns -- And You Should, Too! This report, which highlights five companies The Motley Fool has put its own money into, is yours, absolutely free of charge.