Financial Stock Chart © Kick Images, Photodisc, Getty Images

Yes, Virginia, there is a stock market Santa Claus -- and he starts giving gifts right after Halloween.

The Halloween Effect, which postulates that stocks tend to do better from November through April, has been debated for decades. Now comes a new study -- the most comprehensive on the topic -- confirming that the Halloween Effect works.

The study examined returns from 108 countries (essentially all of the world's stock markets) for as long as 319 years. (Yes, Virginia, the stock market in England has been around that long.) Over three centuries, according to Ben Jacobsen, a finance professor at Massey University, in New Zealand, and graduate student Cherry Y. Zhang, authors of "The Halloween Indicator: Everywhere and All the Time," which can be found on the Social Science Research Network website, stock markets worldwide have gained 6.9%, on average, during the November-April periods. From May through October, however, markets went up an average of just 2.4%. (The study examined results based only on price changes, because total-return figures were sometimes unavailable, particularly for earlier years. This isn't likely to have affected the findings because dividends tend not to change much over the course of a year.)

The study found that the Halloween Effect has strengthened in the past 50 years. The best decade for the strategy worldwide was the period from 1981 through 1990, when stocks climbed, on average, 10.7 percentage points more per year from November through April than from May through October. The gap, on average, was 5.8 percentage points per year in the 1990s and 6.5 percentage points per year from 2001 through 2011.

The Halloween Effect doesn't occur every year. But in the United Kingdom, for which the study provided the most details, the authors found that holding a diversified package of stocks only from November through April beat a buy-and-hold strategy 63% of the time over the past 319 years.

Within the past decade, the Halloween Effect has looked better the longer the period of time you examine. Over two years in the U.K., the strategy beat buy-and-hold 71% of the time. Over five years, the chances rose to 82%, and over 10 years, the odds favored the strategy 92% of the time.

The authors found that stocks gained more from November through April than from May through October in 81 of the 108 countries studied. The strategy worked best in Western Europe, but did it well in the U.S., too.

For the U.S., the authors looked at data for each 10-year period beginning with 1911. The strategy failed in three early decades, but it worked well in every 10-year period starting with 1951. From 1951 through 1960, November through April beat the rest of the year by an average of 5 percentage points. In the 1960s, it was ahead by 5.5 points; in the 1970s, by 6.7 points; in the 1980s, by 6.6 points; in the 1990s by 4.2 points; and from 2001 through 2011, by 5.7 points.

Why does the strategy work? Theories have abounded for years, but the authors say the most compelling explanation is that people take vacations in the summer, so they pull money out of stocks to pay for their trips and because they worry that something calamitous might occur while they're away.

That could explain why the effect has strengthened in recent decades, as more people take vacations. It could also explain why it works best in developed countries. On the other hand, new computer devices that enable investors to trade easily from anywhere could, perhaps, lessen pre-vacation, fear-induced stock sales.

While the authors consider vacations to be the strongest explanation for the Halloween Effect, they're not convinced it is the true reason for what they call "a puzzling anomaly."

The strategy has been around for decades. The London Telegraph newspaper in 2005 quoted an elderly broker who recalled the Halloween Effect from as early as 1934.

"It was always 'sell in May,'" he said. "I think it came about because that is when so many of those who originate the business in the market start to take their holidays, go to Lord's (cricket ground) and all that sort of thing." What can you do with this information? The numbers are compelling, but I still can't imagine staying completely out of stocks from May through October. For one thing, doing all that selling could generate a big tax bill.

But the magnitude and consistency of the Halloween Effect seems to me to be too strong to ignore. Maybe it makes sense to boost your allocation to stocks by, say, 10 percentage points on Halloween.

Click here to become a fan of MSN Money on Facebook

More from Kiplinger’s Personal Finance magazine: