OPEN-SOURCE SCRIPT
Kinetic Hull Matrix [JOAT]

Kinetic Hull Matrix [JOAT]
Overview
Kinetic Hull Matrix is an adaptive trend-following indicator centred on a Hull Moving Average cloud with ATR-proportional envelopes, a custom ADX engine, a 0–100 composite signal scoring system, and a multi-timeframe trend table — all rendered in a layered fill system that visually communicates trend strength and cloud penetration depth simultaneously. Retest signals fire when price touches the cloud boundary from within the trending direction, scored by four independent quality factors.

The Hull Moving Average — Why It Matters
The Hull Moving Average (HMA) was designed to reduce lag while maintaining smoothness. The calculation uses weighted moving averages at half-length and full-length, doubles the half-length result, subtracts the full-length result (creating a de-lagged series), then applies a final WMA at the square root of the length:
WMA(2 * WMA(src, n/2) - WMA(src, n), sqrt(n))
This produces a moving average that reacts significantly faster to price changes than a standard EMA or SMA of the same length, while filtering micro-noise through the final WMA pass. The result is a responsive midline that rarely produces whipsaws in trending markets.
ATR-Adaptive Cloud Architecture
The HMA midline is expanded into a four-layer cloud using the current ATR:
- Inner cloud (upper and lower bands): HullMid ± ATR × CloudMultiplier (default 1.0). This is the primary retest detection zone.
- Outer bands: HullMid ± ATR × CloudMultiplier × OuterMultiplier (default 1.618, the golden ratio). These define the statistical extreme of the cloud envelope.
The cloud dynamically widens during volatile markets and contracts during compression — naturally adapting to market conditions without manual parameter changes.
Four fill layers are rendered between the bands using trend-coloured gradients: bright teal in uptrends, muted red in downtrends, creating an intuitive visual heat map of trend energy.
Custom ADX Engine
Rather than relying on the built-in ta.dmi(), Kinetic Hull Matrix implements its own ADX from first principles:
1. Positive directional movement (plusDM) = max(high - high[1], 0) when high-to-high exceeds low-to-low
2. Negative directional movement (minusDM) = max(low[1] - low, 0) when low-to-low exceeds high-to-high
3. Both are smoothed via ta.rma() over the ADX length, then divided by the RMA of true range to produce +DI and -DI
4. The directional index DX = abs(+DI - -DI) / (+DI + -DI) * 100, finally smoothed via ta.rma() to produce ADX
This gives a transparent, auditable ADX implementation. Values above 25 indicate a trending regime; below 25 indicates ranging conditions. The dashboard and scoring system both use this value.
Composite Signal Score (0–100)
A retest signal qualifies only when close price enters the inner cloud (touches upper cloud from above in a downtrend or lower cloud from below in an uptrend) while the candle closes back in the trend direction. The resulting signal is then scored:
- Proximity score (up to 50): How deeply price penetrated into the cloud. Deeper retests score higher.
- Volume score (up to 25): Current volume relative to its 20-bar SMA. Higher participation scores higher.
- RSI score (up to 15): RSI directional headroom — long signals score better when RSI has room below 55, short signals when RSI has room above 45.
- ADX score (up to 10): Raw ADX value × 0.4, capped at 10. Strong trends produce higher-quality retests.
Only signals meeting the configurable minimum score threshold (default 40) are displayed.
S/R Line Stamping
Each confirmed retest signal stamps a horizontal dotted line at the close price, extending 60 bars forward. These lines serve as dynamic support (for bull retests) and resistance (for bear retests). Lines are automatically invalidated and deleted if price closes through them by more than 0.5 ATR — the indicator only keeps lines that have not been structurally broken.
Multi-Timeframe Trend Table (Top Right)
Five user-configurable timeframes are assessed using the same dual-EMA logic (fast = HullLen/2, slow = HullLen). Each cell displays BULL or BEAR in the trend's colour. A "X/5 Bull" counter at the bottom summarises alignment. The table also shows current ADX value, RSI, and number of active S/R lines.
Inputs Reference
Hull Cloud
- Hull MA Length (21) — primary HMA period
- ATR Length (14) — period for ATR cloud width
- Cloud Width (1.0 ATR) — inner cloud half-width multiplier
- Outer Band Mult (1.618) — outer band golden-ratio expansion
- ADX Length (14) — custom ADX smoothing period
- Volume SMA Length (20) — reference for volume scoring
- RSI Length (14)
Retest Detection
- Min Signal Score (40) — minimum composite score to display signal
- Max S/R Lines (8) — maximum simultaneous S/R lines on chart
- S/R Break Buffer (0.5 ATR) — tolerance before a line is considered broken
- Show Score Label / Show S/R Lines
MTF Dashboard
- Show MTF Trend Table
- TF 1–5 — five independently configurable timeframes
Visual
- Theme: Dark, Light, Auto
How to Use
1. Apply to a liquid trending instrument. Allow warmup (roughly 3× Hull Length bars).
2. Identify the trend from cloud colour: teal fills = uptrend, red fills = downtrend.
3. Wait for price to dip into the inner cloud during an uptrend (or spike into it during a downtrend) and close back in the trend direction.
4. Check the score label — prefer grade 55+ (B or higher). Crosscheck with the MTF table: 4+ of 5 timeframes aligned significantly improves reliability.
5. The stamped S/R line from the retest level serves as a reference for re-entry if price pulls back again.
Non-Repainting Design
All retest signals are gated by barstate.isconfirmed. MTF data uses lookahead_off. S/R line management runs only on confirmed bars. No visual element shifts position after the bar closes.
Limitations
- In ranging, choppy markets, the cloud direction changes frequently and retest signals may have low predictive value. The ADX score component partially mitigates this, but consider increasing the minimum score threshold in low-trend environments.
- S/R lines accumulate during active trend periods. The max line count setting prevents chart clutter.
- MTF trend data requires request.security() calls per timeframe. On lower timeframes with very high bar counts, this may slightly affect indicator load time.
Disclaimer
This indicator is for educational and informational purposes only. No signal scoring system guarantees future performance. Always use proper risk management and conduct independent analysis before trading.
Made with passion by officialjackofalltrades
Overview
Kinetic Hull Matrix is an adaptive trend-following indicator centred on a Hull Moving Average cloud with ATR-proportional envelopes, a custom ADX engine, a 0–100 composite signal scoring system, and a multi-timeframe trend table — all rendered in a layered fill system that visually communicates trend strength and cloud penetration depth simultaneously. Retest signals fire when price touches the cloud boundary from within the trending direction, scored by four independent quality factors.
The Hull Moving Average — Why It Matters
The Hull Moving Average (HMA) was designed to reduce lag while maintaining smoothness. The calculation uses weighted moving averages at half-length and full-length, doubles the half-length result, subtracts the full-length result (creating a de-lagged series), then applies a final WMA at the square root of the length:
WMA(2 * WMA(src, n/2) - WMA(src, n), sqrt(n))
This produces a moving average that reacts significantly faster to price changes than a standard EMA or SMA of the same length, while filtering micro-noise through the final WMA pass. The result is a responsive midline that rarely produces whipsaws in trending markets.
ATR-Adaptive Cloud Architecture
The HMA midline is expanded into a four-layer cloud using the current ATR:
- Inner cloud (upper and lower bands): HullMid ± ATR × CloudMultiplier (default 1.0). This is the primary retest detection zone.
- Outer bands: HullMid ± ATR × CloudMultiplier × OuterMultiplier (default 1.618, the golden ratio). These define the statistical extreme of the cloud envelope.
The cloud dynamically widens during volatile markets and contracts during compression — naturally adapting to market conditions without manual parameter changes.
Four fill layers are rendered between the bands using trend-coloured gradients: bright teal in uptrends, muted red in downtrends, creating an intuitive visual heat map of trend energy.
Custom ADX Engine
Rather than relying on the built-in ta.dmi(), Kinetic Hull Matrix implements its own ADX from first principles:
1. Positive directional movement (plusDM) = max(high - high[1], 0) when high-to-high exceeds low-to-low
2. Negative directional movement (minusDM) = max(low[1] - low, 0) when low-to-low exceeds high-to-high
3. Both are smoothed via ta.rma() over the ADX length, then divided by the RMA of true range to produce +DI and -DI
4. The directional index DX = abs(+DI - -DI) / (+DI + -DI) * 100, finally smoothed via ta.rma() to produce ADX
This gives a transparent, auditable ADX implementation. Values above 25 indicate a trending regime; below 25 indicates ranging conditions. The dashboard and scoring system both use this value.
Composite Signal Score (0–100)
A retest signal qualifies only when close price enters the inner cloud (touches upper cloud from above in a downtrend or lower cloud from below in an uptrend) while the candle closes back in the trend direction. The resulting signal is then scored:
- Proximity score (up to 50): How deeply price penetrated into the cloud. Deeper retests score higher.
- Volume score (up to 25): Current volume relative to its 20-bar SMA. Higher participation scores higher.
- RSI score (up to 15): RSI directional headroom — long signals score better when RSI has room below 55, short signals when RSI has room above 45.
- ADX score (up to 10): Raw ADX value × 0.4, capped at 10. Strong trends produce higher-quality retests.
Only signals meeting the configurable minimum score threshold (default 40) are displayed.
S/R Line Stamping
Each confirmed retest signal stamps a horizontal dotted line at the close price, extending 60 bars forward. These lines serve as dynamic support (for bull retests) and resistance (for bear retests). Lines are automatically invalidated and deleted if price closes through them by more than 0.5 ATR — the indicator only keeps lines that have not been structurally broken.
Multi-Timeframe Trend Table (Top Right)
Five user-configurable timeframes are assessed using the same dual-EMA logic (fast = HullLen/2, slow = HullLen). Each cell displays BULL or BEAR in the trend's colour. A "X/5 Bull" counter at the bottom summarises alignment. The table also shows current ADX value, RSI, and number of active S/R lines.
Inputs Reference
Hull Cloud
- Hull MA Length (21) — primary HMA period
- ATR Length (14) — period for ATR cloud width
- Cloud Width (1.0 ATR) — inner cloud half-width multiplier
- Outer Band Mult (1.618) — outer band golden-ratio expansion
- ADX Length (14) — custom ADX smoothing period
- Volume SMA Length (20) — reference for volume scoring
- RSI Length (14)
Retest Detection
- Min Signal Score (40) — minimum composite score to display signal
- Max S/R Lines (8) — maximum simultaneous S/R lines on chart
- S/R Break Buffer (0.5 ATR) — tolerance before a line is considered broken
- Show Score Label / Show S/R Lines
MTF Dashboard
- Show MTF Trend Table
- TF 1–5 — five independently configurable timeframes
Visual
- Theme: Dark, Light, Auto
How to Use
1. Apply to a liquid trending instrument. Allow warmup (roughly 3× Hull Length bars).
2. Identify the trend from cloud colour: teal fills = uptrend, red fills = downtrend.
3. Wait for price to dip into the inner cloud during an uptrend (or spike into it during a downtrend) and close back in the trend direction.
4. Check the score label — prefer grade 55+ (B or higher). Crosscheck with the MTF table: 4+ of 5 timeframes aligned significantly improves reliability.
5. The stamped S/R line from the retest level serves as a reference for re-entry if price pulls back again.
Non-Repainting Design
All retest signals are gated by barstate.isconfirmed. MTF data uses lookahead_off. S/R line management runs only on confirmed bars. No visual element shifts position after the bar closes.
Limitations
- In ranging, choppy markets, the cloud direction changes frequently and retest signals may have low predictive value. The ADX score component partially mitigates this, but consider increasing the minimum score threshold in low-trend environments.
- S/R lines accumulate during active trend periods. The max line count setting prevents chart clutter.
- MTF trend data requires request.security() calls per timeframe. On lower timeframes with very high bar counts, this may slightly affect indicator load time.
Disclaimer
This indicator is for educational and informational purposes only. No signal scoring system guarantees future performance. Always use proper risk management and conduct independent analysis before trading.
Made with passion by officialjackofalltrades
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.