U.S. stocks closed higher on Tuesday, with the Dow ending in record territory, supported by earnings results that continued to come in ahead of expectations.

Both Caterpillar and 3M boosted the blue-chip average’s advance, while broader gains were limited by declines in health-care shares.

What did the main benchmarks do?

The Dow Jones Industrial Average DJIA, +0.05% rose 167.80 points, or 0.7%, to 23,441.76, marking its 54th record close of 2017.

The S&P 500 SPX, +0.42% added 4.15 points, or 0.2%, to end at 2,569.13, with seven of the 11 main sectors posting gains. Financials led the gains, up 0.7%, with materials and industrials not far behind, up 0.6% and 0.5% respectively. Meanwhile, health-care stocks faltered, largely due to declines in biotech shares.

The Nasdaq Composite COMP, +0.59% rose 11.60 points, or 0.2%, to 6,598.43, with gains limited by a drop in biotechnology shares. The iShares Nasdaq Biotechnology ETF IBB, -0.95% fell 0.8%.

Both the S&P and the Nasdaq remain half of a percentage point away from record levels.

COMP, +0.59% Which stocks were key movers?

Heavy-machinery manufacturer Caterpillar Inc. CAT, +0.70% jumped 5% in its biggest one-day percentage gain since July after its earnings beat forecasts. Fellow Dow component3M Co. MMM, +0.19% gained 5.9% after its own results, its biggest one-day pop since July 2009. Both stocks were among the biggest gainers on the Dow and the S&P 500.

Shares in Whirlpool WHR, +0.44% fell 11% a day after the appliance manufacturer posted weaker-than-anticipated results and lowered its outlook, and Sears Holdings Corp. US:SHLD reportedly plans to stop selling Whirlpool appliances in its stores. Whirlpool was the S&P’s biggest loser.

McDonald’s MCD, -0.15% rose 0.3% after reporting third-quarter results that met expectations. Global same-store sales rose 6% in the quarter, above forecasts.

Lockheed Martin Corp. LMT, +2.64% fell 2.4% after its third-quarter profit came in below analyst forecasts.

General Motors Co. GM, -0.16% rose 3% after it posted earnings and revenue that topped forecasts.

Drug giantEli Lilly & Co. LLY, -0.86% fell 2.3% after its results while Biogen Inc. BIIB, +0.07% sank 3.9% despite results that topped forecasts.

Read:EarningsWatch—Amazon, Alphabet and AMD form tech’s A list

Facebook Inc. FB, +0.96% edged 0.3% higher after the social network late Monday denied that it’s planning to charge publications to post in its main product.

What drove markets?

Check out:MarketWatch’s Economic Calendar

Traders may be bracing for Thursday’s European Central Bank gathering and Friday’s release on U.S. third-quarter gross domestic product. There are also expectations that President Donald Trump will announce a new Federal Reserve boss before he starts a trip to Asia on Nov. 3.

Read: Trump asked Senate Republicans who should be next Fed chair, and John Taylor reportedly was the winner

See:Trump says he’s ‘very, very close’ to naming pick for Fed chief

What are strategists saying?

“For the most part, earnings across sectors are coming in strong, and Caterpillar is significant today. Not only did they blow their numbers out of the water, but they export so much, suggesting that the whole concept of the global economy becoming synchronized and moving higher is in play,” said John Brady, managing director at R.J. O’Brien & Associates, a futures brokerage and clearing company.

“I’m not concerned about valuations yet, though it is hard to find cheap stocks. But there is just no compelling investment alternative to equities right now.”

What did other assets do?