The final tally on the 2013 gain is 29.7%. On December 31, it climbed 7.3 points to 1848.35. It’s the best year since 1997.

The S&P 500 has closed at or very near the highs of the year several times in the last few decades.

Once was 1991, the following year the index gained 4.2% and went on to gain 270% before the bull market ended in 2000. However, in 1999 the index also closed out the millennium at the highs as the tech boom busted. The index continued 5.4% higher before the bust hit. The most recent example was 2010, which was followed by a flat year for stocks in 2011.

SP500 annual chart

S&P 500 annual chart

So in the past three years of closing at the annual highs you have another gain, a big bust and a flat year — something for everything.

The S&P 500, Nikkei and DAX all touched annual highs in their final days of trading, optimism abounds.