When everyone is frightened about the stock market, opportunistic investors start looking for bargains. But right now, after a huge rally over the past four months, investors are getting cocky with their profits -- and contrarian investors should be looking for ways to protect themselves.

Throwing in the short-selling towel
Ask average investors what they think of the recent bull market move, which has produced more than 22% in gains for the S&P 500 since the end of August, and they'll probably tell you it's helping everyone get some of their money back from losses during the market meltdown two years ago. But what most people forget is that a huge number of investors use short-selling techniques, betting that the market or particular individual stocks will fall.

In the wake of huge gains for most stocks, short-sellers have been feeling the squeeze. And as losses on their positions mount, some short-sellers have given up on their bets, covering their short sales. According to Bloomberg, short interest on S&P 500 stocks recently fell to its lowest level in a year. The news service pointed out that short covering was specifically concentrated in the technology and telecom sectors, as short interest in Adobe (Nasdaq: ADBE) fell by 28% while CenturyLink's (NYSE: CTL) short position dropped 13%.

Even larger declines span across industry lines, suggesting that enthusiasm for stocks is more general than sector-specific. For instance, UnitedHealth Group (NYSE: UNH) has been plagued by concerns about health-care reform and potential cuts in profitability, yet short interest fell by a whopping 75% in the last two weeks of 2010. At the other end of the spectrum, Teck Resources (NYSE: TCK), which has been a hot commodity stock thanks to its wealth of metal resources, has also seen a big drop in shares sold short, with current short interest only a third what it was as recently as mid-December.

You'll also find more optimism among exchange-traded fund investors. A wide range of focused ETFs, including the chip-centered S&P Semiconductor ETF (NYSE: XSD), the small-cap fund iShares S&P Smallcap 600 Growth (NYSE: IJT), and even inflation-protected bond ETF iShares Barclays TIPS Bond (NYSE: TIP) have seen short interest plummet 80% or more in recent weeks. That corresponds with interest in semiconductor stocks, many of which saw big gains in 2010, and potentially with rebalancing as investors diversify into small caps and inflation-protected Treasuries.

Trouble ahead?
Shorts giving up the ghost might sound like the sky's the limit for market bulls. But especially after an explosive move upward like this, the burst of buying that comes from short-sellers covering their positions often proves to be the final push upward before a correction comes. That doesn't necessarily bode ill for the long-term prospects for stocks. Corrections happen regularly and give investors a chance to buy attractive stocks at slightly cheaper prices.

On the other hand, it isn't as though short-sellers have given up entirely. There are plenty of stocks that have attracted the attention of investors betting against stocks. One of the most extreme examples is First Bancorp, which has more than three times more shares sold short than its total float. Rising short interest in a popular emerging market ETF as well as Boston Scientific and Annaly Capital also show that bears aren't quitting.

Keep on track
Short-interest figures are an interesting statistic on the sentiment of the market. But if you're a long-term investor and have an investing strategy that doesn't depend much on short-term stock movements, then you don't need to worry too much about changes in confidence levels about the market.

After a big rally, if you haven't rebalanced your portfolio recently, it's a good time to consider getting it done. But as far as making wholesale permanent changes to your investing approach, as troubling as overconfidence may be on a short-term basis, you don't need to let bullish sentiment derail your long-term plan.

Get the best stocks you can find. Click here to get The Motley Fool's free report, "5 Stocks the Motley Fool Owns ... and You Should, Too."