The idea of a Donald Trump presidency might make the stock market nervous, but not gold bugs.

That's because gold prices stand to gain a lot. It has been moving almost lockstep with Trump's political prospects. Last week, gold rallied as his chances of winning the White House seemed to rise. Then gold plunged 2% on Monday after the FBI cleared Hillary Clinton once again in the investigation into her handling of classified emails.

In other words, gold tends to rise when Trump's poll numbers go up. And it's got nothing to do with the billionaire's affinity for gold in his penthouses, or his hotels and casinos.

Actually, it's long been the safe asset to turn to during times of financial stress. And many investors fear a Trump presidency because of his unpredictable nature and the effect he could have on the global economy.

Trump has been a staunch critic of global trade deals. It's one of the reasons why Citigroup warned that U.S. stocks could plunge 3% to 5% immediately following a Trump victory, and Deutsche Bank says European markets could plummet 10%.

Related: Dow soars 300 points after FBI clears Clinton again

PredictIt, a political betting platform, ran the numbers and found a very strong correlation of 0.81 between Trump's odds of winning and gold prices over the past 60 days. (The closer a correlation is to 1, the tighter the relationship.)

All of this explains why investment bank Societe Generale believes gold prices could enjoy a "knee-jerk rally" to $1,400 an ounce if Trump wins.

"Even higher, is entirely possible," Robin Bhar, head of metals research at SocGen, wrote in a recent report.

Bhar argues that if Trump wins, gold prices would continue to rally, ending the year between $1,450 and $1,500 an ounce.

He pointed to the fact that "Candidate Trump is a wildcard" and the "high possibility of radical change" brought about by a Trump victory. Bhar also cited Trump's promises to ramp up government spending as well as protectionist and isolationist policies that could increase political uncertainty in "global hotspots" like Eastern Europe and Southeast Asia.

Bespoke Investment Group too says that gold would serve as a safe haven if Trump pulls off a win. Gold prices "should surge if Trump wins," Bespoke wrote in a recent report, because a "Trump presidency strikes fear in a large percentage of investors."

Sign up for CNNMoney's morning market newsletter: Before The Bell

Election Day could have an even more pronounced impact on gold miners, which tend to be very sensitive to prices for the yellow metal. Last week, gold miner Newmont Mining (NEM) zoomed 7% higher on Clinton's slumping poll numbers. On Monday, Newmont stock dropped 5% as gold prices reversed course on the latest FBI developments.

Of course, all of this suggests gold could be in trouble late Tuesday or early Wednesday if Trump is deemed the loser.

That's why Helima Croft, RBC Capital's head of commodity strategy, warned in a recent note that gold's recent rise is on "fragile footing."