OPEN-SOURCE SCRIPT
Copper to Gold Ratio

ratio = copper / gold: Calculates the ratio by dividing copper price by gold price.
plot(ratio): Plots the ratio as a blue line.
ma = ta.sma(ratio, 20): Adds a 20-period simple moving average (optional) to smooth the ratio, plotted as a red line.
A rising Copper/Gold ratio often signals economic expansion (strong copper demand relative to gold), while a falling ratio may indicate economic uncertainty or recession fears, as gold outperforms copper.
The ratio is also used as a leading indicator for 10-year U.S. Treasury yields, with a rising ratio often correlating with higher yields.
plot(ratio): Plots the ratio as a blue line.
ma = ta.sma(ratio, 20): Adds a 20-period simple moving average (optional) to smooth the ratio, plotted as a red line.
A rising Copper/Gold ratio often signals economic expansion (strong copper demand relative to gold), while a falling ratio may indicate economic uncertainty or recession fears, as gold outperforms copper.
The ratio is also used as a leading indicator for 10-year U.S. Treasury yields, with a rising ratio often correlating with higher yields.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.