OPEN-SOURCE SCRIPT

Trend Strength Matrix [JOAT]

103

Trend Strength Matrix — Multi-Timeframe Trend Health Dashboard

Trend Strength Matrix provides a comprehensive view of trend health across multiple timeframes and indicators. It combines RSI, MACD, ADX, and moving average alignment into a single heatmap-style dashboard with an overall strength score—giving you a complete picture of trend quality at a glance.

What Makes This Indicator Unique

Unlike single-indicator trend tools, Trend Strength Matrix:
  • Analyzes four different indicators simultaneously (RSI, MACD, ADX, MA)
  • Evaluates up to four timeframes at once for multi-timeframe confluence
  • Presents everything in an intuitive color-coded heatmap
  • Calculates a weighted composite score for overall trend assessment
  • Marks trend shifts directly on the chart


What This Indicator Does

  • Calculates trend scores from four different indicators
  • Analyzes up to four timeframes simultaneously
  • Creates a color-coded heatmap showing strength across all components
  • Generates a weighted composite score for overall trend assessment
  • Marks bullish and bearish trend shifts on the chart
  • Displays a trend-following moving average on the price chart


Component Scores Explained

Each indicator contributes a normalized score from -1 (strongly bearish) to +1 (strongly bullish):

  • RSI Score — (RSI - 50) / 50
    - RSI of 70 = +0.4 (bullish)
    - RSI of 30 = -0.4 (bearish)
    - RSI of 50 = 0 (neutral)

  • MACD Score — MACD line normalized by its standard deviation
    - Positive MACD = positive score
    - Negative MACD = negative score
    - Magnitude reflects strength

  • ADX Score — ADX strength multiplied by DI direction
    - High ADX with DI+ > DI- = strong positive
    - High ADX with DI- > DI+ = strong negative
    - Low ADX = weak score regardless of direction

  • MA Score — Price position relative to moving average
    - Price above MA = positive
    - Price below MA = negative
    - Distance from MA affects magnitude


Multi-Timeframe Analysis

The indicator analyzes multiple timeframes with weighted importance:

Pine Script®
// Weighted MTF composite score mtfScore = composite1 * 0.40 + // Current TF (40% weight) composite2 * 0.25 + // TF2, e.g., 1H (25% weight) composite3 * 0.20 + // TF3, e.g., 4H (20% weight) composite4 * 0.15 // TF4, e.g., Daily (15% weight)


Higher timeframes provide context and trend direction, while lower timeframes provide timing and entry signals.

Dashboard Layout

The matrix displays a grid with:
  • Rows — Each timeframe (current, TF2, TF3, TF4)
  • Columns — Each indicator (RSI, MACD, ADX, MA, Score)
  • Cell Colors:
    - Bright green: Score > 0.5 (strongly bullish)
    - Faded green: Score 0.2 to 0.5 (moderately bullish)
    - Gray: Score -0.2 to 0.2 (neutral)
    - Faded red: Score -0.5 to -0.2 (moderately bearish)
    - Bright red: Score < -0.5 (strongly bearish)
  • Overall Row — Shows weighted composite with trend classification


Trend Classifications

Based on the overall MTF score:
  • STRONG BULL — Score > 50%
  • BULLISH — Score 20% to 50%
  • NEUTRAL — Score -20% to 20%
  • BEARISH — Score -50% to -20%
  • STRONG BEAR — Score < -50%


Visual Features

  • Trend Moving Average — Optional MA line on price chart colored by trend direction
  • Trend Background — Subtle background tint showing overall trend direction
  • Trend Shift Labels — "BULL" and "BEAR" labels when trend direction changes
  • Heatmap Dashboard — Color-coded matrix showing all components and timeframes


Color Scheme

  • Bullish Color — Default: #00E676 (bright green)
  • Bearish Color — Default: #FF5252 (red)
  • Neutral Color — Default: #9E9E9E (gray)
  • Dashboard Header — #2962FF (blue)


Inputs Overview

Calculation Settings:
  • RSI Length — Period for RSI (default: 14, range: 5-30)
  • MACD Fast — Fast EMA period (default: 12, range: 5-30)
  • MACD Slow — Slow EMA period (default: 26, range: 10-50)
  • MACD Signal — Signal line period (default: 9, range: 3-20)
  • ADX Length — Period for ADX/DI (default: 14, range: 5-30)
  • MA Length — Period for trend MA (default: 50, range: 20-200)


Multi-Timeframe:
  • Enable Multi-Timeframe — Toggle MTF analysis (default: on)
  • Timeframe 2 — Second timeframe (default: 60 = 1 hour)
  • Timeframe 3 — Third timeframe (default: 240 = 4 hours)
  • Timeframe 4 — Fourth timeframe (default: D = Daily)


Visual Settings:
  • Bullish/Bearish/Neutral Colors — Customizable color scheme
  • Show Trend MA — Toggle moving average on price chart
  • Show Dashboard — Toggle the heatmap matrix
  • Dashboard Position — Choose corner placement (Top Right, Top Left, Bottom Right, Bottom Left)


How to Use It

For Trend Confirmation:
  • All green cells = strong bullish alignment across indicators and timeframes
  • All red cells = strong bearish alignment
  • Mixed colors = consolidation or transition period
  • Wait for alignment before entering trend trades


For Multi-Timeframe Analysis:
  • Higher timeframes (TF3, TF4) show the "big picture" trend
  • Lower timeframes (current, TF2) show immediate momentum
  • Best signals occur when all timeframes align
  • Divergence between timeframes suggests caution


For Entry Timing:
  • Enter when trend shifts from neutral to bullish/bearish
  • Look for "BULL" or "BEAR" labels on chart
  • Confirm with dashboard showing alignment
  • Use the trend MA as a trailing stop reference


Alerts Available

  • TSM Bullish Shift — Trend shifted from neutral/bearish to bullish
  • TSM Bearish Shift — Trend shifted from neutral/bullish to bearish
  • TSM Strong Bull — Score crossed above 50% (strong bullish)
  • TSM Strong Bear — Score crossed below -50% (strong bearish)


Best Practices

  • Wait for multiple timeframes to align before entering
  • Strong trends show green (or red) across all cells
  • Mixed colors suggest waiting for clarity
  • Use the overall score percentage to gauge conviction


— Made with passion by officialjackofalltrades

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.