OPEN-SOURCE SCRIPT

Advanced Correlation Monitor

208
📊 Advanced Correlation Monitor - Pine Script v6
🎯 What does this indicator do?
Monitors real-time correlations between 13 different asset pairs and alerts you when historically strong correlations break, indicating potential trading opportunities or changes in market dynamics.

🚀 Key Features
✨ Multi-Market Monitoring

7 Forex Pairs (GBPUSD/DXY, EURUSD/GBPUSD, etc.)
6 Index/Stock Pairs (SPY/S&P500, DAX/NASDAQ, TSLA/NVDA, etc.)
Fully configurable - change any pair from inputs

📈 Dual Correlation Analysis

Long Period (90 bars): Identifies historically strong correlations
Short Period (6 bars): Detects recent breakdowns
Pearson Correlation using Pine Script v6 native functions

🎨 Intuitive Visualization

Real-time table with 6 information columns
Color coding: Green (correlated), Red (broken), Gray (normal)
Visual states: 🟢 OK, 🔴 BROKEN, ⚫ NORMAL

🚨 Smart Alert System

Only alerts previously correlated pairs (>80% historical)
Detects breakdowns when short correlation <80%
Consolidated alert with all affected pairs


🛠️ Flexible Configuration
Adjustable Parameters:

📅 Periods: Long (30-500), Short (2-50)
🎯 Threshold: 50%-99% (default 80%)
🎨 Table: Configurable position and size
📊 Symbols: All pairs are configurable

Default Pairs:
FOREX: INDICES/STOCKS:
- GBPUSD vs DXY • SPY vs S&P500
- EURUSD vs GBPUSD • DAX vs S&P500
- EURUSD vs DXY • DAX vs NASDAQ
- USDCHF vs DXY • TSLA vs NVDA
- GBPUSD vs USDCHF • MSFT vs NVDA
- EURUSD vs USDCHF • AAPL vs NVDA
- EURUSD vs EURCAD

💡 Practical Use Cases
🔄 Pairs Trading
Detects when strong correlations break for:

Statistical arbitrage
Mean reversion trading
Divergence opportunities

🛡️ Risk Management
Identifies when "safe" assets start moving independently:

Portfolio diversification
Smart hedging
Regime change detection

📊 Market Analysis
Understand underlying market structure:

Forex/DXY correlations
Tech sector rotation
Regional market disconnection


🎓 Results Interpretation
Reading Example:
EURUSD vs DXY: -98.57% → -98.27% | 🟢 OK
└─ Perfect negative correlation maintained (EUR rises when DXY falls)

TSLA vs NVDA: 78.12% → 0% | ⚫ NORMAL
└─ Lost tech correlation (divergence opportunity)
Trading Signals:

🟢 → 🔴: Broken correlation = Possible opportunity
Large difference: Indicates correlation tension
Multiple breaks: Market regime change

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。