U.S. stocks closed higher on Tuesday, continuing the market’s postelection updraft, with the Dow Jones Industrial Average turning in a seventh winning session in a row and its fourth straight record close.

The Dow Jones Industrial Average DJIA, -1.92% clawed back from an earlier deficit to finish with a gain of 54.37 points, or 0.3%, at 18,923.06. Shares of Verizon Communications Inc. VZ, -1.52% , Chevron Corp. CVX, -4.74% , Microsoft Corp. MSFT, -3.29% and Exxon Mobil Corp. XOM, -3.20% led the advance. Earlier, the average had been down by as many as 63 points.

The S&P 500 index SPX, -2.37% finished up 16.19 points, or 0.8%, at 2,180.39, led by a 2.7% jump in energy stocks. Oil futures CLZ26, -1.14% settled up 5.8% at $45.81 a barrel after three sessions of losses, amid ongoing efforts to shore up a proposed production cut by members of the Organization of the Petroleum Exporting Countries.

The Nasdaq Composite Index COMP, -3.01% —which has been under pressure of late as technology stocks have fallen—rose 57.23 points, or 1.1%, to finish at 5,275.62.

There also was a temporary respite in what has been a rout in U.S. government bonds, suggesting that investors are reassessing their positions after a sharp swing in the wake of Republican Donald Trump’s surprise election win.

Wall Street has been in an uptrend since the election. Many investors expect that Trump’s policy proposals, including massive cuts to corporate tax rates, infrastructure spending, and reduced financial and environmental regulation, will provide a boost to companies, though details remain scarce.

“We’ve been concerned about valuations for a year and a half, but if these policies lead to an acceleration in earnings, those concerns will go away. Right now that’s a big if, but it’s what markets are telling us,” said Bruce Bittles, chief investment strategist at Robert W. Baird & Co, who expects the market’s rally to persist.

“We’re going through a big transition in a number of ways, including from a regulated economy to a more free one. That process is only a few market days old, and for it to fully unfold will take more time,” he said.

Read:Rudy Giuliani seen as front-runner for Trump’s secretary of state

In the latest economic news, retail sales rose 0.8% in October, making for the best two-month stretch since early 2014. The growth rate was modestly above what analysts had forecast. Separately, a measure of New York-area manufacturing conditions turned positive in November for the first time in four months while business inventories rose 0.1% in September.

Positive economic news, however, is acting like a double-edged sword, said Karyn Cavanaugh, senior market strategist at Voya Financial.

“Any questions about the [health of the] economy are subsiding,” Cavanaugh said. “But the more good news we get, the more rates will rise.”

After nearly two weeks of declines before the election, followed by more than a week of gains, investor euphoria is cooling off because of the expectation of higher interest rates, she said.

See:MarketWatch’s Economic Calendar

On the Fed front, Boston Fed President Eric Rosengren said expectations of a December rise in interest rates are plausible.

Vice Chairman Stanley Fischer said at the Brookings Institution that U.S. capital market liquidity is mostly adequate but that “flash” events may happen more frequently. Dallas Fed President Rob Kaplan was also scheduled to speak about discussing competitiveness in an appearance at the George W. Bush Center in Dallas.

Individual movers: Shares in American Airlines Group Inc. AAL, -3.32% , United Continental Holdings Inc. UAL, -2.90% Delta Air Lines Inc. DAL, -2.18% and Southwest Airlines Co. LUV, -1.49% all finished higher, following news late Monday that Warren Buffett’s Berkshire Hathaway Inc. BRK.B, -2.12% BRK.A, -1.79% had bought stakes in the carriers.

Retailer Home Depot Inc. HD, -2.47% fell 2.6% despite posting better-than-expected quarterly results, while Dick’s Sporting Goods Inc. DKS, +0.60% fell 6.9% following a weak outlook.

Check out:Home Depot earnings—these are the concerns analysts are raising

Advance Auto Parts Inc. AAP, -2.43% shares rallied 15% after the auto-parts retailer’s quarterly results topped expectations late Monday.

Chesapeake Energy Corp. US:CHK, Murphy Oil Corp. MUR, -10.02% , Apache Corp. APA, -9.31% shares all closed more than 7% higher on the oil rally.

Other markets: Europe’s main stock benchmark SXXP, +0.55% finished slightly higher, and Asian markets closed mostly lower. Gold futures US:GCZ6 settled up 0.2% at $1,224.50 an ounce, as the ICE U.S. Dollar Index DXY, +0.39% ticked slightly higher.

—Victor Reklaitis in London contributed to this article.