U.S. stocks inched higher in morning trading Friday as a week dominated by the progress in U.S.-China trade talks — or lack thereof — comes to a close.

President Donald Trump said that a deal between the world’s largest economies is “potentially very close” after Chinese President Xi Jinping said Beijing is working to “try not to have a trade war,” but will nevertheless fight back if necessary.

Markets around the world have churned this week on uncertainty about whether the two sides can reach a deal soon to halt their trade dispute, or at least to stop it from escalating. New U.S. tariffs are set to hit Dec. 15 on many Chinese-made items on holiday shopping checklists, such as smartphones and laptops. Tariffs already put in place have hurt manufacturing around the world, and businesses have held back on spending given all the uncertainty about where the rules of global trade will end up.

The S&P 500 was on pace for its first gain in four days.

KEEPING SCORE: The S&P 500 was up 0.1%, as of 10:33 a.m. Eastern time.

The Dow Jones Industrial Average rose 66 points, or 0.2%, to 27,832, and the Nasdaq composite slipped 0.2%.

TRADE TALKS: Trump said “we have a very good chance to make a deal” in an interview with Fox News after reports through the week raised the possibility that a “Phase 1” agreement may not be in place until 2020.

In Beijing, Xi earlier told a visiting U.S. business delegation, “We want to work for a Phase 1 agreement on the basis of mutual respect and equality."

NOT ENOUGH TO TURN MOMENTUM: Despite Friday’s early gains, the S&P 500 is still on pace to close the week with a 0.5% loss.

If it stays that way, it would be the first down week for the index in the last seven and end its longest winning streak in two years.

Stocks had been chugging higher on optimism that earlier worries about a possible recession were overdone. Reports in recent months showed the job market remained solid, and corporate profits held up better than expected in the summer. Interest-rate cuts by the Federal Reserve also helped.

The S&P 500 is still within 0.6% of its record set on Monday.

RETAIL RUN: Nordstrom surged 9.3% for the biggest gain in the S&P 500 after the retailer said it made a bigger profit last quarter than Wall Street expected.

It was a bright spot for the retail sector after a long list of mall-based clothing retailers delivered weak third-quarter earnings reports. Macy’s cut its profit and sales forecast for the year as shoppers continue to head online instead of to the store.

RISING GLOBAL TIDE: Markets around the world climbed amid a mixed set of economic reports.

In Europe, France’s CAC 40 rose 0.3%, and Germany’s DAX returned 0.3%. The FTSE 100 in London jumped 1.4%.

In Asia, Japan’s Nikkei 225 rose 0.3%, South Korea’s Kospi gained 0.3% and the Hang Seng in Hong Kong climbed 0.5%.

SWEET RETURNS: J.M. Smucker jumped 4.8% after it reported stronger profit for the latest quarter than Wall Street expected.

It joins a long list of companies to do so. Nearly 96% of companies in the S&P 500 have now told investors how much profit they made during the summer, and they’re on pace to report a drop of 2.3% from a year earlier. That’s not as bad as the 4% drop that analysts were earlier expecting.

AP Business Writer Elaine Kurtenbach contributed.