Stocks Eke Out a Gain in Thin, Choppy Trading

Stocks came off their best levels but still logged a a gain in thin, choppy session Tuesday following reports that Italian Prime Minister Mario Monti will meet Italy's President to form the nation's next new government and after a handful of better-than-expected economic reports.

The Dow Jones Industrial Average squeezed out a gain of 17.18 points, or 0.14 percent, to close at 12,096.16, led by Hewlett-Packard and Intel .

The S&P 500 gained 6.03 points, or 0.48 percent, to end at 1,257.81. The Nasdaq rallied 28.98 points, or 1.09 percent, to finish at 2,686.20.

The CBOE Volatility Index, widely considered the best gauge of fear in the market, finished below 31.

Most S&P sectors ended in the black, led by techs, while energy finished slightly lower.

“Market in doldrums is a relief, but it’s driven by a lack of headlines,” said Brian Battle, director and vice president of trading at Performance Trust Capital Partners. “It looks like there’s more risk to the downside in the short-term.”

Stocks closed mostly lower in Europe, adding to the previous session's decline, as investors continued to worry about the southern European countries' ability to tackle their sovereign debt problems and prevent their borrowing costs from rising.

New Italian Prime Minister-designate Mario Monti has completed the process of forming a government in less than three days as the debt-ridden nation races to protect itself from a major financial and political crisis that has boosted its borrowing costs to alarming levels.

Monti is expected to announce a cabinet composed mainly of technocrats.

Among earnings, Wal-Mart tumbled after the world's biggest retailer narrowly missed profit expectationseven though same-store sales rose more-than-expected. In addition, S&P cut its price target on the company to $67 from $68.

Home Depot gained after the home-improvement retailer beat earnings estimates and raised its outlook. Meanwhile, Oppenheimer raises its price target on the firm to $47 from $41.

Staples slumped after the office supply retailer reported lower-than-expected sales, due to weak demand in Europe, and slashed its profit forecast for the year.

Dell is set to post results after-the-bell tonight.

Chevron and Transocean declined following online rumors speculating that a recent spill by the two firms off the Brazil coast may be larger than originally expected. However, both companies denied the news, saying that the well was no longer leaking.

On the economic front, retail sales gained in October, as strong receipts from motor vehicle and building material dealers offset the drag from service stations, according to the Commerce Department.

The Empire state manufacturing index rose in November, reversing five straight months of declines, while the outlook for coming months strengthened, according to the New York Federal Reserve.

Meanwhile, producer prices fell in October for the first decline in four months, amid lower prices for gasoline and consumer goods, according to the Labor Department.

AndU.S. business inventories remained flat in September, according to the Commerce Department.

—Follow JeeYeon Park on Twitter: twitter.com/JeeYeonParkCNBC

On Tap This Week:

WEDNESDAY: Weekly mortgage apps, CPI, industrial production, housing market index, oil inventories, Fed's Lacker speaks, Fed's Rosengren speaks, LA auto show; Earnings from Abercrombie & Fitch, Target, Applied Materials, Limited Brands, NetApp
THURSDAY: Housing starts, jobless claims, Philadelphia Fed survey, Fed's Pianalto speaks, Motorola Mobility votes on Google acquisition, GM IPO 1-year anniversary; Earnings from Dollar Tree, GameStop, Ross Stores, Sears, Gap, Marvell Tech
FRIDAY: Leading indicators; Earnings from Heinz

More From CNBC.com: