OPEN-SOURCE SCRIPT

Precision Pivot Confluence Engine [JOAT]

249
Precision Pivot Confluence Engine

Introduction

The Precision Pivot Confluence Engine is an open-source technical indicator that combines Central Pivot Range (CPR) analysis with Smart Money Concepts (SMC), multi-oscillator divergence detection, and institutional order flow patterns. This mashup integrates multiple proven methodologies into a unified confluence system designed to identify high-probability trading zones where institutional and retail liquidity intersect.

The indicator is built for traders who understand that no single signal provides consistent edge, but multiple confirming factors working together can significantly improve trade selection. By synthesizing CPR levels, Fair Value Gaps, Order Blocks, liquidity sweeps, and divergence patterns, this tool helps identify structural market inflection points.

Snapshot
Chart showing CPR levels, FVG zones, Order Blocks, and divergence signals on 4H timeframe

Why This Mashup Exists

This indicator combines five distinct analytical frameworks that complement each other:

  • CPR Analysis: Identifies key pivot levels where institutional algorithms and retail traders make decisions
  • Smart Money Concepts: Tracks Fair Value Gaps, Order Blocks, and Breaker Blocks showing institutional positioning
  • Divergence Detection: Uses RSI, MACD, and Stochastic RSI to identify momentum exhaustion
  • Liquidity Analysis: Detects liquidity sweeps where stop hunts occur before reversals
  • Volume Confirmation: Validates moves with volume analysis and delta calculations


Each component addresses a different aspect of market structure. CPR provides static reference levels, SMC reveals dynamic institutional behavior, divergences show momentum shifts, liquidity sweeps identify stop hunts, and volume confirms genuine moves versus noise. Together, they create a multi-dimensional view of market conditions.

Core Components Explained

1. Enhanced CPR System

The Central Pivot Range system calculates Daily and Weekly pivot levels using the formula:
Pine Script®
Pivot = (High + Low + Close) / 3 BC (Bottom Central) = (High + Low) / 2 TC (Top Central) = (Pivot - BC) + Pivot


The indicator analyzes CPR width to determine market regime:
  • Narrow CPR (width < 0.5%): Indicates compression and potential breakout conditions
  • Wide CPR (width > 1.5%): Suggests ranging market with less directional conviction
  • Price position relative to CPR: Above both Daily and Weekly pivots = bullish structure, below = bearish structure


CPR levels act as magnetic zones where price tends to react. The indicator tracks distance from pivots to identify overextension and mean reversion opportunities.

2. Smart Money Concepts Integration

Fair Value Gaps (FVG):
Bullish FVG occurs when current low > high from 2 bars ago, leaving an unfilled gap
Bearish FVG occurs when current high < low from 2 bars ago

The indicator calculates FVG size as percentage of price and filters for significant gaps (> 0.3%) to avoid noise. FVGs represent inefficient price delivery where institutions moved price quickly, often returning to fill these gaps later.

Order Blocks (OB):
Bullish OB: Two consecutive bearish candles followed by strong bullish candle with high volume
Bearish OB: Two consecutive bullish candles followed by strong bearish candle with high volume

Order Blocks mark the last opposite-direction move before a strong impulse, indicating where institutions accumulated or distributed positions.

Breaker Blocks:
Failed Order Blocks that get violated become Breaker Blocks, signaling potential trend reversal. The indicator tracks the last bullish and bearish OB levels and alerts when price breaks through them.

Liquidity Sweeps:
The indicator identifies when price briefly exceeds recent highs/lows (20-bar lookback) but closes back inside the range. These "stop hunts" often precede reversals as institutions trigger retail stops before moving price in the intended direction.

Snapshot
Example showing FVG zones, Order Blocks, and liquidity sweep markers

3. Multi-Oscillator Divergence System

The indicator simultaneously tracks divergences across three oscillators:

RSI Divergence:
  • Bullish: Price makes lower low, RSI makes higher low (momentum improving despite price weakness)
  • Bearish: Price makes higher high, RSI makes lower high (momentum deteriorating despite price strength)


MACD Divergence:
Tracks histogram divergences using the same pivot-based logic

Stochastic RSI Divergence:
More sensitive than RSI, catches early momentum shifts

The indicator uses a 5-bar pivot lookback to identify swing highs/lows and compares current pivots with previous pivots to detect divergences. When multiple oscillators show divergence simultaneously, it signals strong momentum exhaustion.

4. Volume Analysis Engine

  • Volume MA Comparison: Identifies high volume (> 1.5x MA) and climax volume (> 3x MA)
  • Volume Delta: Cumulative difference between buying volume (green candles) and selling volume (red candles)
  • Delta Trend: Compares current delta to 20-period MA to identify institutional accumulation or distribution
  • Volume Confirmation: Validates bullish moves with high volume + rising delta, bearish moves with high volume + falling delta


5. Confluence Scoring System

The indicator calculates a real-time confluence score (0-100) by weighting each component:

Pine Script®
Confluence Score Components: - CPR Position: Up to 15 points (bullish above pivots, bearish below) - SMC Signals: Up to 10 points (FVG + OB + Breaker + Liquidity Sweeps) - Divergence: Up to 10 points (single oscillator = 5, multiple = 10) - Volume: Up to 10 points (confirmed volume = 7, climax = additional 3) - Trend Alignment: Up to 5 points (price vs key MAs)


Scores above 70 indicate strong confluence for potential trades. The dashboard displays individual component scores for transparency.

Visual Elements

  • CPR Lines: Daily Pivot (yellow), TC/BC (yellow transparent), Weekly Pivot (yellow circles)
  • FVG Boxes: Green boxes for bullish FVGs, red boxes for bearish FVGs
  • Order Block Boxes: Solid green/red boxes marking institutional zones
  • Breaker Block Labels: "BB" markers when Order Blocks fail
  • Liquidity Sweep Labels: "LIQ" and "STRONG LIQ" positioned at sweep tips
  • Divergence Labels: "D" markers at divergence pivot points
  • Dashboard: Top-right table showing confluence score and component breakdown



How Components Work Together

The mashup creates a layered analysis approach:

Layer 1 - Structure: CPR levels define key zones where reactions are likely
Layer 2 - Institutional Behavior: SMC concepts show where smart money is positioned
Layer 3 - Momentum: Divergences indicate when current trend is losing steam
Layer 4 - Confirmation: Volume validates whether moves are genuine or false
Layer 5 - Synthesis: Confluence score combines all factors into actionable signal

Example scenario: Price approaches Daily Pivot (Layer 1) where a bullish Order Block exists (Layer 2), RSI shows bullish divergence (Layer 3), and volume delta is rising (Layer 4). The confluence score jumps to 85 (Layer 5), signaling high-probability long setup.

Input Parameters

CPR Settings:
  • Show Daily CPR: Toggle daily pivot levels (default: enabled)
  • Show Weekly CPR: Toggle weekly pivot levels (default: enabled)
  • CPR Width Threshold: Defines narrow vs wide CPR (default: 0.5% / 1.5%)


Smart Money Concepts:
  • Show FVG: Display Fair Value Gap boxes (default: enabled)
  • Show Order Blocks: Display Order Block boxes (default: enabled)
  • Show Breaker Blocks: Display Breaker Block labels (default: enabled)
  • Show Liquidity Sweeps: Display liquidity sweep markers (default: enabled)
  • FVG Min Size: Minimum gap size to display (default: 0.3%)
  • Lookback Bars: Bars to scan for liquidity levels (default: 20)


Divergence Detection:
  • Show Divergences: Toggle divergence labels (default: enabled)
  • RSI Length: Period for RSI calculation (default: 14)
  • Pivot Lookback: Bars for pivot detection (default: 5)


Volume Analysis:
  • Show Volume Analysis: Toggle volume indicators (default: enabled)
  • Volume MA Length: Period for volume moving average (default: 20)
  • High Volume Multiplier: Threshold for high volume (default: 1.5x)
  • Climax Volume Multiplier: Threshold for climax volume (default: 3.0x)


Display Options:
  • Show Dashboard: Toggle confluence score table (default: enabled)
  • Max FVG Boxes: Limit displayed FVG boxes (default: 20)
  • Max OB Boxes: Limit displayed Order Block boxes (default: 15)
  • Label Spacing: Minimum bars between labels to prevent overlap (default: 10-15)


How to Use This Indicator

Step 1: Identify Market Structure
Check CPR position and width. Narrow CPR suggests breakout potential, wide CPR suggests range-bound conditions.

Step 2: Look for SMC Confluence
Identify FVGs, Order Blocks, and recent liquidity sweeps. These zones often provide high-probability entry areas.

Step 3: Check for Divergences
Look for divergence labels at swing points. Multiple oscillator divergences increase signal strength.

Step 4: Confirm with Volume
Ensure volume supports the move. Rising delta + high volume confirms bullish moves, falling delta + high volume confirms bearish moves.

Step 5: Review Confluence Score
Check the dashboard. Scores above 70 indicate strong confluence. Individual component scores show which factors are contributing.

Step 6: Wait for Price Action Confirmation
The indicator identifies zones and conditions, but wait for price action confirmation (candlestick patterns, breakouts, etc.) before entering trades.

Best Practices

  • Use on 15-minute to 4-hour timeframes for optimal signal quality
  • Combine with proper risk management - indicator shows zones, not exact entries
  • Pay attention to confluence score - higher scores generally indicate better setups
  • Watch for FVG fills and Order Block retests as entry triggers
  • Liquidity sweeps followed by reversal often provide excellent risk:reward entries
  • Divergences work best when combined with SMC zones or CPR levels
  • Volume confirmation is critical - avoid low-volume signals


Indicator Limitations

  • Does not provide exact entry/exit signals - requires trader interpretation
  • Can generate false signals in choppy, low-volume conditions
  • Multiple visual elements may clutter chart - adjust display settings as needed
  • Divergences can persist longer than expected - price can continue trending despite divergence
  • FVGs and Order Blocks don't always get retested - not every zone provides entry opportunity
  • Confluence score is a guide, not a guarantee - high scores can still result in losing trades
  • Requires understanding of SMC concepts and CPR analysis for effective use
  • Performance varies across different markets and timeframes


Technical Implementation

Built with Pine Script v6 using:
  • Custom CPR calculations with width analysis
  • Box and label management with anti-overlap logic
  • Persistent variables for tracking Order Blocks and Breaker Blocks
  • Pivot-based divergence detection across multiple oscillators
  • Volume delta calculation with cumulative tracking
  • Real-time confluence scoring system
  • Dynamic dashboard with component breakdown


The code is fully open-source and can be modified to suit individual trading styles and preferences.

Originality Statement

This indicator is original in its integration approach. While individual components (CPR, FVG, Order Blocks, RSI divergence, volume analysis) are established concepts, this mashup is justified because:

  • It synthesizes five distinct methodologies that address different market aspects
  • The confluence scoring system provides quantitative measurement of setup quality
  • Anti-overlap logic and timeframe-adaptive filtering reduce visual clutter
  • Component integration creates layered analysis not available in individual indicators
  • The combination helps identify zones where multiple institutional and technical factors align


Each component contributes unique information: CPR provides static structure, SMC reveals dynamic institutional behavior, divergences show momentum shifts, liquidity analysis identifies stop hunts, and volume confirms genuine moves. The mashup's value lies in presenting these complementary perspectives simultaneously with a unified scoring system.

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 and is not suitable for all investors.

Technical indicators are tools for analysis, not crystal balls. Past performance and backtested results do not guarantee future performance. Market conditions change, and strategies that worked historically may not work in the future.

The confluence score is a mathematical calculation based on current market data, not a prediction of future price movement. High confluence scores do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.

Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.

The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.

-Made with passion by officialjackofalltrades

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.