Buzzy tech names lit a fire under stocks on Tuesday, pushing the S&P 500 into positive territory for the year in one of the final sessions of 2015. 

The S&P 500 (SPY) - Get Report added 1.1%, the Dow Jones Industrial Average (DIA) - Get Report gained 1.1%, and the Nasdaq (QQQ) - Get Report rose 1.3%. The S&P 500 was up 0.9% for the year. 

The technology sector allowed investors to strengthen their portfolios as industry heavyweights, including Apple (AAPL) - Get Report , Microsoft (MSFT) - Get Report , and Qualcomm (QCOM) - Get Report led gainers while Alphabet (GOOGL) - Get Report and Amazon (AMZN) - Get Report hit all-time highs. The Technology Select Sector SPDR ETF (XLK) - Get Report  rose 1.4%. 

"You're always going to have it where people are positioning their portfolio so that they can have that snapshot at the end of the year to make it look as good as it's going to look," Tom Siomades, head of Hartford Funds Investment Consulting Group, said in a phone interview.

Crude oil rebounded after a selloff a day earlier. The commodity had been under pressure earlier in the week over fears about international demand triggered by new signs of China's economic weakness. West Texas Intermediate crude oil jumped 2.9% to $37.87 a barrel.

Market activity was quieter than normal in low-volume trading during the holiday season. The number of shares traded on the S&P 500 in the past several sessions reached just a fraction of the three-month daily average of nearly 700 million. Markets will be closed on Friday for New Year's Day.

Tight supply in the housing market helped to push home prices higher in October. Prices rose 5.2% compared to a year earlier, a higher price increase than the 4.9% gain in September. San Francisco, Denver and Portland, Ore., ranked as the top-performing markets.

Consumer confidence rose in December after hitting a bump in November, according to the Conference Board. A measure on confidence rose to 96.5, up from 90.4 a month earlier. Analysts had expected an increase to 93.8. A solid job market and optimism for overall economic improvement in the new year boosted confidence.

DuPont (DD) - Get Report added 1.8% on reports it will eliminate around 1,700 jobs in Delaware in the first quarter of 2016. The chemicals company, like others in the materials sector, has been squeezed by a slump in commodity prices and reduced industrial demand.

Freeport-McMoRan (FCX) - Get Report climbed nearly 3% on Tuesday, rebounding from a 10% slump a day earlier. Shares had been under pressure after chairman and co-founder James Moffett announced his resignation.

Icahn Enterprises (IEP) - Get Reporthas stepped in with a higher offer after Pep Boys (PBY) - Get Report agreed to accept Bridgestone's previous proposal. Activist investor Carl Icahn and Bridgestone have upped recent bids for the auto shop chain to secure a deal. Pep Boys said the latest offer of $18.50 a share from Icahn Enterprises was a "superior proposal" to Bridgestone's bid.

Dunkin' Brands (DNKN) - Get Report shares were on watch after the company announced a new partnership with Madison Square Garden (MSG) - Get Report . As part of the deal, the Dunkin' Donuts brand will have significant ad space during Knicks, Rangers and Liberty games and will also become the official coffee of the three teams.

FedEx (FDX) - Get Report has responded to its weak performance over Christmas that resulted in a number of late deliveries, noting that both severe weather and an "unprecedented surge" of last-minute purchases were to blame. The delivery service contended with severe weather interruptions, particularly at its major air hub in Memphis. FedEx ran extra shifts on Christmas Day to clear the delivery backlog.

Valeant Pharmaceuticals (VRX) slipped 2% after appointing three executives to temporarily take over for its CEO, Michael Pearson, who was hospitalized with pneumonia last week. Valeant has faced pushback for its drug price hikes and link to a pharmacy that pushed name-brand drugs.