OPEN-SOURCE SCRIPT

Confluence Ledger [JOAT]

1 141
Confluence Ledger [JOAT]

Introduction

The Confluence Ledger is an advanced open-source multi-timeframe confluence scoring engine that evaluates eight independent analytical dimensions across five configurable timeframes, producing a unified directional bias score from 0 to 100. It answers the question every trader asks: "Do the timeframes agree, and how strongly?" Rather than checking multiple indicators on multiple charts, this single tool synthesizes trend alignment, momentum phase, volatility state, market structure, volume conviction, RSI regime, VWAP bias, and ATR expansion into one actionable number.

The indicator overlays on the price chart with gradient-colored candles, confluence pressure zones, regime transition lines, divergence detection boxes, and institutional confluence signals - all backed by a compact 12-row dashboard that displays every metric in real-time.

снимок

Why This Indicator Exists

Multi-timeframe analysis is widely recognized as essential for high-probability trading, but executing it manually is tedious and error-prone. A trader might check the daily trend, the 4H momentum, the 1H structure, and the 15m entry — but doing this across eight different analytical dimensions is impractical without automation.

The Confluence Ledger automates this entire process by:

  • Scoring eight distinct analytical dimensions on each of five timeframes, producing 40 individual data points per bar
  • Weighting higher timeframes more heavily (Daily gets 2x the weight of the 5-minute chart), reflecting the institutional reality that higher timeframe trends dominate
  • Mapping the weighted aggregate to a 0-100 scale where 50 is perfectly neutral, above 60 is bullish, and below 40 is bearish
  • Adding institutional features that analyze the score itself: pressure zones where extreme confluence persisted, regime transitions where the bias flipped, and divergences between price and the confluence score


The Eight Scoring Dimensions

Each dimension returns a score from -1 (maximum bearish) to +1 (maximum bullish). Here is what each measures and why it matters:

1. Trend Alignment
Combines EMA slope direction with price position relative to the adaptive moving average. If price is above a rising EMA, the trend score is +1. If price is below a falling EMA, it is -1. Mixed conditions produce intermediate scores. This captures the most fundamental question: is the trend up or down?

2. Momentum Phase
A composite of three normalized oscillators — Bollinger %B, CCI, and ROC. Each is scored independently and averaged. This measures whether momentum is bullish, bearish, or neutral, using three different mathematical approaches to reduce the chance of a single oscillator giving a misleading signal.

3. Volatility State
Measures Bollinger Band width relative to its 50-bar average. Expanding volatility scores positive (in the direction of price), compressing volatility scores near zero. This dimension captures whether the market is in expansion (trending) or compression (range-bound).

4. Structure Bias
Uses an oscillator-based swing detection method to track whether the market is making higher highs/higher lows (bullish structure, score +1) or lower highs/lower lows (bearish structure, score -1). This is the structural backbone of Smart Money analysis.

5. Volume Conviction
Calculates current volume relative to the 20-bar average and weights it by candle direction. A bullish candle on 2x average volume scores strongly positive. A bearish candle on low volume scores weakly negative. This measures whether volume confirms the directional move.

6. RSI Regime
RSI position relative to 50 provides the base score, with additional weight for extreme readings (above 70 or below 30). This captures overbought/oversold conditions and the general momentum regime.

7. VWAP Bias
Price distance from VWAP normalized by ATR. When price is significantly above VWAP, institutional flow is net bullish. Below VWAP, net bearish. The ATR normalization ensures the score adapts to the instrument's volatility.

8. ATR Expansion
The rate of change of ATR itself, weighted by candle direction. When ATR is expanding in the direction of price, it confirms the move has volatility behind it. Contracting ATR suggests the move is losing energy.

Multi-Timeframe Aggregation

All eight dimensions are calculated on each of five timeframes (default: 5m, 15m, 1H, 4H, Daily) using request.security(). The per-timeframe scores are then weighted:

  • TF1 (5m): weight 1.0
  • TF2 (15m): weight 1.2
  • TF3 (1H): weight 1.5
  • TF4 (4H): weight 1.8
  • TF5 (Daily): weight 2.0


This weighting reflects the institutional principle that higher timeframe trends are more significant. A strong daily bias overrides conflicting 5-minute noise.

The weighted aggregate is mapped from [-1, +1] to [0, 100]:

Pine Script®


Score interpretation:
  • 80-100: EXTREME LONG — near-unanimous multi-TF bullish agreement
  • 70-79: STRONG LONG — clear bullish bias across most timeframes
  • 60-69: LEAN LONG — moderate bullish tilt
  • 41-59: NEUTRAL — no clear directional consensus
  • 31-40: LEAN SHORT — moderate bearish tilt
  • 21-30: STRONG SHORT — clear bearish bias
  • 0-20: EXTREME SHORT — near-unanimous bearish agreement


Institutional Analytics Engine

Beyond the core score, the indicator calculates several advanced metrics:

TF Agreement: Counts how many of the five timeframes are bullish vs bearish. When 4+ timeframes agree, a "Full Alignment" signal fires — these are the highest-conviction directional setups.

Score Velocity: The rate of change of the confluence score itself. "ACCEL UP" means the score is rising and accelerating. "FALLING" means directional conviction is weakening. This is the first derivative of confluence — it tells you whether agreement is building or fading.

Conviction Meter: Measures how tightly aligned the five timeframe scores are using standard deviation. Low variance (high conviction) means all timeframes agree closely. High variance (low conviction) means timeframes are giving conflicting signals.

Cross-TF Momentum Divergence: Compares the average of lower timeframes (TF1+TF2) against higher timeframes (TF4+TF5). When lower TFs are leading (diverging bullish while higher TFs lag), it can signal an early trend change. When upper TFs are leading, the higher timeframe trend is asserting dominance.

HTF Dominance: Identifies which higher timeframe is currently driving the overall bias the most. This tells you whether the daily, 4H, or 1H is the primary force behind the score.

Dimension Consensus: Averages each of the eight dimensions across all five timeframes to find which dimension is the strongest driver. If "TREND" is the strongest dimension, the trend alignment across timeframes is the primary force. If "VOLUME" is strongest, volume conviction is driving the bias.

Chart Features

1. Confluence Pressure Zones
When the confluence score stays extreme (above 70 or below 30) for a configurable minimum number of bars (default 5), the indicator draws a dashed box marking the price range during that period. These "pressure zones" represent areas where sustained multi-timeframe agreement created institutional accumulation or distribution. They often act as future support/resistance.

2. Regime Transition Lines
When the confluence score crosses from bullish to bearish territory (or vice versa), a labeled dashed line is drawn at the transition price. These lines show the exact price where the multi-timeframe consensus shifted — they act as institutional support/resistance levels that are derived from confluence rather than price structure.

3. Confluence Divergence Detector
When price makes a new 20-bar high but the confluence score is declining (or price makes a new low but the score is rising), the indicator marks a confluence divergence. This is a unique concept — it detects divergence between a multi-timeframe composite score and price action, which is fundamentally different from single-oscillator divergence.

4. Institutional Confluence Signals
Multi-condition filtered signals that fire when confluence score exceeds thresholds, velocity confirms, and a cooldown period has elapsed. These are the highest-conviction signals the indicator produces.

5. Gradient Confluence Candles
Candles are colored on a gradient from the bearish color (score near 0) to the bullish color (score near 100). This creates an instant visual read of confluence strength on every candle.

снимок

Input Parameters

Timeframes:
  • TF 1 through TF 5 (defaults: 5m, 15m, 60m, 240m, Daily) — all configurable


Scoring Parameters:
  • MA Length (27), ATR Length (14), BB Length (20), BB Mult (2.0)
  • CCI Length (23), ROC Length (50), RSI Length (14), Swing Length (10)


Institutional Features:
  • Gradient Confluence Candles, Confluence Pressure Zones, Regime Transition Lines
  • Confluence Divergence Boxes, Institutional Confluence Signals
  • Signal Cooldown (20 bars), Pressure Zone Min Bars (5)


How to Use This Indicator

Step 1: Read the Score
The confluence score (0-100) is your primary directional gauge. Above 60 = bullish bias. Below 40 = bearish bias. 40-60 = no clear edge — consider staying flat or reducing position size.

Step 2: Check TF Agreement
The dashboard shows how many timeframes agree. 4/5 or 5/5 agreement in one direction is a high-conviction setup. 2B/3S or similar splits suggest conflicting signals — proceed with caution.

Step 3: Monitor Score Velocity
A score of 72 that is "ACCEL UP" is more bullish than a score of 72 that is "FALLING." Velocity tells you whether the consensus is strengthening or weakening.

Step 4: Use Pressure Zones as S/R
When price returns to a previous pressure zone, expect a reaction. These zones represent areas where sustained multi-timeframe agreement existed — institutional memory.

Step 5: Watch for Confluence Divergences
If price is making new highs but the confluence score is declining, the multi-timeframe consensus is not confirming the move. This is a warning sign that the advance may stall or reverse.

Step 6: Trade Regime Transitions
When the score crosses from bearish to bullish territory (or vice versa), the regime transition line marks the pivot price. These transitions often produce sustained directional moves.

Limitations

  • The indicator uses request.security() to fetch data from five timeframes. On very low timeframes (1m), the higher timeframe data updates less frequently, which can create lag in the score.
  • The weighting system (higher TFs get more weight) is a design choice that works well for trend-following. Scalpers who trade against the higher timeframe trend may find the score misleading for their style.
  • Confluence score is a composite of mathematical calculations. A score of 80 does not mean "80% chance of going up" — it means 80% of the weighted analytical dimensions agree on a bullish reading.
  • The indicator evaluates current conditions, not future ones. A high confluence score can reverse quickly on unexpected news or institutional repositioning.
  • VWAP calculations may behave differently on instruments without continuous trading sessions.
  • Past confluence patterns do not guarantee future confluence patterns.


Originality Statement

This indicator is original in its systematic multi-dimensional, multi-timeframe confluence approach. While individual components (EMA trend, RSI, VWAP, etc.) are established concepts, this indicator is justified because:

  • It evaluates eight independent analytical dimensions simultaneously — not just trend and momentum, but also volatility state, market structure, volume conviction, RSI regime, VWAP bias, and ATR expansion
  • Each dimension is scored on five timeframes with weighted aggregation, producing 40 data points synthesized into a single actionable score
  • The Confluence Pressure Zone concept — marking areas where extreme multi-TF agreement persisted — creates institutional S/R levels derived from confluence rather than price structure
  • Regime Transition Lines mark the exact price where multi-timeframe consensus shifted, providing a unique form of dynamic support/resistance
  • Confluence Divergence Detection compares a multi-TF composite score against price action — fundamentally different from single-oscillator divergence
  • Score Velocity, Conviction Meter, Cross-TF Momentum Divergence, HTF Dominance, and Dimension Consensus provide meta-analysis of the confluence score itself
  • The integration of all these features with gradient candle coloring and a comprehensive dashboard creates a unified confluence analysis system not available in any single existing indicator


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss.

The confluence score is a mathematical composite of current market conditions across multiple timeframes. It does not predict future price movement. High confluence does not guarantee profitable trades. Market conditions can change rapidly, and past confluence patterns do not guarantee future patterns.

Always use proper risk management. Never risk more than you can afford to lose. The author is not responsible for any losses incurred from using this indicator.

-Made with passion by officialjackofalltrades

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.