When lots of investors hate a stock, they're sending you a very important message: Maybe you should think about buying it.

That might seem like a pretty strange conclusion, but history shows that buying the market's most-hated big stocks can actually pay off in the long-run.

Over the last decade, buying the most hated and heavily shorted large and mid-cap stocks (the top two quartiles of all shortable stocks by market capitalization) would have beaten the S&P 500 by 9.28% each and every year.

Why does being a contrarian work out so well? The secret is in the "short squeeze."

Too much hate can spur a short squeeze, a buying frenzy that's triggered by short sellers who need to cover their losing bets to exit the trade. When the short trade becomes crowded, heavily shorted stocks can see large, sudden moves higher.

For our purposes, one of the best indicators of just how high a short-squeezed stock could go is the short interest ratio, which estimates the number of days it would take for short-sellers to cover their positions. The higher the short ratio, the higher the potential profits when the shorts get squeezed.

Today, we'll replicate the most lucrative side of this strategy with a look at five big-name stocks that short sellers are piled into right now. These stocks could be prime candidates for a short squeeze in the months ahead.

Target 

Leading off our list of heavily-shorted large-caps is $48 billion retailer Target (TGT - Get Report) . Target has actually been a strong performer in 2016, rallying more than 10% since the calendar flipped to January. For comparison, the big S&P 500 index isn't even up 2% over that same stretch of time. But that hasn't stopped short sellers from piling into shares of Target lately; Target's short interest ratio of 10.55 means that it would take more than two weeks of buying at current volume levels for short sellers to cover their bets against this stock.

Target is one of the biggest of the big-box retailers, with 1,792 stores spread across the country. Target is moving back to basics in 2016, emphasizing its better in-store shopping experience and value proposition to consumers. Using food as a loss leader hasn't been a silver bullet to help Target compete with larger retail rivals -- if anything, it's been the opposite, diluting margins and tamping down Target's differentiation. More emphasis on the things Target does differently, such as its REDcard loyalty program (and the analytics that come from it) should pay off in a more meaningful way.

A high concentration of private-label merchandise should continue to be an important contributor to margins. Today, approximately 20% of revenues come from more profitable private label brands. Investors should keep a close eye on Target next week, when the firm reports its fiscal first quarter earnings results.

Wall Street likes Target right now. Eight of the last nine earnings calls have resulted in positive price reactions, and good first-quarter results could be the catalyst for a short squeeze.

Target is a holding in Jim Cramer's Action Alerts PLUS charitable portfolio. Cramer and Research Director Jack Mohr wrote recently that they remain "confident" in Target "for many reasons, including the continued explosive growth of its digital business and management's efforts to maximize efficiency throughout the supply chain."

"We believe management has implemented the right initiatives to ensure success and appreciate the company's agility in adapting to an evolving retail environment," they said.

AutoZone

AutoZone  (AZO)  is another heavily shorted stock that's moderately outperforming the rest of the market in 2016. Year-to-date, this auto parts retailer has pushed nearly 6% higher, and shares are hovering within grabbing distance of all-time highs in May. But short sellers have been piling into this big automotive parts stock in recent weeks, pushing AutoZone's short interest ratio to 10.3. That's more than two weeks of buying pressure for shorts to exit their bets at current trading volumes.

AutoZone is the biggest car parts company in the world, with 5,609 locations spread across the U.S., Mexico and Brazil. About 70% of the firm's locations also include commercial centers, which provide parts sourcing for independent auto shops, dealers, and other professionals. Older cars have been a major macro trend at AutoZone in recent years: the median age of a car on the road in the U.S. is 11.4 years, the oldest it's ever been. So, as consumers work to extend the lives of their automobiles, AutoZone is well-positioned to benefit.

Rising interest rates could become an important factor that prolongs automobile lifespans in the years ahead. As borrowing costs to purchase new vehicles increases, especially in Latin America, AutoZone stands to see increasing sales from both DIY buyers and repair shops.

Earnings at the end of May could be an important catalyst to watch for a short squeeze in AutoZone. If this stock starts pushing into new-high territory, it won't take long for short sellers to start looking at the exits.

Realty Income 

Short sellers have been piling into shares of Realty Income (O - Get Report)  in 2016. Meanwhile, this stock has been on fire, rallying 26% on a total returns basis since the beginning of the year. As Realty Income pushes its way to new highs this week, shorts are starting to feel the squeeze.

But this stock remains heavily shorted right now. As I write, Realty Income's short interest ratio comes in at 12.7.

Realty Income is one of the biggest real estate investment trusts on the market. The firm owns approximately 4,500 commercial properties, mainly freestanding retail locations, and it leases those properties to tenants on a triple-net basis. That means tenants, not the firm itself, are responsible for the property taxes, insurance and maintenance costs at Realty Income's properties. The result is consistent, predictable rent income with build-in increases for inflation.

Because Realty Income is a REIT, it's obligated to pay out the vast majority of its income in the form of dividend distributions. That fact makes Realty Income more of an income play than a real estate play -- and dividends are like kryptonite to short sellers. Since dividend payouts directly affect a stock's total returns, they cut directly into shorts' profits. And since Realty Income pays out a monthly dividend check, it's a particularly tough stock to hold short long-term, particularly given its price trajectory.

Once short sellers start exiting en masse, shares could get slingshotted higher.

Fastenal

Fastenal  (FAST - Get Report)  is a stock that seems to have a perpetually high level of shorting. But as shares push up against new highs in 2016, short sellers have been running for the exits; Fastenal's short interest ratio has fallen from nearly 20 to 11.78. They're not there yet, however. At current levels, we're still looking at a stock with more than two weeks of short interest, and 15% of its float held short. That leaves plenty of room for Fastenal to add onto its 14% price rally this year.

Fastenal is one of the biggest companies in the industrial supply business. The firm has more than 2,700 locations and a catalog that includes more than 1.4 million different items in inventory, ranging from tools to fire extinguishers to paper towels. That huge selection of offerings makes Fastenal a one-stop shop for industrial customers, who ideally want to limit the number of vendors they need to deal with. Because maintenance, repair and operation equipment and supplies are generally a relatively small expense for customers, convenience and a lower administrative burden give Fastenal an edge over smaller peers.

To boost its convenience factor, for instance, Fastenal has been innovative with products such as its own branded vending machines, which stay on-site at customers' shops. Meanwhile, to boost margins, the firm has been expanding its exposure to private label products, which only make up around 10% of sales currently.

As long as Fastenal's current price trajectory remains intact, the stock looks like a solid short squeeze candidate to ride into the summer.

Mattel

Rounding out our list of potential short squeeze stocks is $10.7 billion toymaker Mattel  (MAT - Get Report) . Mattel is one of the biggest toy companies in the world, with almost $6 billion in sales last year. The firm owns a valuable portfolio of brands that includes Barbie, Fisher-Price, American Girl and Hot Wheels. That brand positioning gives Mattel one of the biggest presences in retail toy aisles, giving it an important advantage over smaller and more fragmented rivals.

Another big benefit that comes from Mattel's scale is its ability to get major licensing and tie-in deals. The firm has lucrative licensing deals with a handful of well-known brands, from Disney to Minecraft, and Mattel is uniquely positioned (along with a couple of similar-sized peers) to shell out the cash to secure those kinds of deals.

In recent quarters, Mattel has been under pressure thanks in large part to currency losses brought on by the strong dollar, as well as the loss of the Disney Princesses license. And while those headwinds have attracted short sellers, it looks like the downside risk is finally evaporating in this stock as the firm starts to pull off its turnaround plan.

Short sellers are still heavily exposed to Mattel right now, giving this stock a short interest ratio of 10.02 at current levels. Any surprises at next week's shareholders meeting could push more shorts out of this stock, igniting a squeeze.

Disclosure: This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.