OPEN-SOURCE SCRIPT
Ratio Between Two Symbols

This indicator calculates and displays the price ratio between two symbols, allowing you to compare relative performance and strength.
The chart shows the current symbol divided by a benchmark symbol (default: S&P 500), with an optional multiplier to scale the ratio for easier visualization. A moving average (default 20-period SMA) smooths the ratio to identify trends in relative performance.
When the ratio is rising, the current symbol is outperforming the benchmark. When falling, it's underperforming. The moving average helps identify the overall trend direction and potential reversals in relative strength.
Features:
- Compare any two symbols in real-time
- Adjustable moving average period
- Customizable ratio multiplier for scaling
- Optional label showing current ratio value
- Adjustable decimal precision
Useful for:
- Relative strength analysis
- Pair trading opportunities
- Sector/stock rotation strategies
- Comparing asset class performance
The chart shows the current symbol divided by a benchmark symbol (default: S&P 500), with an optional multiplier to scale the ratio for easier visualization. A moving average (default 20-period SMA) smooths the ratio to identify trends in relative performance.
When the ratio is rising, the current symbol is outperforming the benchmark. When falling, it's underperforming. The moving average helps identify the overall trend direction and potential reversals in relative strength.
Features:
- Compare any two symbols in real-time
- Adjustable moving average period
- Customizable ratio multiplier for scaling
- Optional label showing current ratio value
- Adjustable decimal precision
Useful for:
- Relative strength analysis
- Pair trading opportunities
- Sector/stock rotation strategies
- Comparing asset class performance
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。