January has long held strong predictive power for the direction of markets over the rest of the year, and 2019 is proving no exception.

That's good news for stocks, which stand to gain significantly if the current trend stays in place, according to DataTrek Research.

The S&P 500 rose 7.9% in January, which is one standard deviation above the typical return since 1958 of 1.2%. That's only happened eight other times during the period, and the full-year market return was positive on all of those occasions and up double-digits every time but one.

The news gets even better: Average return during those years was 26.6%. The median, or midpoint, was 28.9%.

Source: DataTrek Research

With the S&P 500 up a little shy of 17% so far in 2019, history suggests still more room for the rest of the year.

A particularly strong January is a better predictor than other years when the gains or losses are more muted. The trend has held up on more than 50% of occasions but can lead investors astray on years that it is wrong. In 2016, for instance, January saw a 4% drop but the market rallied for an 11% full-year gain.

"Our historical playbook analysis of what happens after the S&P 500 has outsized gains in January is back on track, and has worked every month this year expect May," Jessica Rabe, DataTrek's co-founder, said in a note. "To reprise, abnormally strong January returns have been a historically clear signal about market direction in the subsequent months."