It’s been a banner year on Wall Street, with the S&P 500 closing out November up 26.6% in 2013, its best year-to-date surge since 1997.

As investors begin looking ahead to next year, what does this stellar 2013 performance say about the outlook for 2014?

According to S&P Capital IQ, the S&P 500 has followed an annual gain of 20% with an average increase of 10%, recording a positive performance 78% of the time.

“While a ‘great’ year may not be in the cards, we think a ‘good’ one is,” Sam Stovall, chief investment strategist at Capital IQ, wrote in a note this week.

But that doesn’t mean 2014 will be smooth sailing. Stovall said each year after a 20% rally featured an intra-year decline in excess of 6% and as deep as 19.3%.

“There’s no sign of recession, which suggests the economy and earning should continue to grow. But I do think we’ve probably passed the point where (investors) will be as willing to drive up the price of equities dramatically faster,” said Bruce McCain, who helps oversee more than $20 billion as chief investment strategist at KeyCorp’s (KEY) Key Private Bank.

There are 21 instances of annual gains of more than 20%. The most recent example occurred in 2009 as investors drove the S&P 500 23.5% higher thanks to the end of the Great Recession --  and then tacked on another 12.8% in 2010.

Capital IQ said the average annual gain after a 20% rally is 10%, compared with a rise of 8.7% in all years since World War II. The 78% advance rate in these years is above the normal rate of 71%.

The best performance following a 20% up year occurred in 1997 when the S&P 500 soared 31%, outperforming the prior year’s 20.3% gain.

The worst example occurred in 1946 when the benchmark index slumped 11.9% and eventually fell into a bear market after surging 30.7% in 1945.

Even if 2014 turns out to be another green year, there seems to be a good chance there will be bumps in the road.

"We foresee more moderate stock market upside for 2014 along with more volatility," Stuart Freeman, chief equity strategist at Wells Fargo Advisors (WFC) wrote in a report issued this week. 

Freeman pointed to upcoming fights over the federal budget and uncertainty from the leadership change at the Federal Reserve. 

Capital IQ notes that each year after a 20% gain, the S&P 500 suffered a pullback of at least 6%. Even in what turned out to be a solid 2010, the market retreated as much as 16% amid double-dip fears before resuming its upward trend.

In 1998, the S&P 500 nearly fell into a bear market (defined as a 20% retreat from a prior high) by tumbling 19.3%. But the index still ended the year up 26.7%.

“We believe a decline of 10%-20% is very likely,” Stovall said. However, he said if the slump occurs within the first six months of the year, the market should have time to end the year in the green since it has only taken four months on average to get back to the break-even point following all corrections since World War II.

"We foresee more moderate stock market upside for 2014 along with more volatility."

- Stuart Freeman of Wells Fargo Advisors

So what might cause a 10% to 20% correction in 2014?

Stovall said the problems that keep him and his colleagues awake at night include the political dysfunction in Washington, a deceleration of earnings among S&P 500 companies, a peak in profit margins and the Federal Reserve’s efforts to dial back quantitative easing.

“It’s hard to imagine margins expanding,” said McCain, who also noted that equities have grown at a much faster clip than earnings.

McCain said he’s worried about an “uneasiness that may be pervading the consumer mentality” and pressuring spending, especially due to worries over the threat of higher health-care costs.

Yet most of those issues have largely been discounted by investors, meaning the reaction to such an outcome would likely be muted – “like the second or third bounce of a ping pong ball dropped on a table,” Stovall said.

Other potential events that are less factored in by market participants include deflation in Europe, rising tensions surrounding the disputed territories off the coast of China and the threat of a natural disaster or terrorist attack.

Follow Matt Egan on Twitter @MattMEgan5