U.S. stocks closed more than 1 percent higher in light volume trade Tuesday, as the tech sector led broad gains amid some stabilization in oil and commodity prices. (Tweet This)
The S&P 500 climbed back into positive territory for 2015 as information technology gained about 1.3 percent to lead all 10 sectors higher. The S&P 500, Dow Jones industrial average and the Nasdaq composite topped their 50-day moving averages.
"This isn't a high-conviction rally. It's the Facebook's and Amazons. It's the FANG stocks — Netflix and Google. There's not a lot of people around," said Lawrence McDonald, managing director, head of the U.S. Macro Strategies group at Société Générale. "If you're in an equity seat, a portfolio manager, if you see oil rallying, that reduces systemic risk. What happens is people are just chasing performance (into the) year-end. If we're going to be up 1 percent, people want to participate in that."
The Nasdaq composite outperformed as biotech and major tech stocks advanced. Amazon closed up nearly 2.8 percent after hitting a fresh all-time high in intraday trade. The stock is up more than 120 percent year-to-date, second only to Netflix as the top S&P 500 performer for the year so far.
Shares of Qualcomm closed up about 2.6 percent amid news the chipmaker entered new license agreements with two Chinese firms.
"Generally a risk-on mode. The correlation has been such ... that when oil is up, the markets take on a risk-on mode because (oil's) the biggest risk," said Ilya Feygin, managing director at WallachBeth Capital.
"There really isn't much else going on other than this volatility in Asia and commodities," he said.
U.S. crude oil futures settled up $1.06, or 2.88 percent, at $37.87 a barrel.
"The demand expectations have flip-flopped a bit," said Phil Flynn, energy market analyst at Price Futures Group. He noted the sharp reversal of Monday's sell-off in oil was due partly to light trade volume and more optimism about demand.
Other commodities gained, with copper up more than 3 percent in intraday trade to its highest level in more than a week. Nine large copper smelters in China have agreed to cut sales of spot metal by as much as 200,000 tonnes in the first quarter of 2016 to counter low prices, according to an early Tuesday Reuters report, citing an executive at one of the smelters.
Natural gas extended Monday's surge to settle up 6.46 percent at $2.372, up more than 25 percent over the past five days.
The Alerian MLP ETF (AMLP), which tracks large- and mid-cap energy master limited partnerships, reversed an initial rally to close down about 1 percent.
European stocks ended up about 1 percent or more. Asian equities closed higher, with Australia outperforming with a more than 1 percent gain.
In economic news, home values in October were 5.2 percent higher year-over-year, greater than the 4.9 percent annual gain in September, according to the S&P/Case-Shiller National Home Price Index that covers all nine U.S. census divisions.
Consumer confidence for December came in at 96.5, topping expectations.
Treasury yields climbed, with the hitting a high of 1.103 percent, its highest since April 2010. The 10-year yield touched 2.319 percent, its highest since Dec. 16.
"The front end of the curve is definitely going to flatten as the Fed gets closer to raising rates. ... I do think the market is starting to price in a little higher increase in rates," said John Bredemus, vice president at Allianz Investment Management.
The 2-year yield is "being driven by a little less quality demand as people move into risk assets," he said, noting that his outlook for returns in 2016 remains moderately positive regardless of this week's performance into the year-end.
The Treasury auctioned $35 billion in 5-year notes at high-yield of 1.785 percent. Demand was below average.
The U.S. dollar traded about 0.2 percent higher against major world currencies, with the euro near $1.094 and the yen at 120.45 yen against the greenback.
Tuesday was the second day of a shortened trading week, the last of the year. Markets are closed Friday for New Year's Day.
Stocks closed well above session lows Monday in light volume trade but held lower as a renewed slide in oil prices weighed.
As of Tuesday's close, the S&P 500 was up 0.95 percent year-to-date, while the Dow Jones industrial average was down 0.57 percent for the year so far. The Nasdaq composite was up 7.85 percent for 2015.
The Dow transports closed up 0.7 percent.
The closed up 21.86 points, or 1.06 percent, at 2,078.36, with information technology and health care leading all 10 sectors higher.
The Nasdaq composite closed up 66.95 points, or 1.33 percent, at 5,107.94.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, held near 16.
About 11 stocks advanced for every four decliners on the New York Stock Exchange, with an exchange volume of 589 million and a composite volume of 2.5 billion in the close.
Trade volume across exchanges was on par with Monday's, which was one of the lowest of the year.
Gold futures for February delivery settled down 30 cents at $1,068.00 an ounce.
On tap this week:
10:00 a.m. Pending home sales
10:30 a.m.: Oil inventories
1:00 p.m. 7-year Treasury note auction
3:00 p.m.: Farm prices
8:30 a.m. Initial claims
9:45 a.m. Chicago PM
10:30 a.m.: Natural gas inventories
4:30 p.m.: Fed balance sheet
New Year's Day holiday
*Planner subject to change.
More From CNBC.com: