NEW YORK (Reuters) - Crude prices rose and global equities markets rallied on Friday, with the major U.S. indexes setting record highs, on renewed optimism the United States and China are nearing a deal to de-escalate a 16-month trade war that has crimped global growth.

Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., November 6, 2019. REUTERS/Brendan McDermid

Equity markets from Tokyo to the major bourses in Europe and across the Americas gained on remarks by White House officials, after sputtering earlier in the week when President Donald Trump dashed hopes of a deal.

Progress was being made on an agreement’s details, according to U.S. Commerce Secretary Wilbur Ross, who said trade talks were set to continue with a telephone call on Friday as both sides seek to hammer out a “phase one” pact.

Markets overseas rose after economic adviser Larry Kudlow late Thursday cited what he called very constructive talks with Beijing about ending trade tensions.

“We’re getting close,” Kudlow said.

MSCI’s gauge of stocks across the globe gained 0.76%, lifting it to within 1% of an all-time high set in January 2018. Its emerging markets index rose 0.67%.

In Europe, the pan-regional STOXX 600 index closed 0.4% higher, close to four-year highs it hit last week. The FTSEurofirst 300 index of leading shares added 0.33%.

On Wall Street, the S&P 500 posted its sixth straight week of gains in a rally that has lifted the benchmark index 8% since early October.

The Dow Jones Industrial Average rose 222.93 points, or 0.8%, to 28,004.89, the S&P 500 gained 23.83 points, or 0.77%, to 3,120.46 and the Nasdaq Composite added 61.81 points, or 0.73%, to 8,540.83.

“The market rally has largely been driven by the positive sentiment around the trade talks, obviously,” said Rahul Shah, chief executive of Ideal Asset Management in New York.

The fourth quarter, which tends to be the best period for corporate earnings, will likely be supportive of stocks, but poor macroeconomic data or a political event could trigger a downturn, Shah said.

“Since the market is hitting all-time highs and everybody’s comfortable, the risk of an event affecting the market negatively is higher now because the market is an elevated level,” he said.

The S&P 500 has gained more than 24% year to date, and the benchmark index is trading at 18 times forward earnings, or higher than a historical norm of about 15.

All but one of the 11 major S&P 500 sectors were higher, with healthcare leading the way, gaining 2.21% as Johnson & Johnson and Pfizer lifted the sector.

Gold prices and government debt prices fell as investors leaned away from safe-haven assets.

U.S. gold futures settled down 0.3% at $1,468.50 per ounce.

Benchmark 10-year U.S. Treasury notes fell 5/32 in price to push yields up to 1.8342%. Germany’s 10-year Bund yield traded at -0.332%.

The Japanese yen and Swiss franc, both beneficiaries of a flight to quality, weakened.

The dollar index fell 0.17%, with the euro up 0.28% to $1.1052. The yen weakened 0.36% versus the greenback at 108.82 per dollar.

Oil futures, meanwhile, gained nearly 2%.

Brent crude gained $1.02 to settle at $63.30 a barrel, while West Texas Intermediate crude rose 95 cents to settle at $57.72 a barrel.