A portfolio of the stocks most hated by Wall Street analysts beat the overall stock market by a wide margin in 2014.

Again.

The 10 stocks rated the worst investments on Wall Streets by analysts at the start of 2014 produced an overall return of 19% during the year, including reinvested dividends, according to my analysis using FactSet data.

That beat the S&P 500 SPX, -1.11% by a hefty five percentage points — or, to put it another way, it earned you nearly a third as much as again a simple index fund.

“ Most investors think of the stock market like a casino, where the spins of the wheel are completely outside their control, whereas it’s actually like poker, where we are all betting against each other. ”

And that isn’t a one-off. I’ve been looking at this data every year for the past seven years, and over that time the stocks the analysts liked the least have outperformed both the stock market index, and the stocks the analysts like the most, by a country mile.

Call this a mild tonic for market mania at a time when everyone is congratulating himself for investing in index funds.

Yes, index funds have a lot to be said for them. But simply wagering your money that Wall Street analysts are wrong seems to have been better.

A year ago, as usual, I asked analysts at Thomson Reuters to put together a spreadsheet of all the analysts’ recommendations for each of the 500 stocks in the S&P 500. It’s a simple experiment I conduct each year to see if the experts’ recommendations — for which they are paid an inordinate amount of money — are any good.

Among the 10 stocks with the lowest ratings a year ago were metals producer Alcoa AA, -0.96% , energy company Excelon EXC, -2.39% , and freight forwarding and logistics company C.H. Robinson Worldwide CHRW, -0.42% . These three produced gains of 30% or more each. Only one of the 10, John Deere & Co. DE, +0.92% , produced a negative return and that was just 1%.

I also looked at the 10 stocks the analysts liked the most. As a group overall they did even better, producing returns of 22.7% — mainly as a result of big gains for Delta Air Lines DAL, -3.29% , with returns of more than 80%, and medical devices maker Covidien US:COV , with returns of more than 50%.

Four of the 10 stocks that analysts loved most actually lost money last year.

Go back seven years, to the start of 2008. Imagine at that time you had invested $100,000 in an S&P 500 index fund, reinvesting all dividends, using a tax-sheltered account. Today you’d have about $170,000. Not bad.

Tommy Chong on investing in the marijuana industry

If, instead, you had invested that money at the start of each year in the 10 stocks that analysts rated most highly, cashing out on Dec. 31 and then buying the top 10 most loved stocks for the following year, today, seven years later, you’d be slightly better off — you’d have nearly $180,000, according to my analysis using FactSet data.

But now imagine you had done the exact opposite, and each year had invested your money in the 10 stocks that analysts rated the worst. How would you have done?

Hmmm.

Today you’d have $270,000. No, really. You’d have earned more than twice as much as investing in a simple index fund.

There is more than accident at play in this. Instead it reveals a powerful factor at work in the markets — a market which so many of us forget, especially during times like a boom (like now) or a crash.

The markets are about psychology as much as anything else.

James Montier, the wise strategist at money-management firm GMO, once observed that most investors think of the stock market like a casino, where the spins of the wheel are completely outside their control, whereas it’s actually like poker, where we are all betting against each other.

As a generalization, when all the analysts on Wall Street “hate” a stock the price often gets set too low. No one wants to touch it. As a result, those willing to buy the most hated stocks frequently get a bargain.

So what are the most hated assets for 2015? Stay tuned.