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

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.