Stocks had their best January gains in more than 30 years, and that should mean 2019 will be a pretty good year for the market.

That's what the widely watched January barometer tells you — so goes January, so goes the year. According to Stock Trader's Almanac, going back to 1950, that metric of January's performance predicting the year has worked 87 percent of the time.

But the indicator also signaled a positive year last year, and the market suffered an unusual late-year sell off, wiping out all of the gains. The ended 2018 down 6.6 percent, despite rising 5.6 percent in January. But the S&P also defied history with a terrible December decline of 9.6 percent, the biggest loss for the final month of the year since 1931.

This January, the S&P 500 was up 7.9 percent. That would be the best January performance since 1987, when it rose 13.2 percent.

Some market pros worry the sharp snap back in stocks since the late December low means January could be stealing the gains from the rest of the year. Some also believe there could be another test at lower levels in the not too distant future. Yet, Wall Street forecasters have a median target of 2,950 for the S&P 500 at year end, a big leap forward from the current 2,704.

"I'm still struck between the contrast of a year ago and now. We came in last year with nothing but optimism. At this point last year, we had synchronized global growth, confidence had spiked to record post-war highs, and everyone knew we had this steroid-induced earnings boost coming. The thought was how could stocks lose, and of course they did," said James Paulsen, chief investment strategist at Leuthhold Group

The market has sprung back from December's low, with the S&P gaining 15 percent since Dec. 26.

"This year, we came in with nothing but bad news – the economy was slowing down….The rest of the world is slowing. We have trade wars. We have the shutdown, and analysts are revising earnings lower. We're worried about a recession and a bear market. It's strikingly different, and yet it's kind of like how can stocks win, but they are and I think they will," said Paulsen.

Strategists also point to the differences in the way the market traded in each January. This January has been full of volatile swings, with ultimately larger gains than losses. Last year, the market was at the end of a long smooth glide path higher.

Stocks did well through most of January 2018, but by the end of the month, a correction started. "On January 30, in 2018, it was the first 1 percent decline in 112 days. That was basically the start of the fall off the cliff. In terms of percent gains, this January is similar to last but in terms of where we've come from, it's very different. That was one of the calmest advances in history," said Frank Cappelleri, executive director at Instinet.

Cappelleri said it's important to put this year's market move in context, when considering the January barometer. "You have one of the biggest snap backs after a very bad December, so the odds were in the market's favor to do better than that. I think maybe you have to look where we are now. You're up 15, 20 percent from the low depending on where you look. Are we going to go up that much more for the rest of the year?" he said.

Paulsen sees the gains continuing, after a possible pause. "I think it's going to continue to be a fairly good year, and I think we probably go up and get close to the highs or 3,000 on the S&P, and I'm not expecting hardly anything on the economy, and earnings are going to be weak, if not flat or maybe down," Paulsen said.

He said the slowing economy and a potential trade deal could push the dollar down and that would be a positive for stocks. At the same time, the Fed has paused and may even stop its balance sheet unwind.

Jeff Hirsch, editor-in-chief of the Stock Trader's Almanac, said there's another set of statistics that are in the market's favor for a positive 2019, though they also failed last year. He said for the years when the S&P 500 was positive in the first five days of the year, plus gained during the Santa rally period, and was up for the month of January, the S&P 500 had a positive year 27 out of 30 times. It also had an average gain of 17.1 percent in those years, since 1950.

The Santa rally period is the last five days of the year, and the first two trading days of January.

"It's definitely more encouraging after a kind of pull back in a midterm year," said Hirsch. He said there have been cases where the market bottomed late in the year though it's not common for December. "I think some of the legislation of tax reform, and de-regulation helped prop up the midterm year more than it normally would have."

Some market pros are skeptical of the January barometer, but Hirsch said it makes sense because that's when Wall Street expectations are reset for the year. That's when big investors and pension funds put money to work for the new year, or not.

Paulsen said the barometer has been fairly accurate. "To me, there's a little more credence to it," he said. "A lot of money changes hands around that time, whether it's year end bonuses or pension contributions. I do think it does sort of reflect an attitude, a sentiment that you may not get exhibited in other months of the year, and to that extent, it has some credence."