Stocks turned higher Tuesday as crude oil declined and the fourth-quarter earnings season drew closer. 

The S&P 500 was up 0.07%, the Dow Jones Industrial Average gained 0.05%, and the Nasdaq added 0.12%, trading at an intraday high of 5,541. Caterpillar (CAT) and American Express (AXP) were the biggest gainers on the Dow. 

Crude oil prices declined on Tuesday after slumping to a three-week low a day earlier. Commodities slumped after Friday's weekly reading on U.S. drilling activity showed an increase for the 10th consecutive week in a row. Trading has been erratic since the beginning of the year when a production freeze agreement among Organization of Petroleum Exporting Countries went into effect.

West Texas Intermediate crude was down 0.7% to $51.61 a barrel on Tuesday morning.

Investors were in wait-and-see mode ahead of the kickoff to the fourth-quarter earnings season later in the week. Average earnings for the S&P 500 in the fourth quarter are expected to increase 4.4% from the same period a year earlier. Earnings growth would mark the second straight quarter of gains after the third quarter broke an earnings recession that lasted for four consecutive quarters.

"We believe investors are pricing in a beat for fourth-quarter earnings," said Lindsey Bell, investment strategist at S&P Capital IQ. "EPS growth hasn't fallen short of expectations since first quarter 2009 and the past two quarters had solid beat rates of 4.9% and 3.5%, respectively. As long as investors don't anticipate a greater-than-average beat, fourth-quarter earnings shouldn't rock the market.

If you liked this article you might like

Equifax Breach Reveals Frightening Truth: Companies Can Delay Disclosing Hacks

How Alibaba's 'Genie' Smart Speaker Can Overcome the Amazon Echo's 3-Year Head Start and Still Win

Facebook, Apple, Netflix and Google Have Caught the Flu -- Here's How Not to Get Killed By It

How to Play the Coming 'FANG Flu'

Travis Kalanick and the Terrible, Horrible, No Good, Very Bad Week