Stocks held slightly higher Tuesday afternoon after the energy sector turned higher on revised oil forecasts, even as the price of crude oil remained in the red.

The S&P 500 was up 0.22%. The Dow Jones Industrial Average added 0.08%, and the Nasdaq gained 0.25%. The Dow was on track for another record close.

The Energy Information Administration increased its forecasts for West Texas Intermediate crude to trade at $50.66 a barrel next year, up 1.5% from its previous target. The forecast suggested crude oil would stabilize around current levels. 

The energy sector reversed earlier losses to trade higher on Tuesday afternoon. Energy companies including Petrobras (PBR - Get Report) , Chesapeake Energy (CHK - Get Report) , ConocoPhillips (COP - Get Report)  and Eni (E) moved higher. 

Crude oil fell on Tuesday for the first time since OPEC reached its agreement last Wednesday. Oil had rallied since Wednesday in relief after some of the world's largest oil producers accepted terms to limit output. However, signs of increasing production in the last month dashed hopes that OPEC will be able to feasibly stick to its commitment. In November, OPEC produced almost 1.7 million barrels per day more than its proposed cap. OPEC's production limit is set to take effect in January.

"The latest surge in oil prices in the wake of OPEC's meeting could therefore prove to have been too pronounced, and is likely to correct at least to some extent," Commerzbank analysts wrote in a note.

West Texas Intermediate crude settled down 1.7% at $50.93 a barrel on Tuesday, coming back from a 16-month high set a day earlier.

The Dow has crept to new records in the past few weeks as investors bet that President-elect Donald Trump's Cabinet picks would herald Wall Street-friendly moves. Picks included Steve Mnuchin for Treasury secretary, a former executive of Goldman Sachs ( GS - Get Report) , who called for a roll-back of portions of the Dodd-Frank financial rules. Energy stocks Exxon Mobil ( XOM - Get Report) and Chevron ( CVX - Get Report) also drove the Dow to records after the Organization of Petroleum Exporting Countries reached a production freeze deal.

Chipotle (CMG - Get Report) slumped more than 7% on Tuesday on worries over its sales performance. At a Barclays conference, management struck a more cautious tone on its outlook for next year, saying it was "nervous" about its guidance. The burrito chain has struggled to bounce back after an e.Coli outbreak at restaurants last year. 

Nike  (NKE - Get Report) was the biggest drag on the Dow after being downgraded to market perform from underperform at Cowen & Co.. The ratings revision was tied to worries it could lose market share to Adidas and Under Armour. Cowen's Consumer Tracker survey found preference for Nike had dropped to 44% from 55%. The stock declined 2.9%.

Apple (AAPL - Get Report)  rose after CEO Tim Cook told Reuters that sales of the Apple Watch were rising and that the smartwatch would likely hold rank as one of the holiday season's most popular gifts. Cook did not disclose sales data.

"Sales growth is off the charts," said Cook. "In fact, during the first week of holiday shopping, our sell-through of Apple Watch was greater than any week in the product's history. And as we expected, we're on track for the best quarter ever for Apple Watch."

Cook's assurances come after a report from IDC on Monday that found Apple Watch shipments in the third quarter had dropped 71% from a year earlier.

Apple is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells AAPL? Learn more now.

The U.S. trade deficit jumped 17.8% in October to $42.6 billion, a four-month high, from a revised $36.2 billion in September, the Commerce Department said. Exports fell 1.8% in October, while imports increased 1.3%, hitting a 14-month high.

U.S. factory orders ramped up growth in October, jumping by their most in 18 months. The index rose by 2.7% in October, as expected, after 0.6% growth in September. The increase is a good sign for manufacturing, which has suffered over the past year from a strong U.S. dollar and weak global demand.

U.S. productivity in the third quarter was unchanged at 3.1%, the Labor Department said. Economists surveyed by FactSet had expected a revised figure of up 3.2%. Output of goods and services was revised to show 3.6% growth from 3.4% growth. Unit labor costs rose 0.7%, more than double an initial estimate.

Markets continued to shrug off potential negative effects of Italy's "no" vote on its constitutional reform referendum. Italian Prime Minister Matteo Renzi said Monday he would resign following the public's vote not to amend Italy's 1948 constitution, a clear signal that voters didn't want to implement Renzi's proposed changes to stimulate the Italian economy. European markets moved slightly higher on Tuesday morning.

Boeing (BA - Get Report)  turned higher after being down for a good part of Tuesday after President-elect Trump called for a new order for Air Force One to be canceled. Trump tweeted that the "costs are out of control" and that it could cost more than $4 billion. Boeing won a contract in January to work on a new fleet of Air Force on aircraft. The government has not yet submitted any orders.

Roper Technologies (ROP - Get Report) agreed to acquire business software developer Deltek in an all-cash deal worth $2.8 billion. The deal, expected to close before year's end, is anticipated to boost cash flow and increase revenue by $535 million in 2017.

Synchronoss Tech (SNCR - Get Report) agreed to acquire Intralinks Holdings (IL) on Tuesday morning in a deal worth around $821 million. Synchronoss will pay $13 for each share of the cloud-computing company. The deal is expected to close in the first quarter of next year. Intralinks CEO Ron Hovsepian will take over as chief executive to the combined company, while Synchonoss CEO Stephen Waldis will act as executive chairman.

Equinix (EQIX - Get Report) agreed on Tuesday to purchase a portfolio of 24 data center sites, consisting of 29 buildings, from Verizon (VZ - Get Report) . The all-cash deal is worth a total $3.6 billion. The deal is expected to close by the middle of next year.

Michaels (MIK - Get Report) tumbled after missing analysts' estimates in its third quarter. The arts and crafts retailer reported a surprise 2% drop in comparable-store sales, far worse than expected growth of 1.3%. Adjusted earnings of 40 cents a share missed by 3 cents, while revenue of $1.23 billion came in under forecasts of $1.26 billion. Michaels also offered downbeat guidance for its holiday quarter.