"The market is wrong; I am right."

You may be familiar with the concept of contrarianism: the idea that when a stock gets beaten down -- or when everybody is bearish on a stock -- you might be looking to buy. Conversely, when a stock sees a huge run-up and everybody is excited about it, it's time to run for the hills.

Obviously, you shouldn't disagree just to be disagreeable. The market isn't always wrong, and contrarianism as I have described it is too simplified to be an investment strategy in itself. But there are a couple of extremely important ideas here:

1. Favorable situations for a stock purchase often develop when the market hates a stock.

2. When you recognize that a stock in which you're interested offers great value at its current price, have the conviction to back up your view. It could be that a number of Wall Street analysts have a "sell" rating on your stock of interest. Maybe the stock is on a "downward trend," and your friends say that the stock is a "loser." But you know that they are wrong, and you are right. Get your money in accordingly.

A poker example
I think a great illustration of this is your everyday poker game.

Imagine you're playing Texas Hold 'Em with two friends. You hold a pair of jacks, and the flop comes J-7-2 rainbow (mixed suits), giving you three of a kind. Both of your friends move all-in. What do you do?

Of course you call -- you have the best possible hand at the moment, no matter what your opponents are holding.

But think about what happened. Your friends got all of their money in, presumably because they like their hands. Each rival thinks his hand is best. They're both bearish on your hand.

Don't listen to them. You know for a fact that you have the best possible hand and that this is an extremely favorable opportunity to get your money in. In fact, you have a way better understanding of this hand than your friends do (not that you can blame them, since they don't know what you have). Ignore the "market," and stick to your guns.

Back to stocks
Obviously, that was a pretty extreme example, but you get the point: When you recognize a favorable opportunity, it really doesn't matter what anybody else thinks. This kind of thing happens all of the time in the stock market, too, since the fair values of stocks don't fluctuate nearly as much as those stocks' prices do.

I think casino stocks are a great example. In the past couple of years, the share prices of nearly all of the casino operators got way ahead of themselves, as the companies became extremely popular with the market. Recently, after the casino operators hiccupped a little bit (at least in Wall Street terms), the stocks got hammered. All of a sudden, stocks of some of the best players in the industry, including Harrah's Entertainment (NYSE:HET) and Motley Fool Hidden Gems selection Ameristar Casinos (NASDAQ:ASCA), have found themselves down in the Dumpster. As a result, the stocks were pretty good bets; Ameristar has since seen a run-up. The same thing happened last year with slot makers International Game Technology (NYSE:IGT) and WMS Industries (NYSE:WMS), as the two companies worked their way through a lull in domestic slot-machine replacement sales.

Similarly, some of my favorite Internet retailers have also hit the value bin. Motley Fool Stock Advisor selection eBay (NASDAQ:EBAY) recently offered a rare opportunity to get a decent price on its stock. Dell (NASDAQ:DELL) is another beaten-down stock that nonetheless inspires confidence in some very well-known value investors.

The controversial Overstock.com (NASDAQ:OSTK) is a perfect case for this article; this is one stock that everybody loves to hate, and the stock price has fallen accordingly. The company has yet to prove profitable, and there are obvious concerns about how much time CEO Patrick Byrne has spent on issues unrelated to the business itself. But while its timing has been delayed a couple of years by poor execution, I think a look at Overstock's income statement shows obvious profit potential. Moreover, though Patrick Byrne can be over-the-top and sometimes aggressively optimistic, I believe that the recent return of Jason Lindsay as Overstock's president provides a much-needed level head at the top of company management. A read through the Q2 earnings conference call should bear this out.

I am betting that Byrne, Lindsey, and Co. will get things on track, and we'll eventually see that Overstock shares' current low price makes little sense.

Contrarianism in a nutshell
Look to buy when others are afraid, and consider selling when the market is too excited about a stock. When you see value, you've arrived at the only decision you need to make. And if your friends or some other wisenheimer on Wall Street disagrees with you, you can always refer to my cult contrarian motto:

"The market is wrong; I am right."

We'll raise you further Foolishness:

Dell is a recommendation of both Motley Fool Stock Advisor and Inside Value . eBay is a Stock Advisor pick; Ameristar is aHidden Gemspick; and Overstock is a former Rule Breakers recommendation. Try any of our Foolish newsletters free for 30 days.

Fool contributor Jeff Hwang owns shares of Ameristar Casinos, International Game Technology, WMS Industries, eBay, and Overstock.com. The Fool has a disclosure policy.