NEW YORK (Reuters) - A gauge of global equity markets and Wall Street’s three major indices finished at all-time highs on Thursday in light holiday trade as a year-end rally advanced further on optimism over a U.S.-China trade agreement.

Oil rose to three-month highs, buoyed by a report showing lower U.S. crude inventories, hopes the pending Sino-U.S. trade deal will soon be signed and efforts by the Organization of the Petroleum Exporting Countries (OPEC) to curb crude supply.

Gold prices also rose.

MSCI’s all-country world index and Wall Street’s Dow Industrials, the benchmark S&P 500 and the technology-rich Nasdaq all closed at record highs.

Boxing Day holidays closed markets in Commonwealth countries around the world while a second Christmas Day shuttered markets in a swath of European countries.

Overnight in Asia, equity markets rose. China shares closed higher after Beijing laid out additional plans to bolster its economy, including infrastructure investments.

MSCI's gauge of stocks across the globe .MIWD00000PUS gained 0.38% to a record, on track for its best year since 2009. The index has gained 24% this year.

Wall Street's Dow Jones Industrial Average .DJI rose 105.94 points, or 0.37%, to 28,621.39. The S&P 500 .SPX gained 16.53 points, or 0.51%, to 3,239.91 and the Nasdaq Composite .IXIC added 69.51 points, or 0.78%, to 9,022.39.

MSCI's broadest index of Asia-Pacific shares outside Japan .MIAPJ0000PUS closed up 0.15%, while Japan's Nikkei .N225 rose 0.60%. Its emerging market index rose 0.28%, lifted by a 1.1% gain in Brazil's Bovespa .BVSP index, which is up 33% for the year.

Wall Street was boosted by U.S.-China trade optimism and gains in Amazon.com AMZN.O after a report signaled robust online holiday sales.

Amazon shares jumped 4.4% after Mastercard said U.S. shoppers spent more online during the holiday shopping season than in 2018, with e-commerce sales hitting a record.

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

The S&P 500, up 29% so far this year, is less than four-tenths of 1 percentage point shy of its best annual gain since 1997.

Investors in major equity markets around the world have chalked up strong gains this year, marking a contrast to a plunge late last year, noted Yousef Abbasi, global market strategist at INTL FCStone Financial Inc in New York.

“People are pretty happy with this year,” he said.

Fourth-quarter earnings will soon come into focus in January, which should highlight whether sentiment among corporate management has improved, Abbasi said.

Recession fears scuttled capital expenditure plans during much of 2019, but strong employment and signs of an improving global economy suggest that will change next year.

The number of Americans filing applications for unemployment benefits fell last week in a sign of ongoing labor market strength.

A spokesman for China’s commerce ministry said Chinese and U.S. officials are in close touch and going through necessary procedures before signing a Phase 1 trade deal.

Gold prices rose to a two-month high. Spot gold XAU= added 0.8% to $1,510.98 an ounce.

Gold has been on the rise recently as a hedge against potential inflation, dollar weakness and increased equity market volatility in 2020, Abbasi said.

U.S. government debt yields fell after the Treasury Department sold $32 billion in seven-year notes to strong demand. The notes sold at a high yield of 1.855% in light trading volume.

Benchmark 10-year notes US10YT=RR last rose 4/32 in price to yield 1.8944%.

The auction comes after a $41 billion sale of five-year notes on Tuesday met strong demand and slightly soft interest in a $40 billion two-year note sale on Monday.

The dollar mostly edged lower, while oil gained. Against the Japanese yen, the dollar rose to a near two-week high as U.S.-China trade optimism sapped demand for safe-haven currencies.

The dollar index .DXY fell 0.1%, with the euro EUR= up 0.1% to $1.1101. The yen JPY= weakened 0.25% versus the greenback at 109.64 per dollar.

Brent crude LCOc1, the global benchmark, settled up 72 cents at $67.92 a barrel, the highest since Sept. 17. U.S. West Texas Intermediate CLc1 crude gained 57 cents to settle at $61.68 a barrel.

Brent has rallied 25% in 2019, supported by supply cuts by OPEC and allies including Russia.

The American Petroleum Institute, an oil industry group, said late Tuesday that U.S. crude stocks fell by 7.9 million barrels last week, much more than analysts had forecast. [API/S]

U.S. gold futures GCcv1 settled 0.7% higher at $1,514.40 an ounce.