Confluence Matrix [JOAT]Confluence Matrix
Introduction
Every component in a professional trading system should serve a purpose, and ideally, no single component should bear the entire weight of decision-making alone. The best entries occur when multiple independent analytical methods all point in the same direction simultaneously — a confluence event that dramatically raises the probability that the observed setup reflects genuine market structure rather than random noise. The Confluence Matrix is built around this philosophy, integrating six distinct analytical modules into a single, cohesive overlay indicator with a unified seven-point scoring framework that gates every trade entry.
The six integrated modules are: HEMA regime analysis (three-layer Hull-EMA Hybrid with two-bar confirmation), Break of Structure and Change of Character market structure (swing pivot-based BOS and CHoCH detection), a triple-smoothed Fibonacci channel (0.618, 1.618, and 2.618 bands around a triple-EMA basis), an ATR compression detection engine (volatility squeeze state), Z-score cumulative impulse detection (statistically significant momentum streaks), and an OLS linear regression combined with cumulative delta proxy and volume RSI. Each module contributes one integer point to a directional score. Entries require a minimum score threshold — meaning price must be supported by a configurable number of simultaneously aligned modules before a position is opened.
Beyond signal generation, the indicator includes a simulated position tracking system that monitors open virtual positions with defined entry prices, take-profit levels, stop-loss levels, and a trailing stop mechanism. This system does not execute real trades — it visualizes what a rule-based system following the indicator's own signals would have done, providing an educational and contextual layer that helps users understand how the signals sequence in live trading conditions. All trade signals are confirmed-bar only, with no look-ahead repainting. The fifteen-row dashboard, ten alert conditions, and extensive visual customization options make this the most comprehensive single-overlay indicator in the JOAT suite.
Core Concepts
1. HEMA Three-Layer Regime with Two-Bar Confirmation
The HEMA (Hull-EMA Hybrid) forms the structural backbone of the regime assessment. Three independent HEMA instances at periods 20, 50, and 100 represent the fast, mid, and slow trend layers. Full bull regime requires ascending order of all three (fast above mid above slow). Full bear regime requires descending order. The two-bar confirmation state machine requires two consecutive bars of raw alignment before the confirmed regime variable updates — preventing rapid back-and-forth flipping on borderline crossovers.
f_hema(src, len) =>
ta.ema(2 * ta.ema(src, len / 2) - ta.ema(src, len), math.round(math.sqrt(len)))
hema1 = f_hema(close, 20)
hema2 = f_hema(close, 50)
hema3 = f_hema(close, 100)
rawBull = hema1 > hema2 and hema2 > hema3
rawBear = hema1 < hema2 and hema2 < hema3
confBull = rawBull and rawBull
confBear = rawBear and rawBear
The CHoCH (Change of Character) logic builds directly from this: a bullish BOS that occurs while confBear is true represents structural bullish momentum emerging from within a confirmed bear regime — the first evidence of potential regime reversal.
2. BOS and CHoCH with Visual Lines
Break of Structure detection uses ta.pivothigh and ta.pivotlow to track prior swing levels. BOS events draw labeled lines on the chart: teal/red for standard BOS continuation, violet-dashed for CHoCH. All line drawing uses line.new() with fixed coordinates on confirmed bars, and extends the right endpoint to the next BOS event for visual continuity across the chart.
chochUp = bosUp and confBear
chochDn = bosDn and confBull
lineStyle = (chochUp or chochDn) ? line.style_dashed : line.style_solid
lineColor = chochUp ? color.purple : bosUp ? color.teal : chochDn ? color.purple : color.red
3. Triple-Smoothed Fibonacci Channel
The Fibonacci channel applies the same triple-EMA smoothing used in the FVC indicator to produce a noise-resistant basis line, then projects Fibonacci-ratio bands (0.618, 1.618, 2.618) both above and below using ATR or standard deviation as the volatility measure. Within the Confluence Matrix, the channel serves a dual purpose: its own slope defines the "fib trend" score contribution, and its band levels serve as reference zones for proximity analysis.
basis = ta.ema(ta.ema(ta.ema(hlc3, basisLen), basisLen), basisLen)
fibTrend = basis > basis ? 1 : basis < basis ? -1 : 0
The 0.618 and 1.618 inner bands are filled with a gradient between basis and inner band, with the fill opacity tied to the confirmed regime — teal fills in bull regime, red fills in bear regime, gray in neutral.
4. ATR Squeeze Detection
The ATR squeeze module uses the same compression ratio logic as the VSO indicator: comparing a short-term EMA-smoothed ATR against a longer baseline to determine whether volatility is contracting or expanding. When volatility is contracting (squeezing), the squeeze score contribution is zero — the market is not yet expressing directional energy. When volatility is expanding, the module contributes to the appropriate directional score.
atrShort = ta.ema(ta.tr(true), sqzLen)
atrLong = ta.ema(atrShort, sqzLen * 2)
squeezing = atrLong > atrShort
sqzOK = not squeezing
5. Z-Score Cumulative Impulse
The Z-score impulse module tracks separate cumulative bull and bear momentum streaks, normalizes them against rolling sma/stdev, and marks statistically significant events with diamond markers (◆) plotted above and below the price bars. These markers are displayed at confirmed bars only. The Z-score values for both directions are shown in the dashboard and contribute one point each to the long and short scores when their respective thresholds are exceeded.
cumBull := close > close ? nz(cumBull ) + (close - close ) : 0
cumBear := close < close ? nz(cumBear ) + (close - close) : 0
zBull = (cumBull - ta.sma(cumBull, zLen)) / ta.stdev(cumBull, zLen)
zBear = (cumBear - ta.sma(cumBear, zLen)) / ta.stdev(cumBear, zLen)
6. OLS Regression, Delta Proxy, and Volume RSI
The sixth analytical layer combines three sub-components. The OLS linear regression (using the same manual implementation as the ARO indicator) provides the Pearson R correlation quality metric and theta angle, which together determine whether the regression score contributes. The cumulative delta proxy (bar-range-based buying/selling pressure estimate) determines the delta directional score. Volume RSI (RSI applied to volume series) provides the volume quality gate. All three sub-components are evaluated in the context of long or short scoring.
regressionScore = pearsonR > minR and math.abs(theta) > minTheta ? (theta > 0 ? 1 : -1) : 0
deltaScore = deltaPos ? 1 : -1
volumeScore = highVol ? (localBull ? 1 : -1) : 0
7. Seven-Point Confluence Scoring
Each of the six modules contributes one integer point to either the long score or the short score (some modules contribute to both). The seven scoring variables (ls1 through ls7 for long, ss1 through ss7 for short) are summed individually so each module's contribution is transparent and auditable. The minimum score threshold (default: 5 of 7) gates entry conditions.
ls1 = confBull ? 1 : 0 // HEMA regime
ls2 = lastBOSDir == 1 ? 1 : 0 // Last BOS direction
ls3 = fibTrend == 1 ? 1 : 0 // Fibonacci channel trend
ls4 = sqzOK ? 1 : 0 // Squeeze OK (not compressing)
ls5 = regressionScore == 1 ? 1 : 0 // Regression + Pearson
ls6 = deltaPos ? 1 : 0 // Delta proxy bullish
ls7 = highVol and localBull ? 1 : 0 // Volume RSI + local trend
longScore = ls1 + ls2 + ls3 + ls4 + ls5 + ls6 + ls7
8. Simulated Position Tracking with Trailing Stop
The position tracker uses persistent var variables to track open trade state. Entry occurs when a BOS trigger or HEMA crossover fires, the score meets the minimum threshold, the bar is confirmed, and no position is currently open in that direction. Stop-loss is set at ATR below the entry for longs (above for shorts). Take-profit is set at a multiple of ATR from entry. The trailing stop mechanism moves the SL to breakeven once the position has moved one ATR in the favorable direction — locking in capital protection once momentum is confirmed.
var int posDir = 0
var float openTP = na
var float openSL = na
var float entryPx = na
longEntry = (bosUp or hemaXover) and longScore >= minScore and barstate.isconfirmed and posDir <= 0
if longEntry
posDir := 1
entryPx := close
openTP := close + atr14 * tpMult
openSL := close - atr14 * slMult
// Trailing stop to breakeven
if posDir == 1 and high - entryPx > atr14
openSL := math.max(openSL, entryPx)
Exits occur on TP hit, SL hit, or confirmed regime flip opposing the position direction (confBear while long, confBull while short).
9. Proximity-Gradient Bar Coloring
Bar colors are driven by the distance between the current close and the HEMA mid layer (hema2), normalized by the range between the fast and slow HEMA layers. This produces a bar coloring scheme that reflects not just direction but the degree of extension relative to the HEMA structure's own internal spread — a more dynamically calibrated proximity measure than a fixed ATR reference.
hemaRange = math.abs(hema1 - hema3)
hemaDist = hemaRange > 0 ? math.abs(close - hema2) / hemaRange : 0
hemaProxAlpha = math.min(math.round(hemaDist * 60), 75)
Features
Six Integrated Modules: HEMA regime, BOS+CHoCH structure, Fibonacci channel, ATR squeeze, Z-score impulse, and OLS regression+delta+volume all active simultaneously.
Seven-Point Scoring System: Each module contributes one point to a transparent, auditable confluence score with configurable minimum threshold for entry.
Two-Bar HEMA Confirmation: Prevents false regime transitions on single-bar HEMA crossovers.
CHoCH Detection: BOS events opposing the confirmed regime are classified as Change of Character and drawn with violet dashed lines.
Z-Score Diamond Markers: Statistically significant momentum streak markers displayed as ◆ above and below bars on confirmed events.
Triple-Smoothed Fibonacci Channel: 0.618, 1.618, and 2.618 bands with regime-conditional gradient fills.
Simulated Position Tracking: Virtual positions with TP, SL, and trailing stop to breakeven — visualizing the signal system in action.
Proximity-Gradient Bar Coloring: HEMA-internal-range-normalized distance drives bar color alpha for structure-relative visual encoding.
BOS Lines: Teal/red for continuation BOS, violet dashed for CHoCH — drawn at confirmed bars with horizontal extensions.
Fifteen-Row Dashboard: Position direction, regime, last BOS, CHoCH state, fib trend, volatility, Pearson R, theta, bull Z, bear Z, volume RSI, delta proxy, long score, short score, and minimum score threshold.
Ten Alert Conditions: Long entry, short entry, long exit, short exit, CHoCH up, CHoCH down, bull impulse, bear impulse, BOS up, BOS down — all as constant string alerts.
Input Parameters
HEMA Settings:
Fast/Mid/Slow Lengths: HEMA layer periods (defaults: 20, 50, 100)
Structure Settings:
Swing Length: Pivot lookback for BOS/CHoCH detection (default: 10)
Fibonacci Channel Settings:
Basis Length: Triple-EMA period (default: 20)
Volatility Type: ATR or StDev (default: ATR)
Volatility Length: Period for volatility measure (default: 14)
Z-Score Settings:
Z Lookback: Rolling window for normalization (default: 50)
Z Threshold: Sigma level for impulse trigger (default: 2.0)
Regression Settings:
Regression Length: Bar count for OLS calculation (default: 50)
Min Pearson R: Minimum |R| for regression score contribution (default: 0.6)
Min Theta: Minimum angle for regression score contribution (default: 5)
Entry/Exit Settings:
Minimum Score: Points required for entry (default: 5)
TP Multiplier: ATR multiple for take-profit level (default: 2.0)
SL Multiplier: ATR multiple for stop-loss level (default: 1.0)
Display Settings:
Show HEMA Layers: Toggle individual HEMA line visibility (default: true)
Show Trend Cloud: Toggle HEMA gradient fill (default: true)
Show Fibonacci Channel: Toggle Fibonacci band fills (default: true)
Show BOS Lines: Toggle structural break lines (default: true)
Show Z Markers: Toggle diamond impulse markers (default: true)
Show Position Lines: Toggle TP/SL/entry lines (default: true)
Show Bar Colors: Toggle proximity gradient bar coloring (default: true)
Show Dashboard: Toggle the fifteen-row table (default: true)
How to Use This Indicator
Step 1: Read the Score Before Acting on Any Signal
The most important discipline when using the Confluence Matrix is to check the long score or short score before taking any action on a signal. A BOS up event alone carries one point; it does not guarantee a high-probability setup. A BOS up event accompanied by a score of 6 or 7 — meaning five or six other modules are simultaneously aligned — is a materially different situation. Begin each analysis session by reading the dashboard scores and understanding which modules are contributing and which are not.
Step 2: Use the CHoCH for Regime Change Awareness
CHoCH events are the most important structural signals in the indicator. A CHoCH up (bullish BOS during a confirmed bear regime) does not mean immediately go long — it means the structural assumption of the prior bear regime is being challenged. Wait for the regime confirmation to update, watch for the long score to rise as modules align with the new potential bull regime, and then consider entry on the next confirmed BOS in the bull direction backed by a high score. The sequence matters: CHoCH first, then regime confirmation, then high-score entry.
Step 3: Let the Simulated Position Tracker Teach Pattern Recognition
The position tracker lines (entry, TP, SL) on the chart are an educational tool. Over time, reviewing where simulated positions were opened and closed relative to the subsequent price action reveals patterns about which score thresholds, which module combinations, and which entry triggers produce the cleanest outcomes on the specific instrument you are analyzing. Use this visual feedback to calibrate your own minimum score setting and module weighting preferences.
Step 4: Manage Visual Complexity Through Selective Display
Six integrated modules produce a significant amount of simultaneous chart information. New users should start with all display elements enabled to understand the full system, then progressively toggle off elements they are not actively using for a given analysis. The dashboard always reflects the underlying calculations regardless of display settings — so even with Fibonacci fills and BOS lines hidden, the score, regime, and all module states remain visible in the dashboard.
Indicator Limitations
The simulated position tracking system is a visual and educational tool only. It does not place real orders, cannot account for slippage, spread, or commission costs, and its results should never be used as a basis for financial decisions. Simulated performance and real-world trading performance are categorically different.
The seven-module scoring system assigns equal weight to all contributing modules. In practice, some modules (e.g., HEMA regime) may carry more structural significance than others (e.g., volume RSI). The equal-weight assumption is a simplification.
Six integrated modules means six sets of parameters to configure. The default settings are calibrated for daily and 4-hour chart analysis on liquid instruments. Heavy optimization of all parameters to historical data risks overfitting — the resulting configuration may perform well on history but fail on new data.
The OLS regression component requires sufficient bars to produce stable Pearson R and theta values. In the first regression-length bars of any chart session, these values will be based on very short windows and should not be treated as reliable quality filters.
All modules operate on the chart's native timeframe. The indicator does not incorporate multi-timeframe analysis internally — users seeking MTF context should reference the MCG indicator in combination.
Proximity bar coloring uses the HEMA internal range (hema1 minus hema3) as the normalizer. When all three HEMA layers are closely clustered (flat, sideways market), this range approaches zero, which can cause division instability in the proximity calculation. A guard for this case is included but the coloring will be less informative during flat HEMA conditions.
The trailing stop to breakeven mechanism fires when the position has moved one ATR in the favorable direction. In very high-volatility conditions with large ATR values, this may mean the SL does not move to breakeven until the position is significantly extended, reducing capital protection in fast-moving markets.
Originality Statement
The Confluence Matrix is the most comprehensive indicator in the JOAT suite and represents an original architectural achievement in the design of multi-module overlay indicators.
The seven-point confluence scoring system — where six independent analytical modules each contribute a single integer vote, and entry is gated by a minimum aggregate threshold — is an original framework for combining heterogeneous technical signals into a unified, transparent decision criterion.
The combination of HEMA regime, BOS/CHoCH structure, Fibonacci channel, ATR squeeze, Z-score impulse, and OLS regression+delta+volume in a single non-repainting overlay indicator with no external indicator dependencies is an original integration not replicated by any single publicly available TradingView indicator.
The simulated position tracking system with trailing stop to breakeven — driven entirely by the indicator's own scoring and signal conditions, visualized directly on the chart — is an original self-contained feedback mechanism for understanding the system's real-time behavior.
The CHoCH classification (BOS event opposing the confirmed two-bar regime, not merely the raw regime) adds a confirmation layer to the standard CHoCH definition that reduces false change-of-character signals during borderline regime periods.
The proximity bar coloring normalized by the internal HEMA range (hema1 minus hema3) rather than by a fixed ATR reference creates a structure-relative alpha calculation that adapts to the current degree of HEMA layer separation — a more contextually aware coloring approach than fixed-reference alternatives.
The use of ten constant-string alert conditions (not dynamic or computed strings) ensures full compatibility with TradingView's alert system, including webhook delivery and multi-condition alert construction.
Disclaimer
The Confluence Matrix is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. The simulated position tracking feature is for educational visualization only and does not represent actual trade results. No scoring system or multi-indicator confluence framework can guarantee profitable trading outcomes. All trading involves risk, including the potential loss of principal. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
אינדיקטור Pine Script®






















