A trader laughs ahead of the closing bell on the floor of the New York Stock Exchange (NYSE) on February 1, 2019 in New York City.

Stocks hit a new high for the year this week, back on track to match a post-election pattern that has stood the test of time.

The stock market has risen in the year after all 18 midterm elections since World War II, with delivering an average return of 14.5 percent, according to LPL Financial Research. The pattern is pointing to a longer bull run even after this year's epic rebound.

"With the S&P 500 up only 1.3 percent since the midterm election last November, there indeed could still be room for stocks to run in 2019," LPL's Ryan Detrick said in a note on Wednesday.

After this week's rally, the stock market has bounced back from December's steep sell-off with up more than 12 percent year to date. And there are a couple catalysts that could send stocks even higher, including a China trade deal that could take the uncertainty out of the market and a helping hand from the Federal Reserve that already signaled a more "patient" approach to rate hikes and it is prepared to "adjust" balance sheet unwind if needed.

President Donald Trump, 'glued' to the stock market's fluctuations, is a big champion of this market pattern as he views a booming market as his way to re-election. CNBC reported last week Trump is pushing hard to strike a trade deal with China in the hope of lifting the stock market ahead of his re-election bid.

"The third year leading up to an election tends to be a very good one for the market because the president is trying to have the economy and the party in power looking good for getting re-elected," Andrew Slimmon, senior portfolio manager at Morgan Stanley Investment Management, said on CNBC's Power Lunch.

The year prior to a presidential election has almost always been a good one — in the last 19 such years, the market is up on average 15 percent and 18 out of 19 times it's been positive, according to Slimmon.

The pattern can also be explained by the gridlock situation often seen after an election, where lawmakers and the President are unlikely to do harm or remove any bullish policy that is already in place.

— With reporting from CNBC's Michael Bloom