PROTECTED SOURCE SCRIPT
Atualizado

Relative Strength Matrix [PUCHON]

47
📊 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.
Notas de Lançamento
Removed: display version

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.