Stocks remained higher Tuesday despite a sharp drop in oil prices and declines in the energy sector.

The Dow Jones Industrial Average pared earlier gains but was rising 0.18% to trade at 20,087, well off a new intraday record high of 20,155. The Nasdaq gained 0.11% but also was off its highs. The tech-heavy index hit an intraday record high earlier in the session of 5,690. The S&P 500 struggled for direction, up 0.03%. 

Oil prices in the U.S. Tuesday settled down 1.6% to $52.17 a barrel, dragging the energy sector down. Shares of Chevron (CVX)  declined 1.4%, Anadarko Petroleum (APC) dropped 2.6% and Occidental Petroleum (OXY) fell 1.9%.  

"Anytime we get above $50 a barrel and stay there, U.S. shale producers are going to start to ramp up and we are starting to see that now," said David Schiegoleit, U.S. Bank's private client reserve managing director. "One of the reasons oil is falling today, is that shale production is starting to ramp up and could offset cuts from some of the major OPEC producers."

Shares of tech companies Apple (AAPL) and IBM (IBM) rose as did consumer staples. 

"We are about half-way through it and it is a good earning season in terms of results vs. expectations," said Schiegoleit. "While the backwards-looking results are positive, there is a little bit of concern in some of the internal numbers in earnings."

Schiegoleit said the markets were also concerned about Donald Trump's next policy moves. 

"The market wants a little bit more visibility out of Washington, D.C. before it trades much higher," he said. "The market is trying to discern the validity or the likelihood of Trump's economic policies actually being put into law. There's a little bit of concern that some of his political messaging is getting muddled and lost in some of the fights around things like immigration." 

General Motors (GM) posted stronger-than-expected fourth-quarter earnings Tuesday and lifted its global car sales estimates for the next four years. Earnings of $1.28 a share beat Wall Street expectations, while revenue rose 11% to $43.9 billion, topping forecasts. Net income fell almost 71% to $1.8 billion from $6.3 billion a year earlier

The automaker sold 10 million vehicles in 2016, up 1.2% from a year earlier. Shares of General Motors fell 4.8%.

GAP (GPS) shares fell 1% after the San Francisco-based retailer reported that its sales in the fourth quarter and in January rose in what was generally a dismal holiday season for retailers. Same-store sales in January increased 1%, and were up 2% in the fourth quarter. In January 2016, Gap's same-store sales fell 8% and slipped 7% in the fourth quarter of 2015.

Michael Kors (KORS) fell close to 11.5% after third-quarter same-store sales fell 6.9% and its guidance for fourth-quarter earnings fell below Wall Street forecasts. The retailer posted earnings of $1.64 a share, beating analyst estimates, on revenue of $1.35 billion, which came in below expectations.

Twenty-First Century Fox (FOXA) shares fell 1% after the media company reported a profit of 46 cents a share, beating Wall Street estimates, while revenue of $7.68 billion missed expectations. Revenue in the quarter rose 4.2% on a "record-breaking post-season baseball run" and strong entertainment, series, and news programming, the company said.

BP ( BP) declined 4.1% after the oil company missed quarterly earnings expectations. Earnings of 13 cents a share missed analysts' estimates of 16 cents. Revenue rose 3.7% to about $51 billion but came in below forecasts.
 
"We still expect oil demand growth to be strong this year at 1.3 million barrels per day, with modest growth in non-OPEC supply -- which means the timing and extent of market rebalancing depends heavily on OPEC behavior," Bob Dudley, BP group CEO, said on the earnings call. "So while we remain optimistic about the market continuing to rebalance in 2017, we recognize that this could take some time. In short, the road to a more balanced position still has uncertainties."
 
Caterpillar ( CAT) shares rose 0.43% after the company was upgraded to "overweight" by analysts at Barclays.
 
Teva  Pharmaceuticals ( TEVA)  shares fell 6.3% after the company announced that CEO Erez Vigodman would step down immediately and be replaced by Chairman Yitzhak Peterburg on an interim basis. 
 
Others companies reporting Tuesday include Walt Disney ( DIS) , Mondelez International ( MDLZ) , Panera Bread ( PNRA) , Buffalo Wild Wings ( BWLD) , Zillow ( Z) , Netgear ( NTGR) , Take-Two Interactive ( TTWO) , Gilead Sciences ( GILD) and Yum China ( YUMC) .

Panera Bread is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer and the AAP team buys or sells PNRA? Learn more now.

Philadelphia Federal Reserve Bank President Patrick Harker said on Monday that he isn't taking an interest rate hike off the table at the next Fed meeting in March.

"I still am supportive of three rate hikes this year, of course with a major caveat, depending on how the economy evolves and policy, fiscal policy, evolves," Harker said following a speech. "I think March should be considered as a potential for another 25-basis point increase."

On the economic front, the U.S. trade deficit in December fell 3.2% to $44.3 billion. In 2016, the deficit increased slightly to $502.3 billion, the largest since 2012.

Job openings for December decreased slightly to 5.5 million, according to the Labor Department's Job Openings and Labor Turnover Survey.

More from Markets

Oil Prices Slammed on U.S. Production Gains

Oil Prices Slammed on U.S. Production Gains

Micron Shares Tumble on Mixed Earnings Results

Micron Shares Tumble on Mixed Earnings Results

Tuesday Turnaround: Fed Up With the Fed Yet?

Tuesday Turnaround: Fed Up With the Fed Yet?

What Is Litecoin? What to Know in 2019

What Is Litecoin? What to Know in 2019

Dow Closes Positive as Stocks Buffeted by Volatile Tuesday Trading

Dow Closes Positive as Stocks Buffeted by Volatile Tuesday Trading