markets
People walk past a board flashing key indexes of stock exchanges in the world in front of a securities company in Tokyo Oct. 5, 2015. Toru Yamanaka/Getty Images

This story was updated at 4:30 p.m. EDT.

U.S. stocks wavered Friday between small losses and small gains, but the main indexes in New York closed up slightly. Global stocks rallied much of this week as commodity prices rebounded and investors were repositioning ahead of quarterly financial reports in the banking industry next week.

The Dow Jones industrial average (INDEXDJX:.DJI) advanced 33.74 points, or 0.20 percent, to 17,084.49. The S&P 500 index (INDEXSP:.INX) edged up 1.46 points, or 0.07 percent, to 2,014.89, concluding its best week of 2015. And the Nasdaq composite index (INDEXNASDAQ:.IXIC) gained 19.68 points, or 0.41 percent, to 4,830.47.

Five of the 10 S&P 500 sectors closed the week in the green, led by health care and technology.

UnitedHealth Group Inc. (NYSE:UNH), Apple Inc. (NASDAQ:AAPL) and United Technologies Corp. (NYSE:UTX) were the Dow's best performers Friday, while Intel Corp. (NASDAQ:INTC), Goldman Sachs Group Inc. (NYSE:GS) and Exxon Mobil Corp. (NYSE:XOM) were its worst.

U.S. stocks opened weakly higher Friday as details in the minutes of the Federal Reserve’s latest meeting that were released Thursday bolstered the position that a Fed interest-rate hike isn’t likely until 2016. But comments by Dennis Lockhart, CEO and president of the Federal Reserve Bank of Atlanta, rekindled speculation that a rate increase before the end of the year was still a possibility.

“Investors don’t quite know which way to read the market,” Oliver Herington, a trader at the London-based brokerage Atlantic Equities LLP, told Bloomberg News. “Everything comes back to concerns about global growth.”

Uncertainties that lie ahead didn’t stop commodities and emerging-market stocks from rallying. Asia’s major markets closed up Friday, led by a gain of 1.64 percent in Japan’s Nikkei 225 index. The trend carried over to Europe, paced by the German DAX index, which rose 1.04 percent in Frankfurt.

Back in the U.S., Alcoa Inc. (NYSE:AA) closed down almost 7 percent after the major lightweight-metals manufacturer reported disappointing third-quarter financial results.

Oil prices were mixed on news of rising U.S. crude inventories. On the New York Mercantile Exchange, West Texas Intermediate crude, the benchmark for U.S. oil prices, rose 0.18 percent to $49.52 per barrel for November delivery. On the London ICE Futures Exchange, Brent crude, the benchmark for global oil prices, fell 1.04 percent to $52.50.

The rally in materials and industrials stocks seen this week is likely to be short-lived as China data in the coming weeks will likely point to more weakness in the world’s second-largest economy. China’s third-quarter gross domestic product likely dipped below 7 percent for the first time since the global downturn in 2008.