The record-breaking rally has brought the S&P 500's return this year to nearly 25%, and if the gains hold up for the rest of the year, the market could have more room to run in 2020 if history is any guide.
Going back to 1928, there have been 17 occasions when the S&P 500 has scored an annual gain of at least 25%. And 71% of the time, the S&P 500 is positive in the following year with an average gain of 7%, a CNBC analysis using FactSet data found.
The S&P 500 was up 24.5% for the year through Friday's close.
The average is skewed by a 36% loss in 1936 around the Great Depression. Looking at the average performance in the "modern" era starting in 1950, the average annual performance is a gain of 11.25% for the S&P 500 after a banner year.
The S&P 500 has only had five negative years following a 25% annual return since 1928.
Wall Street strategists and investors have said it's all coming down to President Donald Trump and the China trade war if the market can close out the year with solid gains. The market has been moving on any development in the U.S.-China trade fight for nearly two years.
Optimism on a trade resolution has risen recently after the two countries reached a truce and started working up a so-called phase one deal. White House economic advisor Larry Kudlow said the two countries were "getting close" to reaching a trade deal, sending stocks to new all-time highs.
To be sure, next year could be unpredictable due to the 2020 presidential election. Wall Street is already worried about the ascent of Sen. Elizabeth Warren and her wealth tax proposals. Big investors including billionaires Paul Tudor Jones and Leon Cooperman have warned of a market correction should the Massachusetts Democrat take the White House.