Investors, circle Oct. 31 on your calendars. Halloween marks the end of the dogs days of summer — at least for the stock market, which tends to return most of its gains during the six months between May 1 and Oct. 31.

Called the Halloween Indicator, it might be all the more reason to continue to hold stocks if you already own them or to start investing if you don't.

In the 50 years before 2013, the Standard & Poor's 500 index of the market's largest companies returned an average of 6.6 percent in the six months after Halloween. Compare that with the mere 0.8 percent gained between May and October.

There's no clear cause and effect behind the disparity. And while a single reason is elusive, research has found the six-months-on, six-months-off effect to be true not just in the U.S. but around the world.

Of course, October itself is particularly terrifying; some of the market's biggest crashes having happened during the month. The legendary Black Tuesday plunge on Oct. 29, 1929, is considered the kickoff to the Great Depression, while Black Monday on Oct. 19, 1987, saw the Dow Jones industrial average plummet 22.6 percent in a single day. But while some investors fear October, many others see it as an opportunity.

It certainly isn't a given that stocks will go up after Halloween, but it can make sense to take advantage of that tendency. Here are a few low-risk ways to do that:

• Buy an index fund rather than individual stocks. A well-diversified fund, such as those based on the S&P 500, will be much less volatile. It might not go up as much as any one stock, but it isn't likely to go down as much, either. Index funds are a good way to ride the overall market trend.

• If you do buy individual stocks, diversify your holdings so you are not too exposed to any one. That can be tough to do when you're just starting to invest, which is another reason many investors opt for large, diversified mutual funds.

• Spread your stock purchases out, rather than jumping into the market all at once, using a strategy known as dollar-cost averaging. You set a regular time — say, the first Monday of every month — and buy regardless of what's happening in the market.

You might also consider trying a technique called tax-loss harvesting. This means you sell stocks that are down substantially for the year and not likely to rise in the short term. By selling at a loss, you can capture a tax write-off and then still move the money into another position, potentially capturing some of the Halloween effect.

James Royal is a writer at NerdWallet. E-mail: jroyal@nerdwallet.com.