I was taught that gold is basically a non-fiat money. But the only way it increases in value is via supply and demand, like any resource. The difference with stocks is that wealth is created through profits via labour and markets. This makes each perform quite differently given the situation. See this summary below, outlined by gold advising company:
Why Gold?1929 Stock Market Crash a Buy Gold/Sell Stocks
The DJIA lost almost 90% of its value from its 1929 peak until its 1932 low and the Great Depression followed. During that time, gold rose in price by 69% (from $20.67 to $35.00)! As a result, by 1932, it took as little as 1.99 ounces of gold to buy the Dow compared to a stock market peak of over 12 ounces.
1969 Bull Market Peak a Buy Gold/Sell Stocks
Stocks not only declined significantly but also remained in a bear market for thirteen years until the existing bull market began in 1982! Meanwhile, gold rose in price by 2,382% (from $35.00 to $850.00 in January 1980)! At the Dow peak, it took 22.75 ounces of gold to buy the Dow. However, by January 1980, it took 0.89 oz of gold to buy the Dow!
2000 Stock Market Bubble a Buy Gold/Sell Stocks
History always repeats itself, though never exactly in the same way. Although the Dow is off from its highs, it remains extremely high relative to its historical PE ratio but also in relation to gold. At the end of 2003, despite a significant rise in the price of gold, more than 25 ounces of gold were still required to buy the Dow. That's down from its absurd high of nearly 40 ounces at the end of 2000, but still near its high at the time of the 1966 stock market peak, and much higher than in 1929 before the stock market crash.
Applying the broad based S&P 500 stocks also remain hugely overvalued. As of December 29, 2003, the S&P 500 PE ratio stood at 3.52 times compared to 10-year U.S. Treasury yields of 4.15%. Although 2003 was a strong year for U.S. stocks, we believe it will prove to have been nothing more than a very serious bear market rally in what we continue to believe will be the most serious stock market debacle since the 1930s.
Basically, gold is good for short-term strategies in bear markets. Stocks are good for the long haul (some would argue only on long cycles, not indefinitely). In some ways, gold is a good alternative to cash in times of tumbling stocks, since the value of gold doesn't act in the same way as currencies.
If you have other evidence, I would like to see it. I tend to have trouble finding straightforward long-term data online for this kind of thing.