This is the chart of SPX/GOLD, and you can see there are times when SPX outperforms GOLD, like the era that began from September 2011 until now, and there are times when GOLD outperforms SPX, like from the beginning of September 2000 until September 2011.
In the time that SPX outperforms, we know that there are usually lower interest rates, higher economic growth, and, as a result, we are in a growth cycle. However, when GOLD starts to outperform, that's a time when there are higher risks in the economic world with lower optimism about future economic conditions.
In these kinds of times, which sometimes also align with recessions, we can see investors are more keen on having gold in their assets as a safe haven to protect themselves against risks in the financial world.
Now, if we look at the chart, we see that the price is actually very close to a resistance which could eventually cause this ratio to turn toward lower prices, resulting in an era with higher GOLD prices and lower economic growth.