Stocks gained on Tuesday, helped by encouraging earnings, and as a rise in pending home sales helped calm fears of weakness in the housing market.

D.R. Horton , one of the top five U.S. home builders, reported its first quarterly profit in almost three years and its stock shot up 11.5 percent to $13.28.

Pending sales of previously owned U.S. homes increased 1 percent, as expected, in December. That also helped lift the housing sector, pushing the Dow Jones U.S. home construction index <.DJUSHB> up 6.5 percent.

Shares of UPS advanced 0.5 percent to $58.67 after the world's largest package shipper by volume reported a drop in fourth-quarter profit, but forecast a sharp increase in 2010 earnings.

The housing data, followed by the ISM data yesterday and the GDP last week, is making investors believe that the strength in the fourth quarter was not a fluke, and that the strength could be sustainable in the first quarter and beyond, said Bruce Bittles, chief investment strategist at Robert W. Baird & Co in Nashville, Tennessee.

The Dow Jones industrial average <.DJI> shot up 106.78 points, or 1.05 percent, to 10,292.31. The Standard & Poor's 500 Index <.SPX> gained 13.10 points, or 1.20 percent, to 1,102.28. The Nasdaq Composite Index <.IXIC> rose 17.42 points, or 0.80 percent, to 2,188.62, after rising 1.03 percent in late afternoon trading to an intraday high at 2193.66.

The S&P 500 is up for a second straight day after falling 6.2 percent in the last three weeks of January.

Exposure to emerging markets helped major industrial companies Cummins Inc and Emerson Electric Co , post rosy quarterly earnings, sending their shares higher.

Shares of industrial conglomerate Emerson Electric gained 10.3 percent to $46.84 and U.S. manufacturer of diesel engines and other power generation equipment Cummins rose 8.8 percent to $51.05.

The S&P 500 industrial sector index <.GSPI> rose 2 percent.

Tuesday's report on pending home sales followed a string of encouraging economic news, including Monday's data on the U.S. manufacturing sector from the Institute for Supply Management on Monday, and Friday's report on the economy's fourth-quarter growth.

On Tuesday, Amazon.com Inc slid for a second straight day, falling 0.7 percent to $117.96 and curbing the Nasdaq's advance. Traders continue to fear a pricing battle it lost with book publisher Macmillan could hurt sales volume growth for its Kindle e-reader.

Investors watched White House adviser Paul Volcker's testimony on Tuesday before a Senate panel. He urged Congress to rein in risky investing by big banks to help prevent them from becoming too big to fail.

Shares of JP Morgan Chase & Co gained 2.1 percent to $40.47 and ranked among the stocks giving the Dow its biggest boost, while Goldman Sachs' stock advanced 2.4 percent to $156.80.

An index of bank stocks <.BKX> was up just 0.13 percent, while an S&P index of financial services shares <.GSPF> was up 1.03 percent. (Reporting by Angela Moon; Editing by Jan Paschal)