5 days might tell this year's market story

The S&P 500 passed the first five days of the year with a gain, but just barely.

According to market lore, that suggests a positive year for the stock market.

But the way the S&P 500 earned its gain may be more telling about the type of volatility investors might expect this year.

The S&P finished 2014 at 2,058.9, and it closed its fifth trading day at 2,062, after gaining 1.7 percent. That followed a wild surge on Wednesday, which was preceded by two violent days of selling. The S&P was as low as 1,992.44 Tuesday, a loss of 3.2 percent from the start of January trading.

Read MoreThis is a ticking time bomb for stocks

According to the Stock Trader's Almanac, the last 41 positive first five days were followed by full-year gains 85.4 percent of the time, or 35 times. The average gain was 14 percent for the following year. Exceptions include 1994 and four years when there was war in both Vietnam and the Middle East.

The market missed the boat this year for what is technically called a Santa Claus rally, a typically positive gain in the final five days of the year and first two of the new year. Now that it has passed the first five days with a gain, it could also prove positive on the broader "January barometer," which covers the performance for the entire month of January.

The Stock Trader's Almanac says January's monthly performance is a more accurate predictor for the direction of the year. In 14 of the last 16 years, the market followed January's direction for the year. However, that did not hold true last year.

While the S&P 500 was down 3.6 percent in January 2014, it was up 11.4 percent for the year. The first five-day rule did not work either for stocks, since the S&P was off 0.6 percent in that period last year.

Read MoreRate hikes would be positive for these stocks: Pro

A CNBC survey of Wall Street strategists shows they expect a 7.8 percent gain for the S&P in 2015 from 2014 levels.

"Obviously people watch it. But would I make an investing decision for the next 245 trading days based on it? No," said Michael O'Rourke, chief market strategist with JonesTrading. "Most of the time we're up (in the first five days), and most of the time the market is up. The rally for the past two days was silly. That's the best way to describe it."

But Jeffrey Hirsch, editor-in-chief of the Stock Trader's Almanac, said it's an encouraging sign, and like the Wall Street strategists, he sees a gain for the year.

Read MoreHere's what happens to stocks when oil drops 50%

He said there's only been three instances where the Santa rally did not work out where the first five days were positive. In two of those years, 1971 and 1968, the market was higher for the year. In 1994, it was slightly negative, down 1.5 percent.

But he said he won't judge it until he sees what the January barometer shows at the end of the month.