A strange but compelling reason to buy stocks next year

Will the calendar be the market's best friend in 2015?

According to a recent blog post by Ed Yardeni of Yardeni Research, years ending with the number five – like, say, 2015 – tend to be strong for stocks, with a positive return averaging 25 percent for the S&P 500.

Those "five" years following midterm elections were almost always positive as well. "The most likely explanation is that midterm elections tend to increase gridlock in Washington, D.C.," explained Yardeni in an earlier post. "While the debt-ceiling political crises of August 2011 and late 2012 suggested that too much gridlock is bearish for stocks, it has been quite bullish historically."

(Watch: S&P, Dow again rise to record closes amid earnings)

So with the midterms behind us, is there reason for the markets to get excited about the coming year?

"It's a happy coincidence," said Gina Sanchez, founder of Chantico Global. "This kind of data mining, while interesting, is not going to tell us a whole lot of what happens in the markets."

Instead, Sanchez believes what happens next year for the market will have more to do with the Federal Reserve's monetary policy than with the last digit of the calendar year.

"You still have the Fed very accommodative," Sanchez said. "As long as that's the case, money will flow into equities and will flow into risky assets."

But that may not last forever. In fact, Sanchez believes it will come to an end in 2015. "A year from now, we're probably going to be into a rate-hiking cycle," she said. "It's hard to imagine stocks meaningfully higher."

However, the technicals may be more on Yardeni's side, according to Craig Johnson, senior technical research analyst at Piper Jaffray and president of the Market Technicians Association.

"Stocks are going to work well into year-end,and I think they're also going to work well in 2015," he said.

(Read: Where will the market be at year end?)

Adding to Yardeni's research, Johnson saidreturns are positive a majority of the time three and six months after a midterm election. On top of that, 2015 is the third year of the four-year presidential cycle, Johnson notes. "That is the strongest of all four years," he added. "I think 2015 is going to shape up to be pretty good."

Meanwhile, the chart for the S&P 500 is positive as well, according to Johnson. He believes the index continuing to remain in a trend channel he sees as having been in place since 2015.

"We're getting toward the upper end of the channel, "he said. "There is no sign of any sort of immediate trend change. It looks very positive to us and we look for 2,100 at the end of this year and 2,350 at the end of 2015 –and you're not stretching valuation to get there, either. "

Based on Monday's close, that would mean an additional 3 percent in the S&P 500 by the end of this year and an 11.9 percent return on the index for 2015.

Follow us on Twitter: @CNBCNumbers
Like us on Facebook: facebook.com/CNBCNumbers