U.S. stocks closed little changed Friday to finish the strongest weekly advance since November, with gains in technology and consumer shares offsetting declines among commodity producers amid a drop in crude oil.

The Standard & Poor’s 500 index closed down 0.05 percent to 1,917.78, slipping for a second day while still gaining 2.8 percent for the week. The Nasdaq Composite Index rose 0.38 percent to 4,504.43, wiping out an early drop of as much as 0.7 percent. The Dow Jones industrial average fell 21.44 points to 16,391.99. About 7.6 billion shares traded hands on U.S. exchanges, 7 percent below the three-month average.

advertisement | advertise on newsday

“We got overextended to the downside last week, we’ve had a pretty decent bounce . . . and now we’re at an overbought condition,” said Michael James, managing director of equity trading at Wedbush Securities Inc. in Los Angeles. “I’m not surprised to see a pullback yesterday and a continued pullback today.”

Investors were able to mostly shrug off oil’s biggest drop in a week, with the impact not spreading deeply beyond energy and raw-materials shares. U.S. benchmark oil futures fell 3.7 percent and below $30 a barrel in New York after U.S. crude stockpiles rose to the highest in more than eight decades. — Bloomberg News