The Donald Trump era is marking a new age for gold as an investor safe haven.

While the precious metal has always been hoarded in times of trouble, a bevy of political and economic surprises in 2016 sparked a surge in buying that sent bullion to the first annual gain in four years.

Prices may rally about 13 per cent in 2017, according to a Bloomberg survey of 26 analysts.

Fueling the bullish outlook is the risk of chaos on multiple fronts: a possible trade war from America's fraying relationship with China, the alleged Russian hack of US political parties, the UK's complicated exit from the European Union, and elections slated in France, Germany and the Netherlands that may see a rise of nationalist groups.

Melania Trump, right, looks on as her husband President-elect Donald Trump talks to reporters during a New Year's Eve party at Mar-a-Lago. Photo / AP
Melania Trump, right, looks on as her husband President-elect Donald Trump talks to reporters during a New Year's Eve party at Mar-a-Lago. Photo / AP

And then there are Trump's frequent Twitter posts, in which the US president-elect feuded with rivals and made declarations that unsettled allies even before he takes office this month.

"140 characters of unfiltered Trump is likely to create tensions with America's largest trading partners," said Mark O'Byrne, a director at broker GoldCore in Dublin.

"Markets that are already shaken by the fallout from Brexit, the coming elections in Europe and indeed the increasing specter of cyber warfare could again see a safe-haven bid."

Gold for immediate delivery was up 8.9 per cent last year to US$1155 ($1675) an ounce, halting a three-year slide.

More than two thirds of the analysts and traders surveyed from Singapore to New York said they were bullish for 2017.

The median year-end forecast was US$1300, with the year's peak seen at US$1350. Two, including O'Byrne, said the metal may reach US$1600.

Demand for bullion would get a boost if elections in Europe see gains by anti-establishment parties, according to Commerzbank analysts led by Eugen Weinberg.

Increased protectionist policies and the potential for a trade war between Trump's administration and China may also help push gold higher, they said.

In a growing number of countries, "there are nationalistic tendencies, more isolationist tendencies," said Peter Marrone, the chief executive officer of Toronto-based Yamana Gold, which owns mines in Canada and South America.

"That will create geopolitical and socio-economic volatility, perhaps instability, certainly risk."

That doesn't mean there aren't reasons to be bearish.

After starting 2016 with the biggest first-half rally in four decades, prices fell from their peak in July and investors have cut back on bullion holdings.

That was mostly because an improving US economy and higher interest rates made other assets more attractive, including equities.

Four of the analysts in the Bloomberg survey predicted bullion would drop below US$1000 in 2017, particularly if the Federal Reserve raises interest rates three times next year and Trump makes good on his pledge to boost infrastructure spending to spur economic growth.

Holdings of the metal in exchange-traded funds - which had reached a three-year high in October - dropped for 33 straight days after the US election on November 8, the longest slide since 2004, data compiled by Bloomberg show.

Goldman Sachs analysts said in November that the bulk of new investments in gold-backed ETFs are losing money and that further selling in ETFs could exacerbate price declines.

Citigroup also cited downside risks from a potential selloff in gold ETFs, while Bank of America Merrill Lynch said the metal is in the doldrums as the economic policy outlined by Trump push rates higher.

Singapore-based Oversea-Chinese Banking Corp.'s Barnabas Gan, an economist whose prediction was the most accurate among gold forecasters tracked by Bloomberg in the third quarter, sees the metal falling to US$1100 by the end of 2017.

Still, signs of optimism remain. A poll by Bloomberg Intelligence on November 10 showed 42 per cent of respondents predict gold will be the best-performing metal in 2017.

Ronald Stoeferle, managing partner at Incrementum AG and the most-accurate among the precious-metals forecasters tracked by Bloomberg last quarter, said the metal will rally to US$1422 because the Fed may turn out to be more dovish than expected, which would mean an acceleration of inflation that boosts the appeal of gold.

"Gold is mania-prone, both on the upside and the downside," said Christopher Cruden, who oversees US$350 million as chief executive officer of Insch Capital Management in Lugano, Switzerland.

His gold fund was up 39 per cent last year.

"It's irrational, but that could be used to your advantage," Cruden said. "If you are on the right side of the irrationality, you can do well."