OPEN-SOURCE SCRIPT

Prismatic Trend Matrix [JOAT]

793
Prismatic Trend Matrix [JOAT]

Introduction

The Prismatic Trend Matrix is an advanced open-source multi-dimensional trend analysis system that combines Hull Moving Average, SuperTrend, ADX strength filtering, and moving average confluence into a unified trend detection engine. This indicator analyzes trend across multiple dimensions simultaneously, creating a prismatic view of market direction with gradient visualization that reveals trend strength and conviction.

Unlike single-indicator trend systems, the Prismatic Trend Matrix provides multi-layered trend intelligence through Hull MA smoothing, SuperTrend band analysis, ADX strength measurement, and EMA/SMA alignment detection. The indicator is designed for traders who understand that strong trends require confirmation across multiple analytical dimensions.

スナップショット

Why This Indicator Exists

This indicator addresses the need for comprehensive trend analysis that goes beyond simple moving averages. By combining four distinct trend methodologies with gradient visualization, it reveals:

  • Hull Moving Average: Weighted moving average with reduced lag for responsive trend detection
  • SuperTrend Component: ATR-based bands that identify trend direction and support/resistance
  • ADX Strength Filter: Measures trend strength to separate strong trends from weak/choppy conditions
  • Moving Average Matrix: Three EMAs and two SMAs create alignment-based trend confirmation
  • Trend Classification: Five-state system (Strong Bull, Weak Bull, Sideways, Weak Bear, Strong Bear)
  • Counter-Trend Detection: Identifies potential reversals when price moves against established trend
  • Prismatic Gradient: Visual fill between Hull MA and SuperTrend shows trend intensity


Core Components Explained

1. Hull Moving Average (HMA)

The Hull MA uses weighted moving averages to create a smooth trend line with minimal lag:

The calculation involves three steps:
  • Step 1: Calculate WMA of half-length period
  • Step 2: Calculate WMA of full-length period
  • Step 3: Calculate WMA of the difference using square root of length


The result is a moving average that responds quickly to price changes while maintaining smoothness. The indicator applies additional EMA smoothing (default 3 periods) to reduce noise.

2. SuperTrend Calculation

SuperTrend uses ATR-based bands to identify trend direction:

  • Source: Average of high and low (HL2)
  • Upper Band: Source + (ATR × Factor)
  • Lower Band: Source - (ATR × Factor)
  • Direction: Bullish when close > upper band, bearish when close < lower band


Three modes control band adjustment:
  • Strict Mode: Bands adjust only when price crosses or previous band is breached
  • Quick Mode: Bands adjust when price crosses previous band
  • Quicker Mode: Bands adjust immediately with price


SuperTrend provides dynamic support/resistance levels that adapt to volatility.

3. ADX Strength Measurement

The Average Directional Index measures trend strength:

  • DI+ (Directional Indicator Plus): Measures upward directional movement
  • DI- (Directional Indicator Minus): Measures downward directional movement
  • ADX: Smoothed average of the difference between DI+ and DI-, normalized
  • Threshold: ADX above threshold (default 25) indicates strong trend
  • Rising ADX: Indicates strengthening trend momentum


ADX filters out weak trends and choppy conditions, ensuring signals occur only during strong directional movement.

4. Moving Average Matrix

Five moving averages create a trend alignment system:

  • Fast EMA (9): Short-term trend direction
  • Medium EMA (21): Intermediate trend direction
  • Slow EMA (50): Primary trend direction
  • Fast SMA (50): Smoothed primary trend
  • Slow SMA (200): Long-term institutional trend


Alignment is measured by comparing the order of these averages:
  • Bullish Alignment: EMA9 > EMA21 > EMA50 > SMA50 (all in ascending order)
  • Bearish Alignment: EMA9 < EMA21 < EMA50 < SMA50 (all in descending order)
  • Mixed Alignment: Averages not in order (choppy or transitional conditions)


Perfect alignment indicates strong institutional conviction in the trend direction.

5. Composite Trend Classification[/b>

The indicator combines all components into a five-state trend classification:

  • Strong Bull (State 2): Hull rising + SuperTrend bullish + MA alignment bullish + ADX strong
  • Weak Bull (State 1): Hull rising + (SuperTrend bullish OR MA alignment bullish)
  • Sideways (State 0): Mixed signals or weak trend conditions
  • Weak Bear (State -1): Hull falling + (SuperTrend bearish OR MA alignment bearish)
  • Strong Bear (State -2): Hull falling + SuperTrend bearish + MA alignment bearish + ADX strong


This classification provides clear trend assessment at a glance.

6. Counter-Trend Detection[/b>

The indicator identifies potential reversals when price moves against established trend:

  • Counter-Trend Bull: Trend state neutral/bearish + close > open + price rising + DI+ > DI- + close > Hull + ADX > 20
  • Counter-Trend Bear: Trend state neutral/bullish + close < open + price falling + DI- > DI+ + close < Hull + ADX > 20


Counter-trend signals include anti-overlap logic to prevent signal clustering and ensure clean placement.

7. Prismatic Gradient Visualization

The indicator creates a gradient fill between Hull MA and SuperTrend:

  • Gradient Layers: Multiple intermediate values calculated between Hull and SuperTrend (default 15 layers)
  • Color Intensity: Transparency increases from Hull (solid) to SuperTrend (transparent)
  • Dynamic Coloring: Gradient color matches trend state (green = bullish, red = bearish, cyan = sideways)
  • Visual Effect: Creates a glowing prismatic effect that emphasizes trend strength


The gradient provides intuitive visual feedback on trend intensity and direction.

8. Platform Levels

Platform levels are horizontal lines at the current Hull MA value:

  • Extension: Lines extend forward and backward from current bar (default 7 bars each direction)
  • Color Coding: Platform color matches current trend state
  • Purpose: Provides visual reference for potential support/resistance at Hull MA level


Platforms help identify key levels where price may find support or resistance.

Visual Elements

  • Hull Trend Line: Thick line (3px) with regime-based coloring showing primary trend
  • SuperTrend Line: Medium line (2px) with step-line style showing dynamic support/resistance
  • EMA Matrix: Three thin lines showing fast, medium, and slow EMAs with transparency
  • Prismatic Gradient: Multi-layer fill between Hull and SuperTrend creating glow effect
  • Platform Levels: Horizontal lines at Hull MA value extending forward/backward
  • Counter-Trend Signals: Triangles marking potential reversal points
  • Background Coloring: Subtle background tint for strong bull/bear states
  • Information Dashboard: Displays trend state, Hull direction, ADX strength, momentum, alignment, SuperTrend, DI balance, price vs Hull, gradient zone, counter-trend status, and signal


スナップショット

How to Use This Indicator

Step 1: Check Trend State
Monitor the dashboard for current trend state (Strong Bull, Weak Bull, Sideways, Weak Bear, Strong Bear). Trade in the direction of strong states.

Step 2: Verify ADX Strength
Ensure ADX is above threshold (default 25) for strong trends. Low ADX indicates choppy conditions - avoid trend-following strategies.

Step 3: Confirm MA Alignment
Check if moving averages are aligned (Bullish/Bearish/Mixed). Perfect alignment confirms institutional conviction.

Step 4: Monitor Hull Direction
Hull rising = bullish bias, Hull falling = bearish bias. Hull provides the primary trend direction signal.

Step 5: Use SuperTrend for Support/Resistance
SuperTrend line acts as dynamic support in uptrends and resistance in downtrends. Breaks of SuperTrend warn of trend changes.

Step 6: Watch for Counter-Trend Signals
Counter-trend signals at extreme levels may indicate reversals. Use these cautiously and confirm with other factors.

Step 7: Assess Gradient Zone
Price in upper gradient zone (near Hull) = strong trend, price in lower zone (near SuperTrend) = weak trend or potential reversal.

Best Practices

  • Trade only in Strong Bull or Strong Bear states for highest probability
  • Avoid trading in Sideways state - wait for clear trend establishment
  • Use ADX as a filter - only trade when ADX > 25 for strong trends
  • Confirm trend with MA alignment before entering positions
  • Use SuperTrend as trailing stop level in trending markets
  • Counter-trend signals work best at extreme levels with divergence
  • Monitor gradient zone - price near SuperTrend may indicate trend exhaustion
  • Combine with higher timeframe trend for additional confirmation


Input Parameters

Hull Trend Engine:
  • Hull Length: Period for Hull MA calculation (default: 20)
  • Hull Smoothing: Additional EMA smoothing (default: 3)


SuperTrend Layer:
  • ATR Period: Period for ATR calculation (default: 10)
  • ATR Factor: Multiplier for band width (default: 3.0)
  • Mode: Strict, Quick, or Quicker (default: Quick)


Trend Strength:
  • ADX Length: Period for ADX calculation (default: 14)
  • ADX Smoothing: Smoothing period for ADX (default: 14)
  • Strength Threshold: Minimum ADX for strong trend (default: 25)


MA Matrix:
  • Fast EMA: Short-term EMA (default: 9)
  • Medium EMA: Intermediate EMA (default: 21)
  • Slow EMA: Primary EMA (default: 50)
  • Fast SMA: Smoothed primary (default: 50)
  • Slow SMA: Long-term institutional (default: 200)


Visual Configuration:
  • Bullish/Bearish Trend Colors: Customizable colors for trend states
  • Sideways/Weak Trend Colors: Colors for neutral and weak states
  • Gradient Layers: Number of gradient fills (default: 15)
  • Show Platforms: Toggle platform level display (default: enabled)
  • Platform Extension: Bars to extend platforms (default: 7)


Originality Statement

This indicator is original in its multi-dimensional trend approach. While individual components (Hull MA, SuperTrend, ADX, EMAs) are established concepts, this indicator is justified because:

  • It combines four distinct trend methodologies into a unified classification system
  • The five-state trend classification provides clear trend assessment
  • Prismatic gradient visualization creates intuitive trend intensity display
  • Counter-trend detection with anti-overlap logic identifies potential reversals
  • MA alignment analysis measures institutional conviction
  • Integration of Hull MA smoothness with SuperTrend adaptability creates balanced trend detection
  • The comprehensive dashboard presents all trend dimensions simultaneously


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Trend analysis does not guarantee profitable trades. Past trends do not guarantee future trends. Always use proper risk management and never risk more than you can afford to lose.

-Made with passion by officialjackofalltrades

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。