OPEN-SOURCE SCRIPT

Gold/Silver Ratio

540
Overview
This indicator displays the Gold/Silver Ratio by dividing the price of gold (XAUUSD) by the price of silver (XAGUSD) on the same timeframe. It is a widely used tool in macroeconomic and precious metals analysis, helping traders and investors evaluate the relative value of gold compared to silver.

📈 What it does
Plots the ratio between gold and silver prices as a line on the chart.
Displays two key horizontal levels:
Overbought level at 90 (dashed red line).
Oversold level at 70 (dashed green line).
Highlights the chart background to show extreme conditions:
Red shading when the ratio exceeds 90 (gold is likely overvalued relative to silver).
Green shading when the ratio drops below 70 (silver is likely overvalued relative to gold).
🧠 How to Use
When the ratio exceeds 90, it suggests that gold may be overbought or silver may be undervalued. Historically, these have been good times to consider shifting exposure from gold to silver.
When the ratio falls below 70, it may indicate silver is overbought or gold is undervalued.
This tool is best used in conjunction with technical analysis, macroeconomic trends, or RSI/Bollinger Bands applied to the ratio.
⚙️ Inputs
This version of the script uses OANDA's XAUUSD and XAGUSD pairs for spot gold and silver prices. You may edit the request.security() calls to change data sources (e.g., FXCM, FOREXCOM, or CFD tickers from your broker).

✅ Best For:
Macro traders
Commodity investors
Ratio and spread traders
Long-term portfolio reallocators

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.