PROTECTED SOURCE SCRIPT
Telah dikemas kini

Relative Strength Matrix [PUCHON]

49
📊 Relative Strength Matrix [PUCHON]

The Relative Strength Matrix provides a comprehensive view of how the current asset performs against a basket of other financial instruments (such as Indices, Commodities, or Currencies). By comparing price changes over two distinct timeframes (Short-Term and Long-Term), traders can quickly identify whether the asset is showing relative strength or weakness compared to the broader market or specific sectors.

✨ Features:

- 🌍 Multi-Asset Comparison: Monitor relative performance against up to 7 customizable symbols simultaneously.
- ⏳ Dual Timeframe: Analyze trends using both Short-Term (default 20) and Long-Term (default 60) lookback periods.
- 🎨 Visual Heatmap: Displays relative strength with intuitive colors:
- 🟢 Green (+): Stronger (outperforming)
- 🔴 Red (-): Weaker (underperforming)
- ⚪ Gray: Neutral
- ⚙️ Fully Customizable: Adjust symbols, colors, table position, and text size to fit your trading setup.

🧮 Calculation Logic:

The core of this indicator is the rsCalc function. It normalizes the price changes of both the base asset (current chart) and the comparison asset over a specific length, then calculates the ratio.

Pine Script®
rsCalc(series float base, series float comp, int len) => nb = base / base[len] // Normalized Base Asset Price dc = comp / comp[len] // Normalized Comparison Asset Price na(nb) or na(dc) ? na : nb / dc - 1 // Relative Performance Ratio


💡 Interpretation:

- 📈 Positive Value (> 0): The current asset has appreciated more (or depreciated less) than the comparison asset. This signifies Relative Strength.
- 📉 Negative Value (< 0): The current asset has appreciated less (or depreciated more) than the comparison asset. This signifies Relative Weakness.
- ⚖️ Zero (0): Both assets have performed equally over the period.
Nota Keluaran
Removed: display version

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.