Greece is burning, Italy's imploding, and the U.S. economy is limping along in a recovery so weak it's barely stronger than a recession. And investors are reeling.

But next year may turn out to be pretty good for stocks.

How can I say that? Because from here on, the market's historic calendar is in investors' favor.

And if we can stay out of recession in the United States and avoid one in the developing world, earnings of U.S. companies may hold up well enough to support somewhat higher stock prices. (A recession in Europe is already baked into the cake.)

Most of all, 2012 is a presidential election year; since 1948, markets have gained in every presidential election year except 2000 and 2008. In fact, stocks have, on average, put in their second-best performance in the fourth year of a president's term. (The third year has been best.)

And during years in which incumbent presidents run for re-election, the market has beaten its average election-year performance significantly.

It doesn't matter if the incumbent wins or loses (though no investor can know that in advance) or how good or bad a president he was. The market has just done better in "incumbent" election years than in "up for grabs" elections, like Bush vs. Gore in 2000 or McCain vs. Obama in 2008.

The data are remarkably consistent.

The Standard & Poor's 500 Index ($INX) posted average returns (not including dividends) of 5.7% during all presidential election years from 1944 to 2008, according to S&P chief equity strategist Sam Stovall.

The Stock Trader's Almanac, using the Dow Jones Industrial Average ($INDU) and earlier proxies, calculated nearly identical presidential election-year returns, 5.8%, from 1832 to 2008. (The Dow itself averaged 7.4% annually in election years from 1900 to 2008, according to the Almanac's figures.)

And I looked separately at years in which an incumbent president was running for re-election. It didn't matter if the president was running after a full elected term, like Ronald Reagan, or took office after the death or resignation of the previous incumbent, like Lyndon Johnson or Gerald Ford.

The results? In the 14 election years since 1928 that included an incumbent president, the S&P 500 rose an average of 14.6%. In all the incumbent election years since 1900, the Dow gained on average 9% -- substantially besting the averages' performance during all election years.

When he heard these results, Stovall said, "People feel more comfortable that at least you know how to drive the bus. You're not facing (one of) two people taking over who lack total experience."

In other words, one devil you know is better than two you don't.

Stovall, incidentally, is pretty bullish on the market for the rest of this year as well as next year. He wrote that the S&P "barely escaped" a bear market when it closed at 1,099.23 on Oct. 3 and then bounced back strongly, "suggesting the bull market is still alive."

Research he's done on the four severe corrections (15% to 20% declines) and the four mini-bear markets (20% to 25% sell-offs) since 1945 indicates that "the S&P 500 gained an average 23% in the six months after these eight market bottoms . . . (and) was higher by an average of 31.7% a full year after these market declines had run their course."

So it's not surprising that S&P's Investment Policy Committee recently raised its 12-month target for the S&P to 1,360 from 1,260.