Gold prices dived on Tuesday as the dollar clung to recent gains, while expectations of a U.S. stimulus deal boosted risk appetite and prompted investors to take profits from bullion's run to a record high.

Spot gold plunged 4.2% to $1,941.71 per ounce by 1311 GMT, retreating from last week's record of $2,072.50. U.S. gold futures dropped 3.5% to $1,969.20 per ounce.

"The retreat was inevitable," said StoneX analyst Rhona O'Connell, adding that gold has been technically overbought for a while.

That gold did not advance further despite rising geopolitical tensions showed many supportive elements for gold have already been priced in, she added.

Adding to gold's headwinds, global equities hit multi-month highs on expectations U.S. Congress will agree a massive stimulus deal while looming trade talks raised hopes of an easing in tensions between the United States and China.  

Also weighing on gold, U.S. producer prices rebounded more than expected in July.

The dollar, too, retained recent gains, making gold less attractive for investors holding other currencies. 

There is a battle now, because from a technical perspective, short-term traders are looking at which retracement levels can come into play after the breakout to record levels, said Saxo Bank analyst Ole Hansen.

Most analysts still expect a positive trajectory for gold, with the metal having gained nearly 30% this year as unprecedented money-printing by central banks and near-zero interest rates pushed investors into bullion as a hedge against possible currency debasement and inflation.

The recent "washout of speculative long positioning sets gold up for a more balanced rally going forward", said Jeffrey Halley, a senior market analyst at OANDA.

Among other precious metals, silver plunged 7.8% to $26.88 per ounce, platinum XPT= dropped 4.8% to $939.19 per ounce and palladium 5.4% to $2,099.47 per ounce.

(Reporting by Nakul Iyer and Brijesh Patel in Bengaluru; Additional reporting by K. Sathya Narayanan and Arpan Varghese; Editing by David Goodman and Barbara Lewis) ((; Within U.S. +1 646 223 8780, Outside U.S. +91 80 6749 0417; Reuters Messaging: