OPEN-SOURCE SCRIPT
Live Ratio Tracker & Alert

📊 Live Ratio Tracker & Alert (v6)
Overview
The Live Ratio Tracker & Alert is a powerful utility designed for pairs traders, macro analysts, and investors who monitor the relative strength between two assets. Whether you are tracking the Gold/Silver ratio, BTC/S&P500, or your favorite stock against its sector lead, this tool provides a real-time visual anchor and automated alerts.
Instead of switching back and forth between charts, this indicator calculates the ratio instantly and displays it as a dynamic label that follows the price action.
🚀 Key Features
Real-Time Ratio Calculation: Automatically fetches data from a secondary symbol (e.g., TVC:GOLD) and divides the current chart price by the secondary price.
Dynamic Visual Label: A clean, customizable label appears to the right of the latest candle, showing the live ratio and your set target.
Integrated Alert System: Get notified the moment a specific ratio level is crossed. Supports "Crossing," "Crossing Up," and "Crossing Down" logic.
Fully Customizable UI: Adjust colors, text size, and label offsets to match your chart theme.
Pine Script v6 Optimized: Built using the latest standards for better performance and reliability.
📖 How to Use
1. Setting Up the Comparison
Open the indicator settings.
In the Compare Against (Denominator) field, type the ticker you want to compare the current chart to (e.g., if you are on BTCUSD and want the BTC/GOLD ratio, enter TVC:GOLD).
Tooltip: Use the search icon to find the exact exchange ticker for the most accurate results.
2. Configuring Alerts
Alert Ratio Level: Enter the decimal value you are watching (e.g., 0.025).
Alert Type: Choose if you want to be notified only when the ratio breaks above, below, or moves in either direction.
Tooltip: After setting the level in the inputs, remember to create a standard TradingView alert and select this indicator as the condition.
3. Customizing the Display
Label Offset: Use this to move the label further to the right so it doesn't overlap with the price action.
Size & Colors: Switch between "Small" or "Huge" text depending on your screen resolution and personal preference.
💡 Pro Tips for Traders
Relative Strength: Use this to identify which asset is outperforming during a market rally.
Mean Reversion: If the ratio reaches a historical extreme (e.g., Gold/Silver ratio at 100+), use the alert to prepare for a potential reversal trade.
Overlay Mode: This indicator is set to overlay=true, meaning it stays on your main price chart for a clutter-free workspace.
Overview
The Live Ratio Tracker & Alert is a powerful utility designed for pairs traders, macro analysts, and investors who monitor the relative strength between two assets. Whether you are tracking the Gold/Silver ratio, BTC/S&P500, or your favorite stock against its sector lead, this tool provides a real-time visual anchor and automated alerts.
Instead of switching back and forth between charts, this indicator calculates the ratio instantly and displays it as a dynamic label that follows the price action.
🚀 Key Features
Real-Time Ratio Calculation: Automatically fetches data from a secondary symbol (e.g., TVC:GOLD) and divides the current chart price by the secondary price.
Dynamic Visual Label: A clean, customizable label appears to the right of the latest candle, showing the live ratio and your set target.
Integrated Alert System: Get notified the moment a specific ratio level is crossed. Supports "Crossing," "Crossing Up," and "Crossing Down" logic.
Fully Customizable UI: Adjust colors, text size, and label offsets to match your chart theme.
Pine Script v6 Optimized: Built using the latest standards for better performance and reliability.
📖 How to Use
1. Setting Up the Comparison
Open the indicator settings.
In the Compare Against (Denominator) field, type the ticker you want to compare the current chart to (e.g., if you are on BTCUSD and want the BTC/GOLD ratio, enter TVC:GOLD).
Tooltip: Use the search icon to find the exact exchange ticker for the most accurate results.
2. Configuring Alerts
Alert Ratio Level: Enter the decimal value you are watching (e.g., 0.025).
Alert Type: Choose if you want to be notified only when the ratio breaks above, below, or moves in either direction.
Tooltip: After setting the level in the inputs, remember to create a standard TradingView alert and select this indicator as the condition.
3. Customizing the Display
Label Offset: Use this to move the label further to the right so it doesn't overlap with the price action.
Size & Colors: Switch between "Small" or "Huge" text depending on your screen resolution and personal preference.
💡 Pro Tips for Traders
Relative Strength: Use this to identify which asset is outperforming during a market rally.
Mean Reversion: If the ratio reaches a historical extreme (e.g., Gold/Silver ratio at 100+), use the alert to prepare for a potential reversal trade.
Overlay Mode: This indicator is set to overlay=true, meaning it stays on your main price chart for a clutter-free workspace.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.