Gold just hit another record high. Why Wall Street says it still has room to run.

Gold ( GC=F ) prices hit a record high this week as the precious metal's year-to-date gains top 25%.

And Wall Street analysts believe gold prices still have room to run as investors seek safety amid rising concerns about a recession and an ongoing trade war.

"An adequate allocation of gold has proven a helpful cushion against uncertainty over trade," said UBS Global Wealth Management chief investment officer Mark Haefele on Thursday.

"Despite this strong run, we believe gold can advance further, and our base case is that the price will reach USD 3,500 an ounce this year."

Gold settled at $3,341 an ounce on Thursday ahead of the holiday weekend.

Over the past year, gold prices have surged 40% as central bank demand reached all-time highs and investors poured into physical-backed gold exchange-traded funds (ETFs). A weakening dollar ( DX-Y.NYB ) has also bolstered demand for gold.

The rally in gold has also been persistent, offering only a few pullbacks for investors waiting to pile in at lower prices.

A 5% drop earlier this month was largely driven by margin call liquidations after President Trump revealed his tariff plan on April 2 and equities sold off, Goldman Sachs analysts argued in a Thursday note. This sell-off was quickly bought, and prices recovered to record levels.

Read more: How to invest in gold in 4 steps

Lina Thomas and her team at Goldman Sachs still view gold as being at an attractive entry point, calling the rally "structurally supported and less exposed to sharp near-term liquidation risk."

The firm noted the sharpest upward price moves this month were driven by Asian official sector buyers, like the People's Bank of China.

"Thus, we see current levels as a tactically attractive entry point — despite the recent move — and believe this reinforces upside risk to our $3,700/toz [per troy ounce] year-end forecast."

If a recession occurs, the analysts predict ETF inflows could accelerate further, lifting gold prices to $3,880 per troy ounce by year-end.

Still, the recent equity drop is giving pause to some market watchers who say retail investors may want to wait to buy the precious metal.

"If we are in the early stages of what could be multiple pulses of margin calls, given the volatility that we are seeing in stocks, it is only a matter of time before gold becomes the source of liquidity to cover those margin calls," Michael Gayed, Lead-Lag Report publisher told Yahoo Finance Live on Thursday.

"I don't believe gold has entered a bear market, but if you're going to be tactical in your time, you might want to wait."

OK