By the Numbers

Here's what tends to happen after a strong year

Getty Images

If history is an indication, the stock market could extend its rally into 2014.

U.S. stocks are up for a sixth-straight session, with the Dow gaining 3.4 percent, or its strongest six-day win streak since March 2012. So far this year, the S&P 500 is up 29 percent, on pace for its best yearly performance since 1997, while the Dow is up 25 percent, or its biggest annual gain in a decade.

The strength of the rally has been felt across the board. In fact, the Dow closed at a record 20 percent of the time in 2013, and 17 percent for the S&P 500.

The Dow is on pace for five years of consecutive gains, up 87 percent in that period—the best five-year increase since 2000.

Other major indexes like the Nasdaq Composite, Dow transports, Russell 2000 and S&P Midcap 400, are up more than 30 percent year-to-date, respectively.

But the rally may not be over. Since 1950, there have been 17 other instances when the S&P 500 was up more than 20 percent in a year. The index finished positive the following year 14 times, or 82 percent of the time.

When positive the following year, it finished with a gain of least 7 percent 12 times or 86 percent of the time.

Below is a look at how the market performed after closing a year with a gain of at least 20 percent.

S&P 500 Years with +20% Gains
Date% ChangeDate% Change
200923.45201012.78
200326.3820048.99
199826.67199919.53
199731.01199826.67
199620.26199731.01
199533.56199620.26
199126.319924.46
198926.491990-6.56
198526.33198614.62
198025.771981-9.73
197531.55197619.15
196720.0319687.66
196123.261962-11.81
195838.0619598.48
195527.2519562.62
195445.02195527.25
195022.48195116.15
Average:11.27
Median:12.78
Avg. when positive:15.69


—By CNBC's Giovanny Moreano. Follow him on Twitter: @giovannymoreano