NEW YORK (Reuters) - Oil prices and a gauge of global stock markets edged higher on Tuesday, lifted by fresh record highs on Wall Street after U.S. President Donald Trump said the United States and China were close to agreeing on the first phase of a trade deal.

Investor sentiment took heart in a steady patter of encouraging news about the prolonged trade talks, providing hope the on-again, off-again talks after 16 months of negotiations appeared to be drawing nearer to conclusion.

Trump said Washington was in the “final throes” of work on a deal that would defuse the trade war with Beijing, but he also underscored Washington’s support for protesters in Hong Kong, a potential sore point with China.

China’s Commerce Ministry earlier said Chinese and U.S. trade negotiators held a phone call to hammer out a “phase one” deal, leading U.S. and euro zone bond yields to slide as investors saw progress being made.

MSCI's gauge of stocks across the globe .MIWD00000PUS gained 0.14%, as the global benchmark traded within half a percentage point of an all-time high set in January 2018.

Equity markets have rallied on hopes of a deal, but traders are anxious to know what the reaction might be once a deal is reached, said Dennis Dick, a proprietary trader at Bright Trading LLC in Las Vegas.

“Traders are starting to book some profits and just get cautious. Cautious optimism is driving us higher right now,” he said.

The pan-European STOXX 600 index .STOXX closed up 0.1% with the French CAC 40 .FCHI up 0.08% and Germany's DAX .GDAXI closing down by 0.08%.

MSCI's emerging markets index .MSCIEF fell 0.43%.

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

All three major indexes on Wall Street set record intraday and closing highs, as gains for Disney and Best Buy overshadowed some softer-than-anticipated economic data.

The Dow Jones Industrial Average .DJI rose 55.21 points, or 0.2%, to 28,121.68. The S&P 500 .SPX gained 6.88 points, or 0.22%, to 3,140.52 and the Nasdaq Composite .IXIC added 15.45 points, or 0.18%, to 8,647.93.

For the first time in more than a year the spread on investment-grade credit default swaps, as measured by the CDX IG index, fell to new lows in a sign of optimism about the future, said Bespoke Investment Group LLC in Harrison, New York.

“New lows for credit spreads have served to confirm strong up-trends in equities over the course of this bull market,” Bespoke said in a note.

Oil prices traded higher, helped by predictions for a draw on U.S. crude stockpiles.

“The positive effect this is having on the oil price is more psychological in nature,” said Commerzbank analyst Carsten Fritsch. He noted that he does not expect oil demand to pick up noticeably even after any partial agreement is signed.

U.S. crude stockpiles were expected to have declined 300,000 barrels last week, according to a Reuters poll of analysts, ahead of reports from the American Petroleum Institute on Tuesday and the Energy Information Administration on Wednesday.

Brent crude futures LCOc1 settled up 62 cents at $64.27 a barrel, while West Texas Intermediate crude CLc1 rose 40 cents to settle at $58.41 a barrel.

The dollar trended lower.

Data showed the U.S. goods trade deficit fell sharply in October as both exports and imports declined, pointing to a continued reduction in trade flows that has been blamed on the Trump administration’s “America First” policy.

U.S. consumer confidence fell for a fourth straight month in November while other data showed an unexpected drop in newhome sales last month.

The dollar index .DXY fell 0.09%, with the euro EUR= up 0.11% to $1.1025. The Japanese yen JPY= weakened 0.11% versus the greenback at 109.05 per dollar.

Benchmark 10-year U.S. Treasury notes US10YT=RR rose 7/32 in price to push their yield down to 1.7380%.

Gold edged higher, snapping a four-day losing streak, after touching a two-week low earlier in the session at $1,450.30 an ounce.

U.S. gold futures for December GCcv1 delivery settled up 0.2% at $1,460.30.

“The only story here is the China-U.S. (trade deal). Last few sessions, gold has been selling off on hopes for a U.S.-China deal. Right now, gold is paused here and is in kind of a wait-and-see (mode),” said Bob Haberkorn, senior market strategist at RJO Futures.