OPEN-SOURCE SCRIPT

Live Ratio Tracker & Alert

87
📊 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.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。