Jack-o-lantern and a piggy bank © chrisbrignell, Getty Images

Forget Washington's paralysis. Stop worrying that the market is "too high." Put aside concerns that third-quarter earnings are tepid. Instead, brighten up: Halloween is here, and that means Wall Street, if history is any guide, is about to stage a six-month-long party.

The "Halloween Indicator" is one of the few stock market patterns with a substantial body of research behind it. The most comprehensive study, published last year, found that stocks worldwide rose 6.9 percent, on average, from November through April, and only 2.4 percent from May through October.

Authored by Ben Jacobsen, a finance professor at Massey University in New Zealand, and graduate student Cherry Zhang, "The Halloween Indicator: Everywhere and All the Time" examined price changes in 108 countries stretching back as far as 319 years. (The researchers used price-only returns rather than total returns because it was impossible to obtain old dividend data in some markets.)

The Halloween Indicator is the flip side of "sell in May and go away" -- a Wall Street saw that in effect suggests staying out of the stock market from the start of May through the end of October. But although the New Zealand study finds that markets aren't as strong in the May-October period as they are in the November-April period, stocks in many countries still show gains, on average, from May through October.

Selling in May didn't prove to be a fruitful strategy this year. From May 1 through October 21, the Standard & Poor's 500 Index ($INX) returned 11.4 percent. That was a little less than the market's 13.2 percent return from November 2012 through last April, but that's cold comfort to those who headed for the sidelines last spring.

Jacobsen says he has no idea why the sell-in-May strategy failed this year. "I wish I knew why the strategy works in some years and doesn't in others," he said in an e-mail. The same, of course, holds for the Halloween Indicator. It may not work every year, but the strategy, Jacobsen says, is "as good as it gets."

In the U.S., Jacobsen and Zhang found, the November-April period beat the May-October period by 5.7 percentage points, on average, from 2001 through 2011. From 1991 through 2000, November-April outperformed the other half of the year by 4.2 points, on average. In the 1980s, it was ahead by 6.6 points; in the 1970s, by 6.7 points; in the 1960s, by 5.5 points; and in the 1950s, by 5.0 points.

Overall, the authors found, the strategy worked in 81 of the 108 countries they tracked. It worked best in Western Europe, but the pattern was strong in the U.S., too.

What's more, in the United Kingdom, which the authors studied most closely, the strategy worked better the more years you employed it. Compared with buying and holding, selling in May and buying back November 1 worked only 63 percent of the time over one year. But over five years, it worked 82 percent of the time, and over ten years, it worked 92 percent of the time.

No one knows why the strategy has worked. The authors call it a "puzzling anomaly."

Jacobsen says he has been employing the strategy with his own money "for over 20 years with a lot of success." He holds cash from May through October.

I worry about any market-timing strategy, particularly one that has no clear rationale for why it works. But the amount of data on this anomaly is too massive to ignore. My biggest problem with it is that the market tends to rise from May through October, too, so why sell?

If I were going to employ the strategy, I'd do so only in a tax-deferred account -- and I'd use it only to raise and lower my stock allocation by, say, five to ten percentage points. If you do it with a bigger part of your portfolio, I think you're setting yourself up for failure because you're likely to give it up after a bad stretch or two.

Finally, the stock market has already enjoyed a terrific year (year to date through Oct. 21, the S&P 500 has returned 24.4 percent), and a pullback is inevitable at some point. But we don't know when the retreat will occur, or how deep it will be.

However, there are reasons to be bullish -- aside from Halloween. The economy is growing, albeit at a slow pace. The Federal Reserve may taper its bond buying, but it's committed to keeping short-term interest rates near zero until the economy strengthens. Most Republicans sound unwilling to go through another "Perils of Pauline" experience anytime soon, so we may avoid debt and budget crises early next year. Finally, although the market isn't cheap, I don't think it's overpriced, either.

Click here to become a fan of MSN Money on Facebook

More from Kiplinger's