The S&P 500 and Dow Jones Industrial Average climbed to fresh records Wednesday in a choppy session exacerbated by light holiday trading volumes.

The S&P 500 gained 6.71 points, or 0.1% to finish at 4793.06, eking out its 70th record close of the year. The Dow also notched a new closing high after adding 90.42 points, or 0.2%, to finish at 36488.63. That marked the blue-chip index’s sixth consecutive daily gain—its longest winning streak since mid-March.

The technology-heavy Nasdaq Composite, in contrast, lost 15.51 points, or 0.1%, to close at 15766.22.

Stocks are in the midst of what is known as the “Santa Claus rally,” or the period that includes the year’s last five trading days and the first two sessions of the new year. Since 1950, the S&P 500 has ended higher about 77% of the time during the period, according to Dow Jones Market Data, with an average gain of 1.3%.

Heading into the new year, investors said there are reasons for optimism, with many expecting a continued economic recovery ahead. Money-managers said they are also becoming more comfortable with the view that the Covid-19 Omicron variant may not lead to harsh restrictions on commerce and movement. State governors are implementing light-touch measures to try to avoid disruptions. 

“There’s an element of positivity. The data continues to suggest that the disease itself caused by Omicron is materially less severe than the variants which have preceded it,” said James Athey, an investment manager at Abrdn. “That’s always been the endgame for the pandemic.” 

Investors’ subsiding fears over the Omicron variant have helped propel stocks higher in recent sessions. The S&P 500 is now up 1.4% for the week and almost 28% for the year.

Movements this week, however, have been exacerbated by lower-than-average trading volumes due to the holiday season. Trading volumes reached the lowest level all year on Tuesday, according to a composite metric that includes the New York Stock Exchange and the Nasdaq. Investors said some of the choppiness this week has also likely been driven by portfolio repositioning.

“Institutions and individuals are trying to get ahead of the year-end mark,” said Jason Pride, chief investment officer of private wealth at Glenmede.

Among the S&P 500’s 11 sectors, the energy, financials and communication services sectors fell Wednesday. But shares of many technology and travel companies also struggled. Chip maker Advanced Micro Devices and American Airlines Group posted among the biggest declines in the S&P 500, with losses of 3.2% and 2.6%, respectively.

Traders working Tuesday on the floor of the New York Stock Exchange.

Photo: ANDREW KELLY/REUTERS

Shares of several large technology companies pulled back. Amazon.com lost $29.20, or 0.9%, to finish at $3,384.02.

Apple added 9 cents, or about 0.1%, to close at $179.38. Investors have been keeping a close watch on the tech behemoth’s trading as it edges closer to becoming the first company to close above a $3 trillion market capitalization. Apple would need to close above $182.856 to reach the milestone.

In bond markets, the yield on the benchmark 10-year U.S. Treasury note rose to 1.542% from 1.480% on Tuesday. That marked its highest yield since Nov. 24. Yields move inversely to bond prices.

Oil prices rose. Global benchmark Brent crude rose 0.4% to $79.23 a barrel.

Bitcoin fell about 0.8% compared with its level at 5 p.m. ET on Tuesday. It traded around $47,210.30 as of 5 p.m. ET, according to CoinDesk, after declining the most in nearly a month the previous day.

Overseas, the pan-continental Stoxx Europe 600 fell 0.1%. The FTSE 100 advanced 0.7% on the first day of trading this week after U.K. markets were closed for bank holidays. 

In Asia, most major benchmarks slid. The Shanghai Composite Index retreated 0.9% and Japan’s Nikkei 225 closed down 0.6%. Hong Kong’s Hang Seng Index fell 0.8%.

The Year in Markets

Write to Anna Hirtenstein at anna.hirtenstein@wsj.com and Caitlin McCabe at caitlin.mccabe@wsj.com

Copyright ©2021 Dow Jones & Company, Inc. All Rights Reserved. 87990cbe856818d5eddac44c7b1cdeb8