OPEN-SOURCE SCRIPT

Confluence Signal Engine [JOAT]

1 431
Confluence Signal Engine [JOAT]

Introduction

Most traders encounter a common trap: stacking multiple indicators that all claim to measure something different, yet each one is ultimately derived from the same price data. The result is not confirmation — it is correlated noise presented as agreement. The Confluence Signal Engine [JOAT] was built to address this directly.

This indicator assigns a composite score to the current market condition by evaluating six deliberately chosen dimensions of market behavior. Each dimension is designed to measure a fundamentally different property of price action. When multiple dimensions agree, that agreement carries more weight than any single indicator firing alone. The result is a single, normalised score between -1 and +1, accompanied by a visual confidence meter and a score breakdown table so you can see exactly what is driving the signal.

This is an overlay indicator — it plots directly on the price chart.

תמונת-בזק
---

Core Concepts

The Six Scoring Dimensions

Each dimension returns one of three values: +1 (bullish contribution), -1 (bearish contribution), or 0 (neutral / insufficient data). These are summed and divided by 6.0 to produce the composite score.

D1 — EMA Alignment (Trend Direction)
Compares a fast EMA to a slow EMA. If the fast EMA is above the slow EMA, the trend dimension scores +1. If below, it scores -1. This is the structural backbone — a baseline read on which side of the trend the price currently sits.

D2 — Price Z-Score (Statistical Deviation)
Calculates how many standard deviations the current close is from a baseline EMA. A Z-score below the negative threshold suggests the price has deviated far enough below the mean to be considered statistically stretched — a potential reversion candidate, scored +1. A Z-score above the positive threshold scores -1. This dimension does not measure trend; it measures relative price position against recent statistical norms.

D3 — Volume Pressure (Demand Validation)
Uses a Volume RSI (RSI applied to volume over 8 bars, divided by 50) as a proxy for whether volume activity is elevated. When volume pressure exceeds the threshold, the candle's direction (close vs. open) determines the score: a bullish candle in high-volume conditions scores +1; a bearish candle scores -1. When volume is not elevated, this dimension returns 0, contributing nothing. This prevents volume noise on low-activity bars from polluting the signal.

D4 — RSI Momentum (Momentum Quality)
Evaluates both the current RSI value and its slope. A rising RSI above 50 scores +1 — confirming that momentum is positive and strengthening. A falling RSI below 50 scores -1. This differs from a simple RSI threshold because the slope requirement means momentum must be actively moving in the scored direction, not merely sitting above or below a level.

D5 — Structural Position (Range Placement)
Compares the current close to the midpoint of the highest high and lowest low over a configurable lookback period. Closing above the midpoint scores +1; closing below scores -1. This is a simple but useful structural context: is price holding in the upper or lower half of its recent range?

D6 — Volatility Context (Environment Quality)
Divides a fast ATR by a slow ATR to produce a volatility ratio. A low ratio (calm, contracting volatility) scores +1 — historically a more favorable environment for trend continuation. A high ratio (expanding, elevated volatility) scores -1, flagging that the current environment may be erratic. A ratio between the two thresholds is neutral. This dimension does not predict price direction; it assesses whether current conditions are conducive to acting on the other signals.

---

Composite Score and Confidence

Pine Script®


The composite score ranges from -1.0 (all six dimensions bearish) to +1.0 (all six dimensions bullish). The confidence value is simply the absolute magnitude — a score of ±1.0 represents 100% agreement across all dimensions, while a score near 0 represents disagreement or neutrality.

Signal thresholds:
  • Score > buy threshold (default 0.3) → bullish signal
  • Score < sell threshold (default -0.3) → bearish signal
  • Score > high-confidence threshold (default ±0.6) → high-confidence signal


Signals are gated by barstate.isconfirmed — they only fire on fully closed bars, preventing intra-bar repainting. State tracking also prevents the same directional signal from repeating consecutively without a change in direction first.

---

Visual Components

24-Cell Gradient Confidence Meter
A horizontal bar of 24 cells is displayed at the bottom of the chart. The left side is the bearish extreme, the center is neutral, and the right side is the bullish extreme. The current composite score position is highlighted within the meter, giving a continuous visual read of where the market sits in the conviction range — not just whether a signal has fired, but how strongly.

Score Breakdown Table
A table showing three columns for each dimension: dimension name, dimension number, and its current score (+1, -1, or 0). This allows you to see exactly which dimensions are contributing to the composite and which are neutral or conflicting.

Gradient Bar Coloring
Price bars are colored using a gradient that interpolates from a neutral color toward the signal color, weighted by the absolute value of the composite score. A high-confidence bull signal produces a strong green bar; a low-confidence or mixed signal produces a muted or neutral color. This keeps bar coloring proportional to actual conviction rather than using a binary flip.

---

Features

  • Six-dimension composite scoring system covering trend, statistics, volume, momentum, structure, and volatility
  • Composite score normalised to [-1, +1] with confidence percentage
  • Non-repainting: all signals confirmed on bar close via barstate.isconfirmed
  • State-tracked signals prevent repeated same-direction firing
  • 24-cell gradient confidence meter with continuous position display
  • Score breakdown table showing each dimension's individual contribution
  • Gradient bar coloring proportional to conviction level
  • Configurable thresholds for all six dimensions and signal levels


---

Input Parameters

  • EMA Fast / Slow (default 21 / 55) — D1 trend alignment
  • Z-Score Baseline EMA (default 50) — the mean used for Z-score calculation
  • Z-Score Window (default 50) — standard deviation lookback
  • Z-Score Threshold (default 1.5) — how many standard deviations trigger the score
  • Volume RSI Length (default 8) — RSI period applied to volume
  • Volume Threshold (default 1.2) — Volume RSI / 50 must exceed this to activate D3
  • RSI Length (default 14) — standard RSI period for D4
  • Structure Lookback (default 20) — bars used to define the high/low range for D5
  • ATR Fast / Slow (default 14 / 50) — periods for the volatility ratio in D6
  • Volatility Thresholds (default 0.8 / 1.5) — low and high boundaries for the ATR ratio
  • Buy Threshold (default 0.3) — minimum composite score to generate a long signal
  • Sell Threshold (default -0.3) — maximum composite score to generate a short signal
  • High-Confidence Threshold (default ±0.6) — score level at which a signal is classified as high-confidence


---

How to Use

  • Apply to any chart. The overlay paints directly on price bars.
  • Watch the confidence meter for the current composite score position. A score pressed toward either extreme with multiple dimensions aligned is a higher-quality read than one sitting near center.
  • Use the score breakdown table to understand why the composite score is what it is. If only 2 of 6 dimensions are contributing, the signal is weaker regardless of whether it crossed the threshold.
  • High-confidence signals (score beyond ±0.6 by default) indicate that four or more of the six dimensions are in agreement. These can be treated as stronger setups than threshold-level signals.
  • Combine the composite score read with your own price action, support/resistance, or higher-timeframe context before entering a trade. This indicator is a confluence tool, not a standalone entry system.
  • If several dimensions are conflicting (score near 0), the market is not in a clear state — no action is the appropriate response.


---

Limitations

  • No indicator can predict future price. The composite score reflects current market conditions based on recent historical data — not what will happen next.
  • Z-score and structural position dimensions are mean-reverting in nature, while EMA alignment and RSI momentum are trend-following. In strongly trending markets, D2 and D5 may produce persistent bearish readings even during a healthy uptrend, suppressing the composite score. This is by design — the indicator is more suited to environments where confluence across all dimensions is achievable.
  • Volume RSI (D3) is only reliable on instruments and timeframes with consistent, meaningful volume data. On synthetic instruments, indices, or very low-timeframe charts, volume data may be unreliable and D3's contribution should be weighted accordingly.
  • The volatility context dimension (D6) measures the environment, not direction. A low-volatility score of +1 does not mean the market is about to move up — only that conditions are historically more favorable for clean signals.
  • Signal state tracking prevents consecutive same-direction signals, which reduces noise but also means the indicator will not re-fire during a prolonged trending move. This is a deliberate design choice but should be understood before use.
  • Default thresholds were chosen for general applicability. Different asset classes, timeframes, and volatility regimes may benefit from threshold adjustment.
  • Past signal quality on any given instrument does not guarantee future performance.


---

Originality Statement

The core innovation of this indicator is the deliberate selection of six dimensions that measure fundamentally different market properties rather than multiple views of the same property. Standard multi-indicator approaches tend to combine RSI, MACD, and Stochastic — all of which are momentum oscillators derived from price, generating correlated signals that appear independent but are not.

This indicator separates the problem into distinct domains: trend direction (EMA alignment), statistical deviation from the mean (Z-score), demand-side pressure (Volume RSI), momentum quality and direction (RSI slope + level), structural placement within recent range (midpoint comparison), and environmental favorability (ATR ratio). Because these dimensions are largely uncorrelated with each other, genuine multi-dimension agreement represents a qualitatively different kind of confluence than stacking three oscillators. The 24-cell gradient meter goes further — it provides a continuous conviction read rather than a binary signal, treating market condition as a spectrum.

---

Disclaimer

This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any security. All trading involves risk, including the possible loss of principal. Past indicator performance does not guarantee future results. Always conduct your own research and consult a qualified financial professional before making any trading decisions.

-Made with passion by officialjackofalltrades

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.