OPEN-SOURCE SCRIPT
Growth Comparison (Gold, Silver, Copper, Platinum & Crypto)

Data Sources
The symbols configured this time point to globally trusted data sources (providers).
・OANDA (XAUUSD, XAGUSD, XCUUSD, XPTUSD):
Data from OANDA, one of the world's largest FX and commodity providers. It reflects the “spot prices” for gold, silver, copper, and platinum in near real-time.
・BINANCE (BTCUSDT, ETHUSDT, XRPUSDT):
Data from Binance, the world's largest cryptocurrency exchange. It has the highest trading volume and is used as the global standard price indicator. Retrieves BTC, ETH, and XRP.
How the Script Works (Technical Explanation)
・Fixed Starting Price:
The script internally stores the price on the set “comparison start date” (e.g., January 1, 2025).
・Real-Time Calculation:
It constantly retrieves the latest current price and continuously calculates the percentage using the following formula.
Formula: (Current Price - January 1, 2025 Price) ÷ January 1, 2025 Price × 100
*Since January 1 is a global market holiday (New Year's Day) with no prices available, the script automatically adopts the next market opening price (e.g., January 2 morning's open price) as the baseline.
・Automatic label tracking:
The program displays labels like “GOLD” at the right edge of the graph. This ensures you never lose track of which line corresponds to which asset, even when lines overlap.
Translated with DeepL.com (free version)
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.