Stock markets are approaching all-time highs again, something that seemed impossible only a few years ago. This week the Dow Jones Industrial Average (DJINDICES:^DJI) rose 1.8% to 13,895.98, within 2% of its all-time high. The S&P 500 (SNPINDEX:^GSPC) was up 1.1% to 1,502.96, within shouting distance of its all-time high close of 1,565.15.

When you add in dividends (which we should always do), the indexes are hitting new highs almost every day.

^DJI Chart

^DJI data by YCharts.

Earnings drive the week
The good news is that earnings are moving stocks higher this week. IBM (NYSE:IBM) was the biggest winner on the Dow this week, climbing 5.8%. The big jump was on Wednesday, after the company released earnings. The company reported earnings per share ahead of estimates for the 40th straight quarter -- an incredible feat for a company of IBM's size.

Procter & Gamble (NYSE:PG) was the second biggest gainer after rising 4.7% this week. Again, earnings drove the move when earnings per share of $1.22 were a surprise $0.11 higher than estimates. P&G isn't a growth stock at this point in its history, but investors had become concerned it was losing share in international markets. Right now, that pressure appears to have subsided for the time being. After it grew revenue at just 2%, I'm not sure a 20 P/E ratio is a good value for buyers right now. But it was a good week nonetheless.

Finally, Home Depot (NYSE:HD) fought off somewhat disappointing housing data to post a 3.6% gain this week. New-home sales fell 7.4% in December from a month earlier, although 2012 sales were 20% higher than a year ago. The stock really rode increased market confidence and general market moves to the strong results, rather than anything company-specific.