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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.