Stocks closed higher on Wall Street after three days of losses as a week of worry about trade talks between the U.S. and China wound down and more in Friday’s Stock Market Update.

The modest gains Friday weren’t enough to erase a weekly loss for the S&P 500 index, its first after six weeks of gains.

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 soon halt their trade dispute, or at least 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.

Banks and companies that rely on consumer spending were among the gainers, outweighing losses in technology and real estate.

STOCK MARKET UPDATE

KEEPING SCORE: The S&P 500 rose 6 points, or 0.2%, to 3,110. The Dow Jones Industrial Average rose 109 points, or 0.4%, to 27,875. The Nasdaq added 13 points, or 0.2%, to 8,519.

The Russell 2000 index of smaller companies gained 0.3%.

Major stock indexes in Europe moved higher.

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 one” agreement may not be in place until 2020. But he also stressed, again, that he thought Xi wanted to make a deal more than he did.

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.”

RETAIL RUN: Nordstrom (NYSE: JWN) surged 10.6% 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.

SWEET RETURNS: J.M. Smucker (NYSE: SJM) climbed 3.9% 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.

SOUR OUTLOOK: Intuit (NASDAQ: INTU), the company behind TurboTax, skidded 4.1% for the largest loss in the S&P 500 after it gave a profit forecast for the current quarter that fell short of Wall Street’s expectations.

TRUCKED: Tesla (NASDAQ: TSLA) dropped 6.1% after some analysts panned the unveiling of its electric pickup truck. It’s aiming at the most profitable part of the North American market, but investors are skeptical about how many traditional pickup drivers the blocky, angular looks of Tesla’s “Cybertruck” will draw.

© The Associated Press. All rights reserved.