Indicator

Precision Edge System [JOAT]Precision Edge System
Introduction
The Precision Edge System is an advanced open-source multi-timeframe trading strategy that combines Opening Range Breakout, Fair Value Gap detection, Break of Structure analysis, Order Block identification, Fibonacci confluence, volatility regime classification, multi-oscillator divergence, RSI-2 mean reversion, and adaptive risk management into a unified institutional-grade trading system. This strategy helps traders capture high-probability setups by requiring multiple independent confirmation signals before entering trades, significantly reducing false signals and improving win rates.
Unlike basic strategies that rely on single indicators, this system uses a confluence scoring approach where each component contributes points toward entry decisions. Opening Range provides context, Fair Value Gaps provide entry zones, Market Structure confirms direction, Order Blocks show institutional positioning, Fibonacci shows harmonic levels, Regime Detection filters conditions, Divergence warns of reversals, and RSI-2 catches pullbacks. The strategy is designed for traders who understand that the best setups occur when multiple institutional concepts align simultaneously.
Why This Strategy Exists
This strategy addresses the fundamental challenge of trading: most single-indicator strategies produce too many false signals or miss too many opportunities. By combining multiple institutional concepts with flexible confluence requirements, this strategy reveals:
Opening Range Breakout: First 30 minutes establish institutional positioning - breakouts signal directional commitment
Fair Value Gap Retests: Price imbalances that get filled - optimal entry zones with defined risk
Break of Structure: Swing high/low breaks confirm trend direction and momentum
Order Blocks: Last opposing candle before strong moves - institutional accumulation/distribution zones
Premium/Discount Arrays: Value context showing whether price is expensive or cheap
Fibonacci Confluence: Golden Pocket and multi-wave alignment for reversal zones
Volatility Regime Detection: Trending/Ranging/Choppy classification to avoid bad conditions
Multi-Oscillator Divergence: RSI/MACD/Stochastic divergence for reversal signals
RSI-2 Mean Reversion: Extreme oversold/overbought in trends for pullback entries
Session-Based Timing: London/New York kill zones for highest liquidity
Adaptive Risk Management: Dynamic stop loss, take profit, and trailing stops based on volatility
Each component provides independent confirmation. The strategy's power comes from requiring multiple components to align before entering trades, creating high-probability setups with favorable risk-reward ratios.
Core Strategy Components
1. Opening Range Breakout (ORB) System
The Opening Range is established during the first 30 minutes of the trading session (9:30-10:00 AM by default):
// Track high/low during OR session
if inOR:
orHigh = max(high, orHigh)
orLow = min(low, orLow)
// Detect breakouts after OR established
orBreakoutUp = close > orHigh and close <= orHigh
orBreakoutDown = close < orLow and close >= orLow
Opening Range logic:
First 30 minutes = institutions establish positions
OR High/Low define the day's initial range
Breakouts above OR High = bullish bias
Breakouts below OR Low = bearish bias
OR levels used as stop loss reference points
The strategy can operate in two modes:
Breakout Required: Only trades after OR breakout (more selective)
Flexible: Trades inside OR if other confluence is strong (more frequent)
ORB contributes 2 points to confluence score when breakout occurs.
2. Fair Value Gap (FVG) Entry System
Fair Value Gaps are three-candle price imbalances that often get filled:
// Bullish FVG: Current low > 2 candles ago high
bullishFVG = low > high
fvgBullTop = low
fvgBullBottom = high
// Entry on retest
fvgBullRetest = low <= fvgBullTop and close >= fvgBullBottom
FVG entry logic:
Identifies imbalance zones where price moved too fast
Waits for price to return to the gap (retest)
Enters at gap high (bullish) or gap low (bearish)
Provides precise entry with tight stop below/above gap
FVG retest contributes 2 points to confluence score. The strategy tracks active FVGs and removes them when filled.
3. Market Structure (BOS/CHoCH) Confirmation
Break of Structure confirms trend direction:
// Detect swing highs/lows
swingPivotHigh = ta.pivothigh(high, 5, 5)
swingPivotLow = ta.pivotlow(low, 5, 5)
// BOS: Price breaks swing in trend direction
if swingPivotHigh > lastSwingHigh and bullishStructure:
bosOccurred = true // Bullish BOS
Structure logic:
Tracks swing highs and lows using pivot detection
BOS = break in trend direction (continuation)
CHoCH = break against trend (potential reversal)
Internal structure shows nested patterns for timing
The strategy can operate in two modes:
BOS Required: Only trades after structure break (more selective)
Flexible: Trades without BOS if other confluence is strong (more frequent)
BOS contributes 2 points to confluence score when it occurs.
4. Order Block Detection and Mitigation
Order Blocks mark institutional positioning zones:
// Bullish OB: Last bearish candle before strong bullish move
bullishOB = close < open and close > open and
(high - low) > atr * 1.2 and
volume > avgVol * 1.1
Order Block logic:
Identifies last opposing candle before momentum shift
Requires volume and ATR confirmation
Strength classification (Strong = 4+ points, Normal = 2-3 points)
Tracks active blocks until mitigated (price closes through)
Active Order Blocks contribute 1 point to confluence score. Strong Order Blocks (high volume + high ATR) contribute an additional 1 point.
5. Premium/Discount Array Context
Premium/Discount Arrays show value context:
rangeHigh = ta.highest(high, 50)
rangeLow = ta.lowest(low, 50)
rangeEQ = (rangeHigh + rangeLow) / 2
inPremium = close > rangeEQ and close > (rangeEQ + (rangeHigh - rangeEQ) * 0.5)
inDiscount = close < rangeEQ and close < (rangeEQ - (rangeEQ - rangeLow) * 0.5)
Value Array logic:
Calculates 50-period range high/low
Equilibrium = 50% level (fair value)
Premium = upper 50% of range (expensive)
Discount = lower 50% of range (cheap)
Institutional bias: Buy discount, sell premium
Being in discount zone contributes 1 point to long confluence. Being in premium zone contributes 1 point to short confluence.
6. Fibonacci Confluence and Golden Pocket
Fibonacci analysis identifies harmonic reversal zones:
// Calculate Fibonacci levels from swing
fib618 = swingLow + (swingHigh - swingLow) * 0.618
fib650 = fib618 * 1.052
// Golden Pocket = 0.618 to 0.65 zone
inGoldenZone = close >= min(fib618, fib650) and close <= max(fib618, fib650)
Fibonacci logic:
Calculates Fibonacci retracements from multiple swing lengths
Golden Pocket (0.618-0.65) = highest probability reversal zone
Extensions (1.272, 1.414, 1.618) used for profit targets
Confluence zones where multiple Fib levels align
Being in Golden Pocket contributes 1 point to both long and short confluence (reversal zone).
7. Volatility Regime Filter
Regime detection classifies market conditions:
atr = ta.atr(14)
atrSma = ta.sma(atr, 50)
volRatio = atr / atrSma
// Trending: EMAs aligned + normal volatility
trendStrength = (ema9 > ema21 and ema21 > ema50) or
(ema9 < ema21 and ema21 < ema50)
regime = volRatio > 1.5 ? 0 : // Choppy
trendStrength ? 2 : // Trending
1 // Ranging
Regime logic:
Trending (2): Directional market, use breakout strategies
Ranging (1): Oscillating market, use mean reversion
Choppy (0): Erratic market, avoid trading
The strategy can operate in two modes:
Avoid Choppy: No trades in choppy regime (more selective)
Trade All: Trades in all regimes if confluence is strong (more frequent)
Regime filter prevents trading in unfavorable conditions.
8. Multi-Oscillator Divergence Detection
Divergence analysis identifies momentum exhaustion:
// Bullish divergence: Price LL, RSI HL
if pricePivotLow < lastPriceLow and rsiPivotLow > lastRsiLow:
bullish_divergence = true
Divergence logic:
Regular divergence = potential reversal signal
Hidden divergence = trend continuation signal
Requires extreme zones (RSI >70 or <30) for best setups
Multi-oscillator confluence increases reliability
Bullish divergence contributes 2 points to long confluence. Bearish divergence contributes 2 points to short confluence.
9. RSI-2 Mean Reversion System
RSI-2 catches extreme pullbacks in trends:
rsi2 = ta.rsi(close, 2)
ema200 = ta.ema(close, 200)
// Long: RSI-2 oversold in uptrend
rsi2_oversold = rsi2 < 10 and close > ema200
// Short: RSI-2 overbought in downtrend
rsi2_overbought = rsi2 > 90 and close < ema200
RSI-2 logic:
2-period RSI is extremely sensitive to pullbacks
Oversold (<10) in uptrend = buy the dip
Overbought (>90) in downtrend = sell the rally
Requires 200 EMA trend filter for context
RSI-2 signals contribute 2 points to confluence score.
10. Candlestick Pattern Recognition
The strategy detects reversal patterns:
Hammer: Long lower wick, small body, bullish reversal
Shooting Star: Long upper wick, small body, bearish reversal
Bullish Engulfing: Bullish candle engulfs previous bearish candle
Bearish Engulfing: Bearish candle engulfs previous bullish candle
Morning Star: Three-candle bullish reversal pattern
Evening Star: Three-candle bearish reversal pattern
Strong patterns (with volume confirmation) contribute 2 points to confluence score.
11. Session-Based Timing (Kill Zones)
The strategy focuses on high-liquidity sessions:
London Session: 2:00-5:00 AM EST (default)
New York Session: 8:30-11:00 AM EST (default)
Silver Bullet: 9:00-10:00 AM EST (default)
Session logic:
Highest volume and volatility during these periods
Institutional participation is strongest
Better follow-through on breakouts
Can be disabled for 24-hour trading
Confluence Scoring System
The strategy uses a point-based confluence system where each component contributes points:
Long Confluence Points:
OR Breakout Up: +2 points
BOS Bullish: +2 points
FVG Bull Retest: +2 points
Active Bullish OB: +1 point
Strong Bullish OB: +1 point (bonus)
In Discount Zone: +1 point
In Golden Pocket: +1 point
RSI-2 Oversold: +2 points
Bullish Divergence: +2 points
Liquidity Below: +1 point
Volume Spike: +1 point
Bullish Momentum: +1 point
Bullish Pattern: +2 points
Entry Modes (Configurable):
Strict Mode: Requires 8+ points (very selective, highest quality)
Moderate Mode: Requires 6+ points (balanced approach)
Flexible Mode: Requires 4+ points (more frequent trades)
Aggressive Mode: Requires 3+ points (highest frequency)
This flexible system allows traders to adjust trade frequency based on their preference and market conditions.
Risk Management System
1. Stop Loss Placement:
The strategy uses intelligent stop loss placement:
OR-Based Stops: If OR is active, stop = OR Low (long) or OR High (short)
ATR-Based Stops: If no OR, stop = Entry ± (2 × ATR)
Structure-Based Stops: Can use swing lows/highs for stops
2. Position Sizing:
Risk-based position sizing:
accountRisk = strategy.equity * (riskPercent / 100) // Default 1%
riskPerShare = entry - stopLoss
positionSize = accountRisk / riskPerShare
This ensures consistent risk per trade regardless of stop distance.
3. Take Profit Targets:
Adaptive take profit based on volatility:
// Base reward multiple (default 2R)
tpMultiplier = rewardMultiple
// Increase in high volatility
if volatility_high:
tpMultiplier = rewardMultiple * 1.5
takeProfit = entry + (riskPerShare * tpMultiplier)
Default 2R target (2x risk) provides favorable risk-reward. High volatility increases target to 3R.
4. Trailing Stop System:
Adaptive trailing stop activates after profit threshold:
Activates after 1R profit (default)
Trails at breakeven + 0.5R
Locks in profits while allowing trend to run
Adjusts trail distance based on ATR
5. Time-Based Exits:
End-of-day exit prevents overnight risk:
Closes all positions at 3:55 PM EST (default)
Prevents gap risk and overnight exposure
Can be disabled for swing trading
6. Daily Trade Limit:
Maximum trades per day prevents overtrading:
Default: 10 trades per day maximum
Resets at start of each trading day
Prevents revenge trading and overexposure
Strategy Performance Metrics
The strategy displays real-time performance in the dashboard:
Confluence Scores: Current long/short confluence (0-20 scale)
OR Status: Active/Forming
Structure: Bullish/Bearish
BOS Signal: Confirmed/Pending
Regime: Trending/Ranging/Choppy
Value Zone: Premium/Discount/Equilibrium
RSI State: Overbought/Oversold/Neutral
Volatility: High/Normal/Low
Volume: Spike/High/Dry/Normal
Position: Long/Short/Flat
Net P/L: Current profit/loss
Win Rate: Percentage of winning trades
Total Trades: Number of closed trades
Profit Factor: Gross profit / Gross loss
Input Parameters
Trade Frequency:
Entry Mode: Strict/Moderate/Flexible/Aggressive
Min Confluence Score: 1-10 (lower = more trades)
Allow Partial Setups: Trade with 2/3 conditions met
Opening Range:
OR Session: Time range for OR (default 9:30-10:00)
ORB Filter: Enable/disable OR requirement
Fibonacci Extensions: Show extension levels
Breakout Required: Must break OR to trade
Market Structure:
Fractal Period: Swing detection length (default 5)
Require BOS/CHoCH: Must have structure break
Multi-TF Confluence: Check higher timeframe
Internal Structure: Show nested patterns
Order Blocks:
OB Filter: Enable/disable OB requirement
Volatility Threshold: ATR multiplier (default 1.2)
Volume Threshold: Volume multiplier (default 1.1)
Block Quality: All/Strong/Extreme
Fair Value Gaps:
FVG Entry: Enable/disable FVG entries
Min Imbalance: Percentage threshold (default 0.2%)
Zone Quality: All/Strong/Extreme
Auto-Fill Detection: Remove filled gaps
Risk Management:
Risk Per Trade: Percentage of equity (default 1%)
Reward Multiple: R multiple for TP (default 2.0)
Adaptive Take Profit: Adjust TP for volatility
EOD Exit: Close positions at end of day
Adaptive Trailing Stop: Enable trailing stops
Trail Activation: R multiple to activate (default 1.0)
Max Daily Trades: Limit trades per day (default 10)
How to Use This Strategy
Step 1: Configure Entry Mode
Choose entry mode based on desired trade frequency. Strict = fewer high-quality trades. Flexible = more frequent trades. Start with Moderate.
Step 2: Set Risk Parameters
Configure risk per trade (1% recommended), reward multiple (2R recommended), and position sizing. Never risk more than you can afford to lose.
Step 3: Enable Desired Components
Turn on/off components based on your trading style. All components enabled = most selective. Fewer components = more frequent trades.
Step 4: Monitor Dashboard
Watch confluence scores in real-time. Long score >6 = potential long setup. Short score >6 = potential short setup. Higher scores = better setups.
Step 5: Review Entry Labels
When strategy enters, it displays label with entry price, stop loss, take profit, and confluence score. Review to understand why trade was taken.
Step 6: Let Strategy Manage Exits
Strategy handles stop loss, take profit, trailing stops, and EOD exits automatically. Don't interfere with exits unless necessary.
Step 7: Analyze Performance
Review dashboard metrics regularly. Win rate >50%, profit factor >1.5, and positive net P/L indicate good performance.
Best Practices
Start with Moderate mode and adjust based on results
Higher confluence scores = higher win rates but fewer trades
Backtest thoroughly before live trading
Use realistic commission (0.075%) and slippage
Respect regime filter - avoid choppy markets
Session filter improves quality - trade kill zones
EOD exit prevents overnight risk for day traders
Daily trade limit prevents overtrading
Monitor dashboard for real-time confluence
Adjust parameters for different instruments and timeframes
Strategy Limitations
Confluence system can miss trades when components don't align
Multiple filters reduce trade frequency significantly
Backtesting results may not reflect live performance
Slippage and commission impact profitability
News events can invalidate technical setups
Regime detection may lag at transitions
Opening Range less reliable on low-volume days
Fair Value Gaps may not fill immediately
Order Blocks can fail in strong trends
Divergences can persist before reversing
The strategy shows high-probability setups, not guaranteed winners
Technical Implementation
Built with Pine Script v6 using:
Opening Range tracking with session detection
Fair Value Gap detection and retest monitoring
Market structure analysis with BOS/CHoCH detection
Order Block identification with strength classification
Premium/Discount Array calculations
Fibonacci confluence and Golden Pocket detection
Volatility regime classification system
Multi-oscillator divergence detection
RSI-2 mean reversion signals
Candlestick pattern recognition
Session-based timing filters
Confluence scoring algorithm
Adaptive risk management system
Real-time performance dashboard
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This strategy is original in its comprehensive institutional integration approach. While individual components (ORB, FVG, BOS, OB, Fibonacci, RSI, MACD) are established concepts, this strategy is justified because:
It synthesizes 11 distinct institutional concepts into unified confluence scoring system
The flexible entry mode system allows traders to adjust selectivity vs frequency
Adaptive risk management adjusts stops and targets based on volatility
Multi-component confluence significantly reduces false signals vs single-indicator strategies
Session-based timing focuses on high-liquidity periods for better execution
Regime filter prevents trading in unfavorable market conditions
Candlestick pattern integration adds reversal confirmation layer
Real-time dashboard presents 15 metrics simultaneously for complete strategy visibility
The strategy combines trend-following (BOS, ORB) with mean-reversion (RSI-2, Divergence) for versatility
Each component contributes independent confirmation: ORB shows context, FVG shows entry, BOS shows direction, OB shows positioning, Arrays show value, Fibonacci shows harmonics, Regime shows conditions, Divergence shows exhaustion, RSI-2 shows pullbacks, Patterns show reversals, and Sessions show timing. The strategy's value lies in requiring multiple components to align before entering trades, creating high-probability setups with favorable risk-reward ratios.
Disclaimer
This strategy 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.
Past performance does not guarantee future results. Backtesting results are hypothetical and may not reflect actual trading performance. Actual results will vary due to slippage, commission, market conditions, and execution differences. The strategy may experience periods of drawdown and losing trades.
High confluence scores do not guarantee profitable trades. Market conditions change, and strategies that worked historically may not work in the future. News events, market shocks, and fundamental factors can override technical setups.
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 strategy. Users assume full responsibility for all trading decisions made using this tool.
Recommended Settings for Backtesting
Initial Capital: $10,000 (realistic for average trader)
Commission: 0.075% per trade (realistic for most brokers)
Slippage: 1-2 ticks (depends on instrument liquidity)
Risk Per Trade: 1% of equity
Reward Multiple: 2R (2:1 risk-reward)
Entry Mode: Moderate (6+ confluence)
Timeframe: 5-minute or 15-minute chart
Instruments: Liquid stocks, forex majors, or major crypto
Sample Size: Minimum 100 trades for statistical significance
-Made with passion by officialjackofalltrades Strategy

Fibonacci Volume Confluence Engine [PhenLabs]📊 Fibonacci Volume Confluence Engine
Version: PineScript™ v6
📌 Description
The Fibonacci Volume Confluence Engine is a multi-layered confluence detection system that combines ATR-filtered swing pivot detection with a bar-by-bar volume profile to automatically identify and score every Fibonacci retracement level by the volume traded within it. Rather than drawing static lines and leaving interpretation to the trader, this engine classifies each level as Strong, Moderate, or Weak based on real market participation — separating the levels the market genuinely respects from those it simply passes through.
At its core, the indicator anchors Fibonacci retracements to structurally confirmed swing highs and lows, filtered by ATR distance to eliminate noise. A rolling volume histogram is then constructed over a configurable lookback window and mapped against each of the seven Fibonacci levels. The result is a set of visually distinct confluence zones on your chart, backed by quantified volume data rather than discretionary judgment.
Beyond Fibonacci, the engine incorporates Break of Structure and Change of Character detection from the confirmed swing sequence, an optional Multi-Timeframe Fibonacci overlay sourced from any higher timeframe, and a live on-chart dashboard summarising trend direction, key levels, confluence counts, and the most recent structure signal — making it a complete structural analysis tool rather than a single-purpose retracement drawer.
🚀 Points of Innovation
Volume-scored Fibonacci levels — every level is quantitatively graded by the concentration of volume traded within its price zone, not by subjective confluence counting
ATR-adaptive pivot filtering — swing highs and lows are only accepted when their distance from the opposing swing meets a minimum ATR multiple, keeping anchors structurally meaningful across all instruments and timeframes
Manual bar-loop volume profile — the histogram is built with a direct bar iteration loop rather than built-in functions with series-length limitations, guaranteeing stable computation from the very first confirmed pivot
Integrated BOS and CHoCH detection — structure breaks are classified as either continuation or reversal signals based on the confirmed swing sequence, with five individual alert conditions
Multi-timeframe Fibonacci overlay — a second independent Fibonacci set sourced from any higher timeframe can be displayed simultaneously on the current chart with its own style controls
🔧 Core Components
ATR-Filtered Swing Engine: Detects pivot highs and lows using configurable lookback length, then filters each candidate by requiring a minimum ATR-scaled distance from the opposing swing. Only structurally significant pivots are accepted as Fibonacci anchors.
Fibonacci Retracement Layer: Draws the seven standard levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%) from the most recent confirmed swing pair. Direction is automatically set to bullish or bearish based on which swing type was most recently confirmed.
Volume Profile Engine: Iterates over up to 500 bars, assigns each bar’s volume to a price bin based on its midpoint, and builds a 10–50 bin histogram over the configurable lookback window. Uses array pre-allocation with set-based zero-filling for runtime stability.
Confluence Classifier: Maps each Fibonacci level to its corresponding volume bin, sums the center bin plus weighted adjacent bins for a smoothed reading, then classifies the result as Strong (top 30%), Moderate (40–70%), or Weak (20–40%) relative to the peak bin.
BOS and CHoCH Detector: Compares the last two confirmed swing highs and lows to determine trend direction (HH+HL = uptrend, LH+LL = downtrend), then monitors for close-based breaks of the most recent swing level in both the trend direction and against it.
HTF Fibonacci Overlay: Requests pivot data from a user-selected higher timeframe via request.security, tracks the most recent HTF swing pair, and draws a separate Fibonacci set with independent color, line style, and width controls.
Information Dashboard: A 2-column, 10-row table rendered on the last bar displaying trend direction, Fibonacci type, swing prices, ATR, the 61.8% level, confluence summary, HTF status, and last structure signal.
🔥 Key Features
Volume-Backed Confluence Zones: Each Fibonacci level that registers meaningful volume concentration is highlighted with a shaded zone box and a strength label (◆ Strong / ◇ Moderate / · Weak), so the most significant levels stand out immediately without any manual assessment.
Fully Configurable Fibonacci Display: Line width, label size, extension length, and individual level colors are all independently adjustable, allowing the Fibonacci overlay to be styled to suit any chart theme or personal preference.
BOS and CHoCH Signals with Alerts: Break of Structure and Change of Character labels are plotted directly on the bar where the break occurs, with five alert conditions covering each signal type individually and a combined catch-all.
Multi-Timeframe Fibonacci Overlay: Enable a second Fibonacci set from any higher timeframe (default: Daily) and display it alongside the current timeframe levels with a distinct color and line style to provide macro structural context.
Live On-Chart Dashboard: All key data — trend, Fibonacci direction, swing prices, ATR, the golden ratio level, confluence counts, HTF status, and last signal — is displayed in a compact table that updates on every bar close.
ATR Pivot Filter: The ATR multiplier filter can be tuned from 0.1 to 5.0, giving full control over how aggressively noise is filtered. Higher values produce fewer, more significant pivots suitable for higher timeframe analysis.
🎨 Visualization
Fibonacci Level Lines: Seven horizontal lines extend forward from the most recent swing anchor point for a configurable number of bars. Each level has its own independent color input. The 50% level is rendered as a dashed line to distinguish it from the structural levels.
Fibonacci Level Labels: A text label is placed at the right end of each line showing the ratio name and exact price, styled with the corresponding level color against a transparent background for chart cleanliness.
Confluence Zone Boxes: Where a Fibonacci level overlaps a significant volume bin, a semi-transparent shaded box spans the full line extension at the width of ATR × the tolerance multiplier. Color reflects strength: green for Strong, yellow for Moderate, grey for Weak.
Confluence Strength Labels: A small icon and text label (◆ Strong, ◇ Moderate, · Weak) is placed just beyond each confluence zone box, color-matched to the zone, for instant strength identification without inspecting the box fill.
HTF Fibonacci Lines and Labels: The higher-timeframe Fibonacci set is drawn in its own color with a selectable line style (Solid, Dashed, or Dotted) and prefixed with “HTF” in the label text to distinguish it from the current timeframe levels.
Pivot Markers: Confirmed swing highs are marked with a small downward triangle above the bar; confirmed swing lows with a small upward triangle below, using independently configurable colors.
BOS and CHoCH Labels: Structure signal labels appear directly on the signal bar — below the bar for bullish signals and above for bearish — in their respective configured colors with white text.
Information Dashboard: A dark-themed 2×10 table rendered in the selected corner showing all key indicator state values, with color-coded text reflecting bullish (teal), bearish (red), and neutral (grey) conditions.
📖 Usage Guidelines
Swing Pivot Detection
Pivot Lookback Length — Default: 10 | Range: 3–50 — Controls how many bars on each side of a candidate pivot must be lower (for highs) or higher (for lows) to confirm the pivot. Increase for fewer, more major swings; decrease for more reactive pivots.
ATR Period — Default: 14 | Range: 1–100 — The ATR period used to compute the minimum distance filter. A standard 14-period ATR works well for most instruments.
ATR Filter Multiplier — Default: 0.5 | Range: 0.1–5.0 — The minimum distance between a new pivot and the opposing swing, expressed as a multiple of ATR. Increase to require more separation and reduce noise; decrease to accept closer pivots.
Fibonacci Levels
Show Fibonacci Levels — Default: On — Master toggle for all Fibonacci lines and labels.
Fibonacci Line Extension — Default: 50 | Range: 10–200 — How many bars forward the Fibonacci lines extend from the anchor point.
Fibonacci Line Width — Default: 1 | Range: 1–4 — Pixel width of all Fibonacci level lines.
Label Size — Default: Small | Options: Tiny, Small, Normal — Size of the Fibonacci level labels.
Level Colors (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%) — Independent color inputs for each level, allowing full visual customization.
Volume Profile and Confluence
Show Confluence Zones — Default: On — Master toggle for all confluence zone boxes and labels.
Volume Lookback Period — Default: 100 | Range: 20–500 — Number of historical bars included in the volume histogram. Longer lookbacks produce a more stationary profile; shorter lookbacks reflect recent volume distribution.
Volume Profile Bins — Default: 25 | Range: 10–50 — Number of price buckets in the histogram. More bins give finer resolution; fewer bins give broader zone detection.
Confluence Zone Width (ATR%) — Default: 0.5 | Range: 0.1–2.0 — Height of the shaded confluence box as a multiple of ATR. Increase for wider, more visible zones; decrease for tighter, more precise zones.
Strong / Moderate / Weak Confluence Colors — Independent color inputs for each confluence tier.
Multi-Timeframe Fibonacci
Enable HTF Fibonacci — Default: Off — Enables the higher-timeframe Fibonacci overlay.
Higher Timeframe — Default: D — The timeframe from which swing pivots are sourced for the HTF overlay.
HTF Pivot Lookback — Default: 10 | Range: 3–50 — Pivot lookback length applied on the higher timeframe.
HTF Fib Color — Default: Purple — Color applied to all HTF Fibonacci lines and labels.
HTF Line Style — Default: Dashed | Options: Solid, Dashed, Dotted — Visual style of HTF lines.
HTF Line Width — Default: 2 | Range: 1–4 — Pixel width of HTF Fibonacci lines.
BOS / CHoCH Detection
Show BOS Signals — Default: On — Displays Break of Structure labels on the chart when a continuation break is detected.
Show CHoCH Signals — Default: On — Displays Change of Character labels on the chart when a reversal break is detected.
BOS Color — Default: Blue — Color of BOS labels.
CHoCH Color — Default: Orange-Red — Color of CHoCH labels.
Display Settings
Show Pivot Markers — Default: On — Displays small triangle markers at confirmed swing highs and lows.
Pivot High / Low Colors — Independent color inputs for swing high and swing low markers.
Show Info Dashboard — Default: On — Enables the on-chart information table.
Dashboard Position — Default: Top Right | Options: Top Right, Top Left, Bottom Right, Bottom Left — Corner placement of the dashboard table.
✅ Best Use Cases
Identifying high-probability Fibonacci levels by filtering out the ones with weak volume backing and focusing entries and exits around Strong confluence zones only
Smart Money Concept and ICT-style analysis where BOS and CHoCH signals are used to identify trend continuation and potential reversal points within a defined swing structure
Multi-timeframe confluence trading where the HTF overlay is used to identify macro structure and the current timeframe levels are used for precision entries within that context
Swing trading on any instrument where objective, volume-backed support and resistance levels are needed without manual drawing or constant chart maintenance
Breakout confirmation by watching for BOS signals that occur at or near Strong confluence Fibonacci zones, providing both structural and volume-based validation
⚠️ Limitations
Fibonacci levels are anchored to the most recent confirmed swing pair only — historical Fibonacci sets from earlier swings are not retained on the chart
Volume profile accuracy depends on the lookback length relative to the current price range; on instruments with very large recent moves the profile may not fully reflect the range containing all active Fibonacci levels
BOS and CHoCH detection requires at least two confirmed swing highs and two confirmed swing lows before trend direction can be established — signals will not appear on the earliest bars of a chart
The HTF Fibonacci overlay uses lookahead enabled on historical bars to maintain visual consistency; this is standard practice for HTF overlays and does not affect current bar calculations
On instruments without volume data (some indices and forex pairs on certain brokers) confluence classification will produce zero-volume bins and all levels will show no confluence
💡 What Makes This Unique
Volume-quantified Fibonacci levels: Unlike every standard Fibonacci tool, each level is graded by actual market participation data — volume concentration — rather than by visual proximity to other technical elements
Noise-resistant pivot anchoring: The ATR filter ensures Fibonacci levels are only drawn from swings that represent genuine structural moves, not minor price fluctuations that create misleading retracement grids
Runtime-stable volume engine: The histogram is built with a direct loop and pre-allocated array rather than built-in series functions, ensuring error-free execution from bar 1 on any chart length
Unified structural analysis: Fibonacci retracements, volume confluence, trend structure (BOS/CHoCH), multi-timeframe context, and a live data dashboard are all integrated into a single indicator with no external dependencies
🔬 How It Works
1. Swing Pivot Detection and Filtering
PineScript’s pivothigh and pivotlow functions scan for candidate swing points using the configured lookback length
Each candidate is then tested against the ATR filter — it is only accepted if its distance from the opposing swing meets or exceeds ATR × the multiplier setting, eliminating noise and ensuring anchors represent real structure
2. Fibonacci Level Calculation
When a new valid pivot is confirmed, the most recent swing high and low pair is selected as the anchor, with direction set automatically based on which pivot type was most recently validated
The seven standard ratios are applied to the anchor range and the resulting price levels are stored in a persistent array for use by the confluence engine and dashboard
3. Volume Profile Construction
The lookback window is iterated bar by bar; each bar’s midpoint price is mapped to one of the configured bin slots and that bar’s volume is added to the bin’s running total
The array is pre-allocated at script scope with the maximum bin count and zero-filled at the start of each rebuild cycle, ensuring there are never out-of-bounds access errors regardless of when the first pivot is confirmed
4. Confluence Classification
Each Fibonacci level’s price is mapped to its corresponding bin index; a weighted sum of the center bin and its two neighbours is computed to smooth the reading
The sum is compared against the peak bin volume using three thresholds (70%, 40%, 20%) to assign a Strong, Moderate, or Weak classification, which drives both the visual zone and the dashboard count
5. Structure Signal Detection
After each new pivot updates the swing sequence, the last two highs and last two lows are compared to determine whether the market is in a confirmed uptrend, downtrend, or undefined structure
On every bar, a close-based break of the most recent swing level is tested — breaks in the trend direction fire a BOS signal; breaks against it fire a CHoCH signal — with the result fed to both chart labels and alert conditions
💡 Note:
For best results, use a Pivot Lookback Length and ATR Filter Multiplier that match the significance of swings you trade on your chosen timeframe. Lower timeframes generally benefit from smaller lookback values (5–8) and lower ATR multipliers (0.3–0.5), while higher timeframes produce cleaner results with larger values (15–20 lookback, 1.0–2.0 multiplier). Enable the HTF overlay when you want macro Fibonacci context without switching charts. Indicator

Indicator

Structural Flow Decoder [JOAT]Structural Flow Decoder
Introduction
The Structural Flow Decoder is an advanced open-source market structure analysis indicator that combines Break of Structure (BOS) detection, Change of Character (CHoCH) identification, nested pattern recognition, and multi-timeframe confluence into a unified structural analysis system. This indicator helps traders identify trend direction, structural shifts, and momentum changes by analyzing how price breaks through swing highs and lows across multiple timeframes.
Unlike basic trend indicators that use moving averages, this system analyzes actual market structure - the sequence of higher highs, higher lows, lower highs, and lower lows that define trends. Break of Structure signals trend continuation, Change of Character signals potential reversals, nested patterns reveal internal structure, and multi-timeframe alignment confirms institutional conviction. The indicator is designed for traders who understand that market structure precedes price and that structural breaks reveal directional intent.
Why This Indicator Exists
This indicator addresses a critical need in technical analysis: the ability to identify trend changes before they're obvious. Market structure analysis reveals when institutions are shifting positioning. By combining multiple structural methodologies, this indicator reveals:
Break of Structure (BOS): Price breaks swing high/low in trend direction - confirms continuation and momentum
Change of Character (CHoCH): Price breaks swing high/low against trend - signals potential reversal or consolidation
Nested Structure: Internal patterns within larger structure - reveals micro-trends and entry timing
Multi-Timeframe Confluence: Higher timeframe structure alignment - confirms institutional participation
Momentum Shifts: RSI and MACD crossovers at structure breaks - adds confirmation layer
Trend Strength Analysis: Quantifies structural conviction - distinguishes strong from weak trends
Each component provides a different lens on market structure. BOS shows continuation, CHoCH shows reversals, nested structure shows timing, MTF alignment shows conviction, and momentum shows acceleration. Together, they create a comprehensive view of structural flow.
Core Components Explained
1. Break of Structure (BOS) Detection
Break of Structure occurs when price breaks a swing high in an uptrend or swing low in a downtrend. It confirms trend continuation:
// Bullish BOS: Price breaks above previous swing high
if pivotHigh > lastSwingHigh and bullishStructure:
line.new(lastSwingHighBar, lastSwingHigh, bar_index, pivotHigh,
color=COLOR_BULL_STRUCTURE, width=3, style=line.style_solid)
label.new(bar_index, pivotHigh, "BOS ↑")
The indicator identifies BOS using swing detection:
Detects swing highs and lows using pivot lookback (default 5 periods)
Compares current swing to previous swing in same direction
Draws solid lines connecting swings when BOS occurs
Labels breaks with "BOS ↑" or "BOS ↓" for clarity
BOS signals that the trend is intact and institutions are pushing price in the established direction. Multiple consecutive BOS indicate strong trending conditions.
2. Change of Character (CHoCH) Detection
Change of Character occurs when price breaks a swing high in a downtrend or swing low in an uptrend. It signals potential trend reversal:
// Bullish CHoCH: Price breaks above swing high while in downtrend
if pivotHigh > lastSwingHigh and not bullishStructure:
line.new(lastSwingHighBar, lastSwingHigh, bar_index, pivotHigh,
color=COLOR_CHOCH_BULL, width=3, style=line.style_dashed)
label.new(bar_index, pivotHigh, "CHoCH ↑")
bullishStructure := true
CHoCH is more significant than BOS because it represents structural shift:
Breaks counter-trend swing points
Signals potential trend reversal or major consolidation
Drawn with dashed lines to distinguish from BOS
Flips internal trend state when detected
CHoCH doesn't guarantee reversal, but it warns that the previous trend is weakening. Confirmation from other factors (volume, momentum, higher timeframe) increases reliability.
3. Nested Structure Analysis
Nested structure reveals internal patterns within the larger trend. It uses shorter lookback periods to detect micro-structure:
The indicator tracks internal swings using a separate period (default 3 bars vs 5 for main structure). This reveals:
Internal BOS within larger trends - shows momentum acceleration
Internal CHoCH before main CHoCH - early warning of reversals
Pullback structure in trends - identifies entry opportunities
Consolidation patterns - shows when to wait
Nested structure is drawn with thinner dashed lines to distinguish from main structure. It provides entry timing within the larger trend context.
4. Multi-Timeframe Confluence
The indicator requests structure data from a higher timeframe (default 60-minute) and compares it to current timeframe:
= request.security(syminfo.tickerid, "60",
)
Multi-timeframe analysis reveals:
Whether current timeframe structure aligns with higher timeframe
Institutional conviction (HTF structure = larger positions)
Confluence zones where both timeframes show same direction
Divergence warnings when timeframes conflict
The dashboard displays HTF alignment status (Bullish/Bearish) and confluence state (Synced/Divergent). Trading in direction of HTF structure with current timeframe confirmation produces highest win rates.
5. Momentum Shift Detection
The indicator integrates RSI and MACD to detect momentum shifts at structural breaks:
rsi = ta.rsi(close, 14)
= ta.macd(close, 12, 26, 9)
momentum_bull = ta.crossover(rsi, 50) and macdHist > 0
momentum_bear = ta.crossunder(rsi, 50) and macdHist < 0
Momentum shifts are marked with "M+" (bullish) or "M-" (bearish) labels. When momentum shifts align with structural breaks, it confirms the move. Momentum divergence from structure warns of potential failures.
6. Trend Strength Classification
The indicator quantifies trend strength based on consecutive structural breaks:
Explosive: 3+ consecutive BOS in same direction
Active: 1-2 consecutive BOS
Weak: No recent BOS or mixed signals
Strength classification appears in the dashboard and influences background gradient intensity. Strong trends show vibrant colors, weak trends show muted colors.
Visual Elements
BOS Lines: Solid thick lines (cyan for bullish, magenta for bearish)
CHoCH Lines: Dashed thick lines (cyan for bullish, magenta for bearish)
Internal Structure: Thin dashed lines showing nested patterns
Swing Point Labels: "H" and "L" markers at pivot highs/lows
Momentum Labels: "M+" and "M-" at momentum shifts
Gradient Background: Color intensity based on trend strength
Gradient Candles: Strong moves in bright colors, weak moves in muted colors
Dashboard: Real-time structure state and confluence metrics
The dashboard displays 8 key metrics:
1. Structure Flow (Bullish/Bearish)
2. Flow Strength (Explosive/Active/Weak)
3. HTF Alignment (Bullish/Bearish/Off)
4. Confluence (Synced/Divergent)
5. Momentum (Strong/Neutral/Weak)
6. MACD Signal (Bullish/Bearish)
7. Last Pivot price level
Input Parameters
Structure Analysis:
Detection Period: Swing lookback for main structure (default: 5)
Break of Structure: Enable/disable BOS detection
Change of Character: Enable/disable CHoCH detection
Nested Patterns: Enable/disable internal structure
Nested Period: Swing lookback for internal structure (default: 3)
Momentum Shifts: Enable/disable RSI/MACD labels
Higher Timeframe:
Multi-Timeframe Sync: Enable/disable HTF analysis
HTF Period: Higher timeframe to analyze (default: 60 minutes)
Confluence Filter: Require HTF alignment for signals
Visualization:
Directional Zones: Show gradient backgrounds
Pivot Markers: Show H/L labels at swings
Strength Histogram: Show trend strength bars
How to Use This Indicator
Step 1: Identify Current Structure
Check the dashboard for Structure Flow. Bullish structure = look for longs, Bearish structure = look for shorts. This is your directional bias.
Step 2: Wait for Structural Confirmation
In bullish structure, wait for BOS (break above swing high) to confirm continuation. In bearish structure, wait for BOS (break below swing low). Don't trade against structure.
Step 3: Watch for Change of Character
CHoCH signals potential reversal. When CHoCH occurs, structure flips. Wait for confirmation BOS in new direction before entering. Don't trade immediately on CHoCH.
Step 4: Use Nested Structure for Timing
Internal structure shows pullback completion. Enter when internal BOS occurs in direction of main structure. This provides precise entry timing.
Step 5: Confirm with Higher Timeframe
Check HTF Alignment in dashboard. "Synced" = both timeframes agree (best setups). "Divergent" = conflict (avoid or reduce size).
Step 6: Add Momentum Confirmation
Look for M+ labels in bullish structure or M- labels in bearish structure. Momentum + Structure = highest probability setups.
Best Practices
Trade in direction of structure - don't fight it
BOS confirms trend, CHoCH warns of change - respect both
Multiple BOS in same direction = strong trend, ride it
CHoCH requires confirmation - don't reverse immediately
Nested structure provides entries within larger trend
HTF alignment is critical - always check confluence
Momentum divergence from structure = warning sign
Explosive strength = trending conditions, use breakout strategies
Weak strength = ranging conditions, use mean reversion
Structure works on all timeframes - scale appropriately
Indicator Limitations
Structure analysis works best on trending markets with clear swings
Choppy, sideways markets produce frequent false CHoCH signals
Swing detection requires sufficient volatility - low volatility reduces reliability
CHoCH doesn't guarantee reversal - it signals potential change
Multiple CHoCH in short period indicates consolidation, not trend
HTF data may repaint on lower timeframes - use confirmed bars
Nested structure can be noisy in ranging markets
The indicator shows structure state, not future direction
Momentum shifts can occur without structural confirmation
Technical Implementation
Built with Pine Script v6 using:
Pivot-based swing detection with configurable lookback
State machine tracking for bullish/bearish structure
Nested structure analysis with separate period
Multi-timeframe security requests with proper gap handling
RSI and MACD momentum calculations
Trend strength quantification system
Dynamic gradient backgrounds based on strength
Real-time dashboard with 8 structural metrics
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 comprehensive structural integration approach. While individual components (BOS, CHoCH, swing detection) are established concepts, this indicator is justified because:
It synthesizes BOS and CHoCH detection with nested pattern analysis in a unified system
The multi-timeframe confluence detection provides institutional conviction measurement
Momentum shift integration (RSI + MACD) adds confirmation layer to structural breaks
Trend strength quantification distinguishes explosive from weak structural flows
Nested structure analysis reveals micro-patterns within macro-trends for entry timing
The gradient visualization system shows structural conviction through color intensity
Real-time dashboard presents 8 metrics simultaneously for holistic structural analysis
Each component contributes unique information: BOS shows continuation, CHoCH shows reversals, nested structure shows timing, HTF shows conviction, momentum shows acceleration, and strength shows quality. The indicator's value lies in presenting these complementary perspectives simultaneously with unified classification and visual hierarchy.
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.
Market structure analysis is a tool for understanding price behavior, not a crystal ball for predicting future movement. BOS does not guarantee continuation. CHoCH does not guarantee reversal. Past structural patterns do not guarantee future structural patterns. Market conditions change, and strategies that worked historically may not work in the future.
The structural states displayed are analytical constructs based on current market data, not predictions of future price movement. Structure alignment does 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 Indicator

Fibonacci Structure Engine [WillyAlgoTrader]📐 Fibonacci Structure Engine is an overlay indicator that combines automatic Fibonacci retracement from live market structure with Smart Money Concepts (BOS/CHoCH detection), weighted confluence scoring, premium/discount zone classification, and context-filtered engulfing pattern entries — creating a complete structure-to-Fibonacci-to-entry workflow where every component feeds into the next.
The core idea: Fibonacci levels are only meaningful when drawn from the correct swing points. This indicator automates the entire process: it detects swing highs/lows with ATR-filtered pivot detection, identifies structure breaks (BOS) and trend reversals (CHoCH), anchors Fibonacci retracement levels from the structure-defined swing, trails the live edge as price extends, locks it when a confirmed pivot arrives, scores the confluence between current price and Fibonacci levels, and generates entry signals when engulfing patterns occur at high-confluence zones in the correct structural context.
Most Fibonacci tools on PulseWire require manual drawing — you select the swing high and low, and the levels appear. The problem: selecting the wrong swing, forgetting to update after a new structure break, or drawing from a minor swing that doesn't reflect the current trend leg. This indicator solves all three: the Fibonacci anchors update automatically on every structure break, trail the live edge as price extends, and lock when a confirmed pivot arrives — always reflecting the most relevant swing for the current market structure.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Fibonacci retracement levels alone are static S/R lines. Structure detection alone tells you trend direction. Engulfing patterns alone fire everywhere. Confluence scoring alone has nothing to score against.
This indicator chains them into a dependency pipeline:
ATR-filtered swing detection → HH/HL/LH/LL classification → BOS/CHoCH structure breaks → Fibonacci anchor from structure swing → Live edge trailing + pivot locking → Fib level calculation → Confluence scoring (price vs Fib levels) → Premium/Discount zone classification → Engulfing pattern detection in structural context → Entry signal with cooldown
The swing detection feeds the structure engine — without confirmed pivots, no BOS/CHoCH can fire. The structure breaks anchor the Fibonacci levels — without a break, there's no swing to draw from. The Fibonacci levels feed the confluence scorer — without levels, there's nothing to score proximity against. The confluence score plus the premium/discount zone filter the engulfing patterns — without context, engulfing patterns produce too many false entries. And the signal cooldown prevents clustering from this entire chain.
Removing the structure detection breaks the Fibonacci anchoring. Removing the ATR filter floods the structure with noise swings. Removing the confluence scoring allows entries at non-Fibonacci prices. Removing the premium/discount filter allows bullish entries in premium (where sells should occur). Each component eliminates a specific failure mode.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Structure-anchored Fibonacci with live edge trailing.
The Fibonacci engine uses a 4-phase lifecycle:
Phase 1 — Anchor on structure break: When a BOS or CHoCH is detected:
— Bullish break: top = current high (live, will trail), bottom = most recent swing low (locked)
— Bearish break: bottom = current low (live, will trail), top = most recent swing high (locked)
This instantly draws Fibonacci levels from the break point.
Phase 2 — Trail live edge: As price extends beyond the initial break, the live edge (top for bull, bottom for bear) updates to the new extreme. Fibonacci levels recalculate continuously to reflect the current move. This captures the full extent of the breakout without waiting for a pivot confirmation.
Phase 3 — Lock on pivot: When a confirmed swing high (for bullish trailing) or swing low (for bearish trailing) is detected by the pivot engine, the live edge locks to that confirmed pivot. The Fibonacci levels stop updating and represent the confirmed swing range.
Phase 4 — Update on new swings: When a new confirmed swing arrives that differs from the current locked anchor, the Fibonacci levels update to the new structure — always reflecting the most recent confirmed swing.
This lifecycle means the Fibonacci levels are always relevant: immediately reactive after a break (phases 1–2), then structurally confirmed once a pivot is detected (phases 3–4).
2️⃣ ATR-filtered pivot detection with noise suppression.
Standard ta.pivothigh/ta.pivotlow detects every local extreme, including minor fluctuations that don't represent real swing points. The ATR filter requires:
— For a swing high: the distance from the pivot high to the most recent swing low ≥ ATR × multiplier (default 0.5)
— For a swing low: the distance from the most recent swing high to the pivot low ≥ ATR × multiplier
This ensures only swings of meaningful size (relative to current volatility) are used for structure detection and Fibonacci anchoring. The multiplier is configurable: lower (0.2–0.3) for more granular structure, higher (0.8–1.0) for only major swings.
3️⃣ BOS / CHoCH structure detection with bias tracking.
The indicator tracks a persistent structureBias variable (+1 bullish, −1 bearish, 0 neutral):
— BOS (Break of Structure) : close breaks above the most recent swing high while bias is already bullish (or below swing low while already bearish) — trend continuation
— CHoCH (Change of Character) : close breaks above swing high while bias was bearish, or below swing low while bias was bullish — trend reversal
Each break requires: barstate.isconfirmed + the swing level hasn't been broken before (tracked via lastBrokenHigh/lastBrokenLow). Structure lines are drawn from the swing point to the break bar with configurable style (solid/dashed/dotted) and width.
4️⃣ Weighted confluence scoring (0–100).
The indicator measures how close the current price is to each Fibonacci level (within ATR × tolerance) and assigns weights by Fib importance:
— 0.236 → weight 1.0 (minor level)
— 0.382 → weight 1.5 (shallow retracement)
— 0.500 → weight 2.0 (equilibrium)
— 0.618 → weight 2.5 (golden ratio — highest weight)
— 0.786 → weight 1.5 (deep retracement)
Swing highs/lows within tolerance add +1.0 each. Total weight × 10 = confluence score (capped at 100). Classification: Strong (≥ 60), Moderate (≥ 30), Weak (> 0), None (0).
The tolerance is ATR-based (default 0.3× ATR) — on a volatile instrument, the "near" zone expands proportionally. On a quiet instrument, it tightens. This prevents false confluence readings from both too-tight and too-loose proximity checks.
5️⃣ Premium / Discount zone classification.
Using the 0.500 Fibonacci level as the equilibrium:
— Premium : close > Fib 0.500 — price is above equilibrium (expensive relative to the swing)
— Discount : close ≤ Fib 0.500 — price is below equilibrium (cheap relative to the swing)
This classification is used as a context filter for engulfing patterns: bullish engulfing patterns are only marked when price is in discount or at a confluence zone. Bearish engulfing patterns are only marked in premium or at a confluence zone. This prevents the most common engulfing failure mode: bullish patterns at the top of a range and bearish patterns at the bottom.
6️⃣ Context-filtered engulfing pattern detection.
The engulfing pattern detection requires:
— Current candle body > EMA(body, 14) — above-average body size (not a doji)
— Previous candle body < EMA(body, 14) — smaller previous candle (setup for engulf)
— Current candle fully engulfs previous candle's body
— Context filter: in premium/discount zone OR confluence weight ≥ 1.5
Bearish engulfing (▼): marked when price is in premium or near a Fib level — a reversal pattern at resistance. Bullish engulfing (▲): marked when price is in discount or near a Fib level — a reversal pattern at support.
7️⃣ Dual-path entry signals with cooldown.
Two entry paths:
— Engulfing + Structure + Confluence : engulfing pattern in context + structure bias aligned + confluence weight ≥ 1.5
— CHoCH (trend reversal) : any confirmed CHoCH — strong reversal signal, no additional confluence required
Both paths subject to signal cooldown (default 5 bars) to prevent clustering. Buy/Sell signals are displayed as labels (off by default — enable in Visual Settings).
8️⃣ Golden Zone + Target Zone visualization.
Two highlighted zones drawn as semi-transparent boxes:
— Golden Zone (0.500 – 0.786): the highest-probability retracement area. Where most retests find support/resistance.
— Target Zone (−0.500 – −0.618): the Fibonacci extension target for the next leg. Where price typically reaches after a confirmed retracement entry.
Both zones extend rightward by the configurable extension (default 20 bars) and update with Fibonacci level changes.
9️⃣ Seven configurable Fibonacci levels.
Individually toggleable: 0.236, 0.382, 0.500, 0.618, 0.786, −0.500, and Target (−0.618). Each drawn with distinct line styles — 0.618 is the thickest and most opaque (golden ratio emphasis), 0.236 is the thinnest (minor level). A dotted reference line connects the swing low to swing high showing the measured move.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Pivot detection: ta.pivothigh/ta.pivotlow with configurable lookback. ATR filter removes minor swings (swing size must exceed ATR × multiplier).
Step 2 — Swing tracking: Most recent two swing highs and two swing lows stored with bar indices. Each new swing is compared to previous → HH/HL/LH/LL classification.
Step 3 — Structure detection: Close breaks above swing high → BOS (if bias already bullish) or CHoCH (if bias was bearish). Same logic inverted for bearish breaks. Structure bias updated.
Step 4 — Fibonacci anchoring: On break → live edge set at current extreme, locked edge at swing. Live edge trails with price. Locks when confirmed pivot arrives. Updates on new swings.
Step 5 — Level calculation: fibLevel = swingHigh − (swingHigh − swingLow) × ratio for each ratio. Extension targets use negative ratios.
Step 6 — Confluence scoring: For each Fib level, check if |close − level| ≤ ATR × tolerance. Add weighted score. Include swing level proximity. Cap at 100.
Step 7 — Entry logic: Path A: engulfing in context + bias + confluence ≥ 1.5. Path B: CHoCH. Both respect cooldown.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — Fibonacci levels and structure labels appear automatically
2. HH/HL/LH/LL labels show market structure
3. BOS/CHoCH labels show structure breaks and reversals
4. Yellow-shaded Golden Zone (0.500–0.786) = highest-probability retracement area
5. ▲/▼ arrows = engulfing patterns in structural context
6. Enable Buy/Sell Signals in Visual Settings for entry labels
👁️ Reading the chart:
— 🟢 HH / HL labels = bullish structure (higher highs, higher lows)
— 🔴 LH / LL labels = bearish structure (lower highs, lower lows)
— 🟢 "BOS" line + label = bullish break of structure (continuation)
— 🔴 "BOS" line + label = bearish break of structure
— 🟢🔴 "CHoCH" = Change of Character (trend reversal)
— 🔵 Horizontal lines = Fibonacci levels (0.236–0.786)
— 🟡 Shaded box (upper) = Golden Zone (0.500–0.786)
— 🟡 Shaded box (lower) = Target Zone (−0.500 to −0.618)
— 🟢 ▲ = bullish engulfing in discount / Fib zone
— 🔴 ▼ = bearish engulfing in premium / Fib zone
— 🟢 "BUY" / 🔴 "SELL" = confirmed entry signals (when enabled)
🔧 Tuning guide:
— Too many structure labels: increase Swing Length (12–20) or increase ATR Multiplier (0.7–1.0)
— Missing swings: decrease Swing Length (5–8) or decrease ATR Multiplier (0.2–0.3)
— Confluence too strict: increase Confluence ATR Tolerance (0.4–0.5)
— Too many engulfing signals: they self-filter by premium/discount — increase ATR Filter to reduce swing count
— Signal clustering: increase Signal Cooldown (8–15 bars)
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Swing Detection Length (default 10): pivot lookback — higher = larger swings
— ATR Swing Filter (default On): minimum swing size as ATR multiple
— ATR Filter Multiplier (default 0.5): how large swings must be
— Signal Cooldown (default 5): bars between consecutive signals
📐 Fibonacci:
— Show Fibonacci Levels (default On)
— Fib Extension Bars (default 20): rightward line extension
— Individual level toggles : 0.236 (off), 0.382, 0.500, 0.618, 0.786, −0.5, Target −0.618
— Confluence ATR Tolerance (default 0.3): proximity threshold
🏗️ Structure:
— BOS / CHoCH (default On): show structure break lines and labels
— Swing Labels (default On): HH/HL/LH/LL on pivots
— Engulfing Signals (default On): context-filtered patterns
🎨 Visual:
— Buy/Sell Signals (default Off): enable for entry labels
— Structure line style (Solid/Dashed/Dotted) and width (1–4)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BUY / 🔴 SELL — ticker, price, TF, confluence score, SL, TP
— 🔵 BOS — structure break with direction
— 🟡 CHoCH — trend reversal with direction
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All structure breaks and signals require barstate.isconfirmed. Pivot detection uses equal left/right lookback (swingLen/swingLen) — pivots are confirmed swingLen bars after the actual high/low. Fibonacci levels update on confirmed pivots and structure breaks only.
— 📐 The Fibonacci anchor system has two states per edge: live and locked . A live edge trails with price (capturing the full move after a break). A locked edge is confirmed by a pivot. You'll see the Fibonacci levels shift on bar close as the live edge updates — this is by design, not repainting. Once the pivot locks, levels stabilize.
— ⚖️ The 0.618 level carries the highest confluence weight (2.5) because it is the golden ratio — the most statistically significant Fibonacci retracement level. The 0.500 carries weight 2.0, while the extreme levels (0.236, 0.786) carry 1.0–1.5.
— 📊 Buy/Sell signals are off by default . The indicator is designed primarily as a structure + Fibonacci analysis tool. Enable signals in Visual Settings when you want automated entry detection.
— 🔄 CHoCH signals do not require confluence — they represent a structural trend reversal, which is inherently a high-conviction event. Engulfing-based entries require confluence weight ≥ 1.5 + correct structural bias.
— 📏 The Golden Zone (0.500–0.786) is the area where most successful retests occur . The Target Zone (−0.500 to −0.618) is the area where the next impulse leg typically reaches. Both are highlighted with semi-transparent boxes.
— 🛠️ This is a structure analysis and Fibonacci visualization tool , not an automated trading bot. It maps market structure, draws Fibonacci levels, scores confluence, and identifies high-probability entry zones — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Indicator

Global Session TrackerGlobal Session Tracker is a professional-grade Pine Script tool designed for "Time and Price" traders (such as those following ICT, SMC, or London Breakout strategies). It doesn't just show when a session is active; it dynamically tracks the Opening Range and flags the exact moment price breaches those boundaries.
🟢Indicator Overview
Global Session Tracker indicator acts as a visual map of the 24-hour trading cycle. By segmenting the day into Sydney, Tokyo, London, and New York, it allows traders to see how liquidity is engineered in one session and "swept" or "expanded" in the next.
Core Features
Session Candles: The indicator plots "phantom" candles over your main chart. These represent the high and low of the session from its start to the current moment.
Initial Balance (IB): The first candle of every session is marked with a label (e.g., "LON Open").
Dynamic Session Ranges: Unlike static boxes, this script uses plotcandle to create a continuous visual "ribbon" of the session's high/low boundary.
Real-Time Breakout Detection: It monitors the first bar of a session to set the initial high/low and then triggers signals if those levels are broken.
Status Labels: Floating labels on the right-hand axis provide a clean UI to identify which session is currently "Live" without cluttering the main price action.
Multi-Timezone Compatibility: Users can toggle the base timezone (UTC, EST, etc.) to align with their specific broker or local time.
Dashboard Table: A real-time HUD (Heads-Up Display) at the top right showing the Open, High, Low, and Close of only the currently active sessions.
🛠 Technical Details
Logic: "This script identifies the initial high and low of the first bar of a defined session and tracks breaches of these levels throughout the session duration."
Inputs: Explain that tz (Timezone) must match the user's preference for accurate session starts.
Visuals: * Triangles: Session Start.
1.Blue Circles: Bullish Breakout (Price > Session High).
2.Red Circles: Bearish Breakout (Price < Session Low).
Performance: "Zero-repainting logic; signals are confirmed at the close of the bar."
Inputs & Settings
Timezone: Set this to your local time or UTC to align the session hours correctly.
Session Times: Defaulted to standard institutional hours, but fully adjustable.
Show Table: Toggle the dashboard on or off.
📈 How to Use for Trading
Trading sessions provide the "context" for price action. Here are three professional ways to trade using this tool
Strategy 1: The London Breakout (The "Morning Shout")
The London session often sets the trend for the day.
Identify: Wait for the "LON Open" label.
Observe: Let the first 30–60 minutes form a range.
Trade: When you see a Blue Circle (Upside Break), look for a Long entry. If a Red Circle appears, look for a Short.
Target: The New York session open or the high/low of the previous Sydney/Tokyo range.
Strategy 2: The New York Reversal / Continuation
New York often "tests" the extremes of the London session.
Continuation: If New York opens and immediately breaks the London High (Blue Circle), the trend is strong.
Reversal: If price enters the New York session at the London High but fails to break it, look for price to return to the London Low.
Strategy 3: Using the Dashboard for Volatility
Monitor the High and Low columns in the table:
Compression: If the High and Low values for a session are very close (narrow range), it indicates a "Squeeze."
Expansion: A large gap between High and Low indicates a trending market. Professional traders often avoid entering "late" into an already massive expansion and wait for the next session to start.
Additional Strategies:
Global Session Tracker indicator is designed for Session-Based Liquidity Trading. Here are three common strategies:
Strategy A: The Initial Balance Breakout
The Concept: The high and low of the first hour (or the entire previous session) often act as support/resistance.
Trade Setup: Wait for the Blue Circle (High Break) or Red Circle (Low Break).
Execution: If London breaks the Tokyo High (Blue Circle), traders look for a "Stop Run" or a trend continuation toward the New York session.
Strategy B: The "Judas Swing" (ICT Concept)
The Concept: Price often breaks the previous session's high/low to grab liquidity before reversing.
Trade Setup: Use the breakout circles to identify when a level is breached. If a Red Circle appears (Low Break) but the candle closes back inside the range, it may indicate a "Fakeout," signaling a long entry.
Strategy C: Time-Price Alignment
The Concept: Volatility usually spikes at the "Open" shapes.
Trade Setup: Only take breakout signals that occur within 1 hour of the Triangle Up (Session Open) markers. Signals late in a session are often less reliable due to declining volume.
Indicator

MTF-Auto-Triad SMT Engine [TradeSymmetry]MTF-Auto-Triad SMT Engine
This indicator puts institutional order flow front and center, featuring an automated Multi-Timeframe (MTF) liquidity divergence engine as its core, supported by built-in helper tools for higher timeframe market structure and momentum tracking.
Built to eliminate chart clutter while maximizing actionable data, this tool is engineered for traders executing high-probability, asymmetric setups on intraday execution timeframes.
🔥 Core Feature: The SMT Engine
Stop manually typing in comparison tickers every time you switch assets. The Auto-Triad system instantly detects the asset class you are viewing and automatically scans correlated markets for Smart Money Tool (SMT) divergences across multiple timeframes simultaneously.
Supported Triads: * Indices: NQ1!, ES1!, YM1!
Forex: EURUSD, GBPUSD, DXY
Metals: XAGUSD, XAUEUR, XAUGBP, GC1!
Oil: CL1!, RB1!, HO1!
🛠 Built-In Helper Tools
1. Dynamic HTF Boxes with Time stamping
Keep your higher timeframe narrative locked in while executing on the LTF.
Live-Tracking OHLC: Project custom Higher Timeframe boxes (e.g., 1H, 4H, Daily) directly onto your execution chart.
Open Time Anchors: The Open level of your HTF box automatically pulls the exact timestamp of when that session began (e.g., 09:30 4H-OPEN), giving you crucial temporal context right at the point of execution.
2. Time-Price Velocity (TPV) Candles
Traditional candlesticks only show price action. The TPV engine colors your candles based on mathematically smoothed, ATR-normalized momentum.
Identify exactly when momentum is accelerating or decelerating inside a move.
Built-in dashboard shows live velocity metrics, trend direction, and acceleration changes.
💡 How to Use This Tool (The TradeSymmetry Setup)
This indicator is built to execute a strict, structural trading workflow. Follow these core steps:
1. Identify Your POI & Wait for the Sweep/Tap
Frame your narrative and identify your draw on liquidity. Wait patiently for price to sweep a key structural extreme (Session, Daily, Weekly, Monthly Highs/Lows, or Equal Highs/Lows). Alternatively, wait for price to tap into a high-probability Fair Value Gap (FVG) or Order Block (OB).
2. Confirm Institutional Footprints (SMT)
Once price reaches your POI, look for an SMT Divergence to print via the Auto-Triad engine. This confirms that correlated assets are failing to make the same high or low—the ultimate footprint of smart money accumulation or distribution.
3. Wait for the Shift & Open Level Validation
Look for a clear Market Structure Shift (MSS) or Change in State of Delivery (CISD).
Crucial Rule: If you are taking a bullish setup, ensure your trigger candle closes cleanly above the Open level. For a bearish setup, the candle must close cleanly below the Open level.
4. Execute the Trade
Once all criteria are met, use the momentum color shift in the TPV candles as your final entry trigger. Target asymmetric risk-to-reward setups (1:3 or 1:5 R:R) based on the next structural draw on liquidity.
⚙️ Customization
Everything is modular. Don't want the TPV colors? Turn them off. Want to use a custom 4-asset comparison instead of the Auto-Triads? Switch to Manual mode. Every line and label size can be custom-colored to fit your exact visual style.
Trade with symmetry. Indicator

Volume Dispersion Field [JOAT]Volume Dispersion Field
Introduction
The Volume Dispersion Field is an open-source non-overlay indicator that provides a comprehensive volume analysis suite combining relative volume classification, buy/sell delta tracking, volume dispersion measurement, climax detection, volume profile calculation, smart money activity analysis, and anomaly detection. Rather than showing a simple volume histogram, this indicator dissects volume into multiple analytical layers that reveal who is participating, how aggressively, and whether the activity is normal or anomalous.
Built with Pine Script v6, the indicator uses custom types for volume state, delta state, dispersion bins, profile data, smart money state, and volume pulse tracking.
Why This Indicator Exists
Standard volume indicators show a single bar per candle. This tells you how much volume occurred but not who was buying or selling, whether the volume is unusual, or how volume is distributed across the price range. This indicator addresses those gaps by providing:
Seven-tier volume classification: Categorizes each bar from Extreme Low to Extreme High relative to the moving average, giving immediate context about whether current activity is normal or exceptional
Delta analysis: Estimates buying and selling volume using candle structure, then calculates smoothed delta and cumulative delta to show the net direction of volume pressure
Volume dispersion: Measures how volume is distributed between the upper and lower halves of the recent price range, revealing whether volume is concentrated at highs (distribution) or lows (accumulation)
Climax detection: Identifies volume spikes that exceed a configurable threshold, often marking exhaustion points or the start of major moves
Smart money analysis: Tracks institutional-sized volume activity and classifies the market phase as Accumulation, Markup, Distribution, or Markdown
Anomaly detection: Uses Z-score analysis to flag statistically unusual volume events that may indicate institutional intervention
Core Components Explained
1. Volume Classification System
Every bar is classified into one of seven categories based on its ratio to the volume moving average:
volMA = ta.sma(volume, volMaLength)
volRatio = volume / volMA
Extreme High (>= 3.0x): Institutional-level activity, potential climax
High (>= 2.0x): Significant above-average interest
Above Average (>= 1.0x): Healthy participation
Average (>= 0.5x): Normal market conditions
Below Average (>= 0.25x): Reduced interest
Low (< 0.25x): Thin liquidity, potential for slippage
Extreme Low: Minimal activity
Each category is color-coded with a distinct color from the Quantum Volume palette, making it instantly visible which bars carry institutional weight and which are retail noise. The high and low volume multiplier thresholds are fully configurable.
2. Delta Analysis
The delta engine estimates buying and selling volume by analyzing candle structure. For a bullish candle (close > open), buying volume is estimated as the proportion of the candle range from low to close, multiplied by total volume:
if close > open
buyVol := volume * (close - low) / (high - low + 0.0001)
sellVol := volume - buyVol
else if close < open
sellVol := volume * (high - close) / (high - low + 0.0001)
buyVol := volume - sellVol
The raw delta (buyVol - sellVol) is smoothed with an EMA and also accumulated over a configurable period to produce cumulative delta. Rising cumulative delta with rising price confirms bullish conviction. Falling cumulative delta with rising price warns of hidden distribution.
The indicator also detects delta divergences — when price moves in one direction but delta moves in the opposite direction over a 10-bar window. These divergences are marked with cross symbols on the chart.
The Volume Dispersion Field panel showing color-coded volume bars, delta histogram, cumulative delta line, and smart money accumulation/distribution arrows with the dashboard displaying all metrics
3. Volume Dispersion Measurement
Dispersion quantifies how volume is distributed between the upper and lower halves of the recent price range. Over the dispersion lookback period (default 50 bars), the indicator sums volume for bars that closed in the upper half versus the lower half:
Positive dispersion (> 20): Volume is concentrated in the upper range — bullish bias, potential distribution if extended
Negative dispersion (< -20): Volume is concentrated in the lower range — bearish bias, potential accumulation if extended
Near zero: Volume is balanced across the range — no clear directional bias
Dispersion is plotted as a filled area chart, providing a visual representation of where the volume weight sits within the price range.
4. Volume Profile and POC
The indicator calculates a simplified volume profile by dividing the recent price range into configurable bins (default 10) and summing volume in each bin. From this profile, it derives:
Point of Control (POC): The price level with the highest volume — acts as a magnet for price
Value Area High (VAH): Upper boundary of the 70% volume concentration zone
Value Area Low (VAL): Lower boundary of the 70% volume concentration zone
The profile type is classified as Normal (balanced), Imbalanced (narrow value area, directional), or Ranged (wide value area, consolidation).
5. Smart Money and Anomaly Detection
The smart money engine analyzes volume distribution across the price range over a 50-bar window. If significantly more volume occurs in the lower 30% of the range while price is below its 50-period SMA, the indicator classifies the phase as Accumulation. If more volume occurs in the upper 30% while price is above the SMA, it classifies as Distribution.
Anomaly detection uses Z-score analysis:
volState.zScore := (volume - volMA) / (volStdDev + 0.0001)
volState.isAnomaly := math.abs(volState.zScore) > anomalyThreshold
Volume events with Z-scores exceeding the threshold (default 3.0 standard deviations) are flagged as anomalies and marked with diamond symbols. These statistically rare events often indicate institutional intervention or major news-driven activity.
6. Market Phase Classification
The indicator classifies the current market phase based on the combination of price direction and volume trend:
Markup: Price rising + volume rising — healthy uptrend
Distribution: Price rising + volume falling — potential top forming
Accumulation: Price falling + volume rising — smart money buying the dip
Markdown: Price falling + volume falling — healthy downtrend
Visual Elements
Volume Histogram: Color-coded bars by classification tier
Volume MA Line: 20-period moving average of volume
High/Low Volume Bands: Reference bands at the high and low multiplier levels with fill
Delta Histogram: Smoothed buy/sell delta with gradient coloring
Cumulative Delta Line: Running sum of delta over configurable period
Dispersion Area: Filled area showing volume distribution bias
Climax Markers: Triangle markers for buy and sell climax events
Anomaly Markers: Diamond markers for statistically unusual volume
Smart Money Arrows: Accumulation (up arrow) and Distribution (down arrow) signals
Volume Pulse: Circle markers when volume exceeds the pulse threshold
Heatmap Background: Subtle background coloring based on volume intensity
Dashboard: 14-row metrics table showing volume category, anomaly status, phase, delta direction, dispersion, and more
Close-up of the dashboard showing volume classification as "HIGH", phase as "Markup", delta as "BULLISH" with "BUY SIDE" flow, and an anomaly detection reading
Input Parameters
Volume Analysis:
Volume MA Length (default 20)
High Volume Multiplier (default 2.0) and Low Volume Multiplier (default 0.5)
Delta Analysis:
Delta Smoothing (default 3)
Cumulative Delta Length (default 20)
Dispersion Settings:
Dispersion Lookback (default 50) and Dispersion Bins (default 10)
Climax Detection:
Climax Threshold (default 2.5) and Climax Lookback (default 50)
Advanced Volume:
Smart Money Concepts, Institutional Activity, Volume Anomalies toggles
Anomaly Threshold (default 3.0 std dev)
Volume Pulse toggle and Pulse Threshold (default 1.5)
Visual Settings:
Volume Profile, Dashboard, Glow Effects, Heatmap toggles
Profile Width and Color Scheme (Quantum, Classic, Professional, Neon)
How to Use This Indicator
Step 1: Monitor the volume classification. Extreme High and High bars deserve attention — they indicate institutional participation. Consecutive high-volume bars in one direction confirm conviction.
Step 2: Check the delta direction. Bullish delta with rising price confirms the move. Bearish delta with rising price (divergence) warns of potential reversal.
Step 3: Watch for climax events. A buy climax (extreme volume + bullish candle) at a resistance level may signal exhaustion. A sell climax at support may signal capitulation.
Step 4: Monitor the market phase. Accumulation phases often precede significant upward moves. Distribution phases often precede declines.
Step 5: Pay attention to anomaly markers. These statistically rare volume events often mark turning points or the start of major institutional campaigns.
Step 6: Use dispersion to understand volume positioning. Positive dispersion (volume at highs) during an uptrend is healthy. Positive dispersion during a downtrend suggests distribution.
Indicator Limitations
Delta estimation uses candle structure as a proxy for actual order flow. It is an approximation, not true Level 2 data.
Volume analysis works best on instruments with reliable, consistent volume data. Forex spot volume from brokers is tick volume, not true exchange volume.
Anomaly detection assumes volume follows a roughly normal distribution. During earnings seasons or major events, multiple "anomalies" may fire in succession.
The volume profile is a simplified calculation using close prices, not a tick-by-tick profile. It provides a useful approximation but not exchange-grade precision.
Smart money phase classification is based on volume distribution patterns, not on actual institutional order data.
Climax detection identifies extreme volume events but does not predict the direction of the subsequent move.
Originality Statement
This indicator is original in its comprehensive, multi-layer approach to volume analysis. While individual volume tools exist, this indicator is justified because:
It combines seven distinct volume analysis methodologies (classification, delta, dispersion, profile, climax, smart money, anomaly) into a unified system
Z-score-based anomaly detection provides a statistical framework for identifying unusual volume that simple threshold methods miss
Market phase classification (Accumulation/Markup/Distribution/Markdown) adds a Wyckoff-inspired context layer to raw volume data
Volume dispersion measurement quantifies the spatial distribution of volume across the price range, a metric not available in standard volume indicators
The delta divergence detection system identifies hidden disagreements between price and volume pressure
The comprehensive dashboard presents 14 metrics simultaneously for holistic volume analysis
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. Volume analysis is a tool for understanding market participation, not a crystal ball for predicting future price movement. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

Indicator

Phantom Flow Decoder [JOAT]Phantom Flow Decoder
Introduction
The Phantom Flow Decoder is an open-source overlay indicator that brings together five core Smart Money Concepts into a single, cohesive tool: market structure detection (BOS/CHoCH), order block identification, liquidity pool tracking with sweep and trap detection, Fair Value Gap (FVG) analysis with consequent encroachment, and premium/discount zone mapping. Rather than toggling between multiple scripts, traders can observe how these institutional concepts interact on the same chart in real time.
The indicator is built with Pine Script v6 and uses custom user-defined types to manage every structural element as a self-contained object, keeping the codebase modular and the chart clean even when all features are enabled simultaneously.
Why This Indicator Exists
Most Smart Money Concept tools on PulseWire focus on a single element, such as order blocks alone or FVGs alone. This forces traders to stack multiple concepts and mentally piece together the relationships between them. The Phantom Flow Decoder solves this by synthesizing these elements into one unified system where:
Structure breaks validate order blocks: An order block only forms when a confirmed pivot is detected, ensuring the OB has structural significance.
Liquidity pools are volume-weighted: Pools are not just swing points; they carry a volume weight that reflects how much participation occurred at that level.
FVGs are tracked through their lifecycle: From formation to mitigation, each gap is monitored and visually updated when price fills it.
Premium/discount zones provide context: Knowing whether price sits in the top 20% or bottom 20% of the recent range helps traders decide whether to look for longs or shorts.
Core Components Explained
1. Market Structure Detection (BOS and CHoCH)
The indicator uses pivot-based swing detection to identify Higher Highs (HH), Lower Lows (LL), Higher Lows (HL), and Lower Highs (LH). When price breaks a previous swing level, the script classifies it as either a Break of Structure (BOS), which continues the existing trend, or a Change of Character (CHoCH), which signals a potential trend reversal.
Structure strength is calculated by combining volume ratio and price movement relative to ATR. A BOS with high volume and a large price move relative to ATR is considered stronger than one with thin volume.
calcStructureStrength(float priceMove, float vol, float atrVal, float volSmaVal) =>
float volRatio = vol / volSmaVal
float priceRatio = priceMove / atrVal
math.min(100, (volRatio * 30 + priceRatio * 70))
Each structure break is drawn as a horizontal line extending from the break level, with a compact label ("BOS" or "CHoCH") positioned nearby. Line styles are configurable between solid, dashed, and dotted.
Overview showing BOS and CHoCH labels on the chart with structure lines extending from break points
2. Order Block Detection
Order blocks represent the last opposing candle before a significant move. The indicator identifies bullish order blocks as the last bearish candle before a swing low, and bearish order blocks as the last bullish candle before a swing high. To filter noise, order blocks must meet a minimum size threshold measured in ATR multiples (default 0.5x ATR).
Each order block is drawn as a semi-transparent box with a dashed equilibrium line at its midpoint. When price returns to an order block and penetrates through it, the block is marked as mitigated and its visual is removed from the chart, keeping the display uncluttered.
3. Liquidity Pool Detection with Sweeps and Traps
Liquidity pools form at swing points where stop orders are likely clustered. The indicator tracks these pools and monitors them for two key events:
Sweeps: When price briefly pierces a liquidity level and then reverses, the pool is marked with a gold "SWEEP" label. The sweep threshold is configurable in ATR multiples.
Traps: When a sweep occurs with abnormally high volume, it is classified as a Smart Money Trap and marked with a magenta "TRAP" label, suggesting institutional manipulation.
When volume-weighted liquidity is enabled, each pool carries a weight based on the volume at the swing point relative to the 20-period volume SMA. This helps traders prioritize pools where significant participation occurred.
4. Fair Value Gap (FVG) Analysis
A bullish FVG forms when the current bar's low is above the high from two bars ago, creating a gap in price delivery. A bearish FVG is the inverse. The indicator filters FVGs by a minimum size (default 0.3x ATR) to avoid plotting insignificant gaps.
Each FVG is drawn as a colored box. When Consequent Encroachment is enabled, a dashed line is drawn at the 50% level of the gap, which institutional traders often use as a precise entry point. FVGs are tracked for mitigation: when price fills the gap, the box style changes to indicate it has been mitigated. FVGs older than the configurable max age (default 50 bars) are automatically removed.
5. Premium/Discount Zones
Using a configurable lookback period (default 50 bars), the indicator calculates the highest high and lowest low, then divides the range into zones. The top 20% is the premium zone (where sellers have an edge), the bottom 20% is the discount zone (where buyers have an edge), and the 50% level is the equilibrium. These zones are drawn as semi-transparent boxes with an equilibrium line.
Visual Elements
Swing Point Labels: HH, HL, LH, LL labels at each confirmed pivot
Structure Lines: Horizontal lines at BOS/CHoCH levels with configurable styles
Order Block Boxes: Semi-transparent boxes with equilibrium midlines
Liquidity Pool Boxes: Thin boxes at swing levels with SWEEP/TRAP labels
FVG Zones: Colored boxes with optional CE (50%) lines
Premium/Discount Zones: Background shading for range context
Candle Coloring: Optional trend-based candle coloring
Dashboard: Real-time metrics including trend direction, structure counts, and sweep/trap counts
Input Parameters
Structure Detection:
Pivot Sensitivity (2-20, default 5): Lower values detect more pivots, higher values only detect stronger swings
Show BOS / Show CHoCH: Toggle each structure type independently
Structure Line Style: Solid, Dashed, or Dotted
Order Block Detection:
Order Block Strength (1-10, default 3): Minimum candles for valid OB
Track OB Mitigation: Automatically remove mitigated OBs
Min OB Size (ATR): Minimum order block size filter
Liquidity Detection:
Liquidity Sensitivity (1-10, default 3)
Sweep Threshold (ATR): How far price must pierce a level to count as a sweep
Volume-Weighted Liquidity: Weight pools by volume participation
Fair Value Gaps:
FVG Max Age (bars): Auto-remove old FVGs (default 50)
Track FVG Mitigation: Monitor and update filled gaps
Min FVG Size (ATR): Filter small gaps
Show Consequent Encroachment: Draw 50% midline
Premium/Discount Zones:
Zone Lookback (20-200, default 50)
Show Equilibrium Line
How to Use This Indicator
Step 1: Identify the current market structure by observing BOS/CHoCH labels. A series of bullish BOS confirms an uptrend; a bearish CHoCH warns of a potential reversal.
Step 2: Look for unmitigated order blocks in the direction of the trend. In an uptrend, focus on bullish OBs below current price as potential support zones.
Step 3: Check if any FVGs overlap with order blocks. This confluence of an institutional entry zone (OB) with an imbalance in price delivery (FVG) creates a high-probability area.
Step 4: Confirm the zone is in the discount area (for longs) or premium area (for shorts) using the premium/discount zones.
Step 5: Monitor liquidity pools for sweeps. A sweep of a liquidity pool followed by a reversal into a confluence zone is a classic institutional entry pattern.
Step 6: Use the dashboard to monitor overall market conditions and structure counts.
Example showing a confluence setup: FVG overlapping with an order block in the discount zone, with a nearby liquidity sweep
Indicator Limitations
Pivot detection has an inherent delay equal to the pivot lookback period. Structure labels appear after confirmation, not in real time.
Order blocks and FVGs are based on historical price patterns and do not predict future price movement.
Volume-weighted features work best on instruments with reliable volume data. Low-volume instruments may produce less meaningful liquidity weights.
The indicator draws many visual elements simultaneously. On lower timeframes with high bar counts, consider reducing the Max Structure Elements setting to maintain chart performance.
Premium/discount zones are relative to the lookback period. Changing the lookback significantly alters the zones.
Smart Money Concepts are interpretive frameworks, not guaranteed predictors. Always use proper risk management.
Originality Statement
This indicator is original in its unified integration approach. While individual SMC components (BOS, CHoCH, order blocks, FVGs, liquidity pools) exist in separate scripts, this indicator is justified because:
It combines five distinct SMC methodologies into a single, object-oriented system using Pine Script v6 user-defined types
Volume-weighted liquidity pool detection adds a quantitative dimension to traditional swing-based liquidity mapping
Smart Money Trap detection (high-volume sweeps) provides a layer of institutional activity analysis not found in standard liquidity tools
FVG lifecycle tracking with consequent encroachment gives traders precise institutional entry levels
The premium/discount zone overlay provides immediate context for whether a setup is in a favorable or unfavorable area of the range
All components share state and interact: structure breaks trigger order block creation, liquidity pools are validated against volume data, and FVGs are checked against premium/discount positioning
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. Smart Money Concepts are analytical frameworks that help interpret market behavior, but they do not guarantee profitable trades. Past patterns do not guarantee future results. Always use proper risk management, including stop losses and position sizing appropriate for your account. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

Trend Zone Dashboard with Auto S/R [PhenLabs]Trend Zone Dashboard with Auto Support/Resistance
Version: PineScript™ v6
📌 Description
The Trend Zone Dashboard with Auto Support/Resistance is a professional-grade, self-calibrating support and resistance detection system. It automatically scans for pivot highs and lows across a configurable lookback window, clusters them into consolidated price zones using an adaptive tolerance algorithm, then scores each zone by touch frequency and bounce rate. The result is a clean set of actionable S/R zones rendered directly on the chart with an accompanying data-rich dashboard — no manual level-drawing required.
🚀 Points of Innovation
Auto Mode with Binary Search Calibration: A built-in iterative algorithm automatically tunes clustering tolerance to converge on a user-defined target number of zones (default: 5), eliminating the need for manual parameter tweaking across different instruments and timeframes.
Statistical Zone Scoring: Each zone is scored by both touch count (how often price interacts with the zone) and bounce rate (percentage of touches that produced confirmed reversals), giving traders a quantified measure of zone reliability.
Greedy Merge Clustering: Sorted pivot prices are merged using an ATR-adaptive or percentage-based tolerance, producing naturally consolidated zones that reflect true areas of price memory rather than arbitrary horizontal lines.
🔧 Core Components
Pivot Detection Engine: Uses `ta.pivothigh()` and `ta.pivotlow()` with configurable strength to identify swing points. Raw pivots are accumulated incrementally across all bars for efficiency, then filtered to the lookback window on the final bar.
Adaptive Clustering Algorithm: In Auto Mode, a 15-iteration binary search explores tolerance values between 0.1× ATR and 8× ATR, counting the resulting clusters at each step until the output converges to ±1 of the target zone count. In Manual Mode, the user directly sets ATR multiplier or percentage threshold.
Touch & Bounce Tracker: On the last bar, the engine scans the full lookback window bar-by-bar for each zone. A “touch” occurs when a bar’s high-low range overlaps the zone boundary. A “bounce” is confirmed when the close moves away from the zone midpoint relative to the prior close, distinguishing genuine rejections from breakdowns.
Directional Pruning System: Zones are intelligently removed only when price has decisively broken through them in the correct direction — support zones are pruned only if price collapses far below them, and resistance zones only if price surges far above. This prevents valid zones from being erroneously discarded.
🔥 Key Features
Dynamic Dashboard Table: An on-chart table (positionable to any corner) displays each active zone’s price level, type (Support/Resistance), pivot confluence count, touch strength, distance from current price, and bounce rate — all color-coded for instant readability.
Strength-Scaled Zone Boxes: Zones are drawn as shaded rectangular regions on the chart, with transparency inversely proportional to their strength score. Stronger zones appear more vivid; weaker zones fade into the background.
Color-Coded Bounce Rate: High bounce rates on support zones glow green; high bounce rates on resistance zones glow red. Low-confidence zones are dimmed to gray, directing attention to the most actionable levels.
Pivot Confluence Column: Shows how many raw pivot points were merged into each cluster, providing a confluence metric independent of the touch count.
Info Footer Row: The dashboard footer displays the current mode (Auto/Manual), computed tolerance, total pivot count, and lookback depth for full transparency into the algorithm’s behavior.
🎨 Visualization
Zone Boxes: Support zones rendered in green, resistance zones in red, extending from the lookback origin to 25 bars into the future. Width reflects the natural spread of the clustered pivot prices.
Zone Labels: Compact labels at the right edge of each zone box display type, price level, touch count, and bounce rate at a glance.
Dashboard Table: A 6-column professional table with a blue header row, color-coded data cells, and a gray info footer. Fully repositionable via dropdown input.
📖 Usage Guidelines
Auto Mode (Recommended): Leave Auto Mode enabled with the default target of 5 zones. The algorithm will self-calibrate to produce approximately 5 meaningful S/R zones on any instrument or timeframe. Increase the target for more granular analysis or decrease it for a cleaner chart.
Lookback Period: The default of 200 bars works well for most scenarios. Increase to 500+ on higher timeframes (Daily, Weekly) to capture macro structure. Decrease to 50–100 on scalping timeframes for more responsive zones.
Pivot Strength: Controls the minimum swing significance. Higher values (8–15) produce fewer but more significant pivots. Lower values (2–4) capture minor swings and produce denser zone coverage.
Manual Mode: Disable Auto Mode to take direct control of clustering tolerance. Use ATR multiplier for volatility-adaptive clustering, or percentage threshold for fixed-width zones relative to price.
Breakout Pruning: The breakout ATR multiplier (default 2.0) controls how far price must close beyond a zone before it’s considered invalidated. Increase for more persistent zones; decrease for faster pruning.
✅ Best Use Cases
Key Level Identification: Automatically surface the most statistically significant support and resistance levels without manual drawing, ideal for traders who analyze multiple instruments.
Zone Quality Assessment: Use the bounce rate column to distinguish between zones that consistently produce reversals versus zones that price tends to slice through — critical for setting stop-loss and take-profit targets.
Confluence Trading: Zones with high pivot counts AND high touch counts represent areas where price has repeatedly found significance from multiple independent swing points, offering the highest-probability trade setups.
Breakout Validation: When a zone with a historically high bounce rate is finally broken (pruned from the dashboard), it signals a genuine structural shift rather than a false breakout.
Multi-Timeframe Analysis: Run the indicator on your execution timeframe with a long lookback to naturally capture higher-timeframe structure within a single instance.
⚙️ Settings Overview
Auto Mode (Default: On) — Enables intelligent self-calibration of clustering parameters.
Target Number of Zones (Default: 5) — The desired number of S/R zones in Auto Mode. Range: 2–15.
Lookback Period (Default: 200) — Number of bars to scan for pivots. Range: 20–1000.
Pivot Strength (Default: 5) — Left/right bar count for pivot confirmation. Range: 2–20.
Clustering Method (Default: ATR) — ATR-based or Percentage-based tolerance for manual mode.
ATR Multiplier (Default: 1.0) — Multiplier applied to ATR for zone merge tolerance in manual mode.
Percentage Threshold (Default: 0.5%) — Fixed percentage tolerance for zone merging in manual mode.
Minimum Touches (Default: 2) — Zones with fewer touches are filtered out (manual mode only; auto mode uses 1).
Maximum Zones (Default: 8) — Hard cap on displayed zones.
Breakout Pruning (Default: 2.0× ATR) — Distance beyond zone edge required to consider it broken.
Dashboard Position (Default: Top Right) — Corner placement for the dashboard table.
Show Zone Boxes (Default: On) — Toggle chart zone rendering.
Show Zone Labels (Default: On) — Toggle zone annotation labels.
Support/Resistance Colors — Fully customizable zone and dashboard color scheme.
💡 Note
This indicator performs its full computation on the last bar only (`barstate.islast`), making it lightweight regardless of chart history length. The Auto Mode binary search converges in ≤15 iterations, adding negligible overhead. For best results, ensure your chart has sufficient history loaded (at least 200+ bars) so the pivot detection engine has adequate data to identify meaningful swing points. Always use this tool in conjunction with price action context and broader market structure analysis.
```
Indicator

Institutional Order Zones | ProjectSyndicateInstitutional Order Zones automatically identifies and power-ranks high-probability institutional zones by analyzing market compression events and explosive breakout candles. It filters for quality, calculates a SCORE for every zone based on its formation dynamics and historical interaction, and presents all data on the chart and in a comprehensive dashboard to eliminate clutter and focus on levels that matter.
• 🎯 Proprietary Three-Engine Architecture — the algorithm does not use generic pivots or standard support/resistance detection. Engine 1 (Order Compression) identifies statistically quiet consolidation periods using ATR percentile compression and linear regression slope neutrality. Engine 2 (Institutional Breakout) detects the institutional breakout candle — body and volume must both spike simultaneously above statistical thresholds. Engine 3 (Zone Scoring) assigns every zone a score from 0-100 based on Breakout Strength (40pts), Order Compression Duration (30pts), and Post-Breakout Momentum (30pts).
• 🎨 Score-Based Visuals — zones are color-coded into three tiers based on their 0-100 score. STANDARD (0-34): purple-magenta resistance / bright teal support. STRONG (35-64): dark red resistance / medium teal support. INSTITUTIONAL (65-100): deep pink resistance / dark teal support. Higher-tier zones automatically receive a thicker border and centerline for instant visual priority.
• 🧠 Advanced Zone Management — zones are dynamically updated on every bar. A price rejection adds +10 to the zone score and promotes its status to VALIDATED. A price breach subtracts -20 and marks the zone as VIOLATED. Violated zones can be hidden or shown via a toggle input.
• 📈 Detailed On-Chart Markup — every zone is plotted with a label anchored inside the shaded area: TIER | Sc:xx.x | STATUS | Dis:xx.x% | Dur:nb | Rej:n Brc:n. This shows the zone tier, composite score, current status (NEW / VALIDATED / VIOLATED), the breakout dislocation strength as a percentage, the consolidation duration in bars, and the full rejection and breach history.
• 🧭 Comprehensive Dashboard Display — get a complete market overview without leaving your chart. The Zone Rankings panel shows the nearest Resistance and Support zones ranked by proximity, with price, tier flag, score, and pip distance per row. The Market Stats panel shows the current session, daily range vs 10-day ADR, volatility state (LOW / NORMAL / HIGH), and the total count of active Institutional-grade zones on each side.
• 🔔 Comprehensive Alerts — get an alert whenever price enters proximity of a Standard zone, a Strong zone, or an Institutional zone, with separate alert conditions for resistance and support so you can filter exactly what matters to your setup.
• ✅ Quality Control Filters — user-configurable inputs for ATR percentile threshold, slope neutrality tolerance, minimum compression duration, body multiplier, and volume multiplier allow for deep customization. Tighten the thresholds for fewer, higher-quality zones. Loosen them for broader coverage on lower timeframes.
• 🔧 Fully Customizable — control everything from the max number of zones shown, lookback period, zone width percentage, and extend-right bars to the text size of all labels, dashboard size, and individual zone colors.
• 🎯 Why this algo is unique: Standard supply/demand or FVG indicators rely on simple pattern recognition (gap between candles, pivot highs/lows). This algorithm quantifies the underlying market state that precedes institutional moves. It measures the quality of the compression that created the zone and the statistical significance of the breakout that validates it. Every zone has a score you can trust, not just a visual box.
• 🚀 Apply to Gold (XAUUSD), Forex, Crypto, and Indices on any timeframe. The ATR-based detection and zone width settings allow it to adapt to anything from M5 scalping to D1 swing trading.
• 🎯 How to use this? Use the dashboard to identify the strongest, closest zones. Focus on price action around INSTITUTIONAL-tier zones (Score >= 65) that align with your higher-timeframe bias. Use the alerts to know when price is approaching a key level so you are never caught off guard.
• ⚠️ IMPORTANT NOTICE: This indicator is designed to identify high-probability institutional order zones. It should NOT be used as a standalone signal for entering live trades. Always use it in conjunction with your own trading strategy, price action analysis, and other technical indicators to confirm trade setups and manage risk.
Indicator

SMC Core Lite - Signals█ OVERVIEW
SMC Core Lite is a lightweight, performance-optimized Smart Money Concepts (SMC) indicator designed to help traders identify institutional trading patterns and generate high-probability trade signals.
This indicator combines the most essential SMC elements - Fair Value Gaps (FVG), Order Blocks (OB), and Break of Structure (BOS) - into a single, easy-to-use tool with automatic LONG/SHORT signal generation.
█ CONCEPTS
The indicator is built on the foundation of Smart Money Concepts, a trading methodology that focuses on understanding how institutional traders (banks, hedge funds, market makers) move the markets.
🔹 Break of Structure (BOS)
When price breaks above a swing high or below a swing low, it signals a potential continuation of the trend. This confirms the market's directional bias.
🔹 Change of Character (CHoCH)
When BOS occurs against the prevailing trend, it signals a potential trend reversal. This is a powerful early warning sign of shifting market sentiment.
🔹 Fair Value Gaps (FVG)
Also known as imbalances, FVGs are areas on the chart where price moved so quickly that it left a "gap" in the price action. These zones often act as magnets for price to return and fill.
🔹 Order Blocks (OB)
Order blocks represent the last opposing candle before a strong impulsive move. These zones mark areas where institutional orders were placed and often act as strong support/resistance levels.
█ FEATURES
• ✅ Break of Structure (BOS) Detection
• ✅ Change of Character (CHoCH) Detection
• ✅ Fair Value Gap (FVG) Identification
• ✅ Order Block (OB) Detection
• ✅ Automatic LONG/SHORT Signals
• ✅ Auto Stop Loss & Take Profit Levels
• ✅ Market Bias Dashboard
• ✅ Customizable Risk:Reward Ratio
• ✅ Signal Cooldown Filter
• ✅ Alert Conditions for All Events
• ✅ Lightweight & Fast Loading
█ HOW IT WORKS
The signal generation follows a confluence-based approach:
🟢 LONG SIGNAL CONDITIONS:
1. Price pulls back into a bullish zone (Bullish FVG or Bullish OB)
2. Recent Bullish BOS/CHoCH confirmed OR Market Bias is Bullish
3. Current candle closes bullish (confirmation)
4. Signal cooldown period has passed
🔴 SHORT SIGNAL CONDITIONS:
1. Price pulls back into a bearish zone (Bearish FVG or Bearish OB)
2. Recent Bearish BOS/CHoCH confirmed OR Market Bias is Bearish
3. Current candle closes bearish (confirmation)
4. Signal cooldown period has passed
█ HOW TO USE
1. Add the indicator to your chart
2. Wait for market structure to develop (BOS/CHoCH labels)
3. Observe the Market Bias in the dashboard (BULL 🐂 or BEAR 🐻)
4. Look for LONG signals in bullish bias, SHORT signals in bearish bias
5. Use the auto-generated SL/TP levels for trade management
6. Set alerts to get notified of new signals
█ SETTINGS
═══ SIGNALS ═══
• Show LONG/SHORT Signals → Enable/disable signal labels
• Show SL/TP Lines → Display stop loss and take profit levels
• Risk:Reward → Set your desired R:R ratio (1:1 to 1:5)
• Signal Cooldown → Minimum bars between signals (reduces noise)
═══ STRUCTURE ═══
• Show BOS/CHoCH → Display structure break labels
• Swing Length → Lookback period for swing point detection
═══ ZONES ═══
• Show FVG → Display Fair Value Gap boxes
• Show Order Blocks → Display Order Block boxes
• Zone Lookback → Historical bars to analyze
• OB Strength → ATR multiplier for impulse move detection
█ ALERTS
The indicator includes 4 alert conditions:
1. 🟢 LONG Signal → Triggered when a buy signal appears
2. 🔴 SHORT Signal → Triggered when a sell signal appears
3. 🟢 Bullish BOS → Triggered on bullish break of structure
4. 🔴 Bearish BOS → Triggered on bearish break of structure
To set alerts: Right-click on chart → Add Alert → Select this indicator → Choose condition
█ IMPORTANT NOTES
⚠️ This indicator is optimized for speed and performance. It stores only the most recent 10 FVGs and 10 Order Blocks to ensure fast loading times.
⚠️ Works best on higher timeframes (15m, 1H, 4H, Daily) where market structure is cleaner.
⚠️ Always use proper risk management. No indicator is 100% accurate.
█ BEST PRACTICES
✅ Trade in the direction of the higher timeframe bias
✅ Wait for price to pull back to zones before entering
✅ Use the 50% level of zones for optimal entries
✅ Combine with your own analysis for best results
✅ Backtest before using with real capital
█ DISCLAIMER
This indicator is for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results. Always do your own research and consider your financial situation before making any trading decisions.
█ CREDITS
Inspired by the Smart Money Concepts trading methodology and ICT (Inner Circle Trader) concepts.
If you find this indicator helpful, please consider giving it a boost 🚀 and following for more trading tools!
█ VERSION HISTORY
v1.0 - Initial Release
• BOS/CHoCH Detection
• FVG & Order Block Identification
• LONG/SHORT Signal Generation
• Auto SL/TP Calculation
• Market Bias Dashboard
• Alert Conditions Indicator

Indicator

Indicator

Smart Confluence█ SMART CONFLUENCE (SC)
Multi-Factor SMC Trading System
Smart Confluence combines multiple market structure signals into a single confluence score . When enough signals align, it generates BUY/SELL setups with precise Entry Zones, Stop Loss, and 3 Take Profit levels — all fully automated.
Free and Open Source.
█ THE CONCEPT: WHY CONFLUENCE MATTERS
No single indicator is reliable on its own. A CHOCH can fail. An Order Block can break. A sweep can be a fakeout. But when 4-6 different signals all agree at the same time — that's when the probability is in your favor.
Smart Confluence requires a core trigger (CHOCH, Sweep, or EQ-Grab) PLUS enough confirmations to reach the minimum confluence threshold before any signal fires. This eliminates most false signals.
█ CORE FEATURES
1. Market Structure Detection
Automatic Swing High/Low identification with Change of Character (CHOCH) — the moment a downtrend breaks above the last swing high (bullish) or an uptrend breaks below the last swing low (bearish). CHOCH is worth 2 confluence points.
2. Liquidity Sweeps
Detects stop-hunt patterns where price sweeps below recent lows (or above recent highs) and reverses. These sweeps indicate smart money collecting liquidity before the real move. Worth 2 confluence points.
3. EQH/EQL (Equal Highs/Lows)
Identifies liquidity pools where multiple swing points cluster at the same price level. When price sweeps through these clusters (EQ-Grab), it signals institutional order flow. Worth 3 confluence points (configurable).
4. Order Blocks & Fair Value Gaps
Order Blocks — The last opposing candle before a strong move — institutional supply/demand zones. +1 point when price is inside.
FVGs — Price imbalances (gaps between candles) that act as magnets. +1 point when price is inside.
5. Premium/Discount Zones
Calculates where price is relative to the current range. Buy in discount (<50%), sell in premium (>50%). OTE (Optimal Trade Entry) bonus for the 62-79% retracement zone. Up to +3 confluence points.
6. Confirmation Filters
Volume — High volume confirms institutional activity (+1-2 points)
RSI Divergence — Momentum exhaustion = strong reversal signal (+2 points)
EMA Trend Filter — Price vs EMA21/50/200 alignment (+1-2 points)
ATR Volatility — High volatility confirms market activity (+1 point)
HTF Trend — Higher timeframe trend agreement (+1 point)
Candlestick Patterns — Engulfing, Hammer, Shooting Star (+1 point)
█ AUTO-TIMEFRAME ADAPTATION
All parameters auto-adjust to your chart timeframe: Swing Length, Cooldown, OB Lookback, Min Confluence, HTF selection, SL Buffer, Min R:R, EQ Tolerance, EQ Age, Setup duration, S/R Cluster. Supports 1m to Monthly.
█ S/R ZONE DETECTION
Automatic Support/Resistance zones built from clustering multiple sources: Swing points, Order Blocks, FVGs, EQH/EQL levels, HTF levels. Each zone gets a strength score (1-5). Only shows the strongest zones.
█ ENTRY / SL / TP SYSTEM
Entry Zone — Based on active Order Block or FVG. Falls back to current candle range.
Stop Loss — 4 modes: Entry-Based, Swing, ATR, or SMC (below OB/FVG). R:R filter ensures minimum reward.
Take Profit — 4 modes: Structure (next swing), Fixed R:R, ATR-based, or Hybrid (structure if available, else R:R).
Partial TP — Configurable distribution (50/30/20, 33/33/34, 40/40/20, 60/30/10).
█ DASHBOARD
Compact dark-themed info panel showing: Mode (Auto/Manual + TF), Trend direction, HTF confirmation, Premium/Discount zone, S/R levels with strength, Bull/Bear confluence scores, Active setup details (direction, R:R, SL, Entry, TP1-3), SL/TP mode, Partial distribution.
█ ALERTS (8 CONDITIONS)
BUY Signal — Full confluence with valid R:R
SELL Signal — Full confluence with valid R:R
Bullish CHOCH — Trend reversal detected
Bearish CHOCH — Trend reversal detected
EQH Grab — Liquidity pool swept (bearish)
EQL Grab — Liquidity pool swept (bullish)
Bullish Sweep — Stop hunt detected
Bearish Sweep — Stop hunt detected
█ PRO VERSION
The PRO version (Smart Confluence Pro) adds:
Signal Profile Presets — Scalping, Intraday, Swing, Position, Aggressive, Conservative, SMC Pure
Asset Auto-Detection — Crypto, Forex, Stock, Futures with 8 scaling factors
A/B/C Signal Grading — Quality scoring based on Zone, HTF, Volume, Session, Divergence
Risk Management — Account size, risk %, position sizing, custom partial distributions
Session Filter — London, New York, Asia sessions with overlap detection
Funding Rate — Crypto perpetual funding rate as contrarian confluence
Trailing Stop Loss — Break-Even + Trail TP modes
Trade Management Alerts — TP1/TP2/TP3 hit, SL hit, Trailing updates, Setup expiry
14+ Alert Types — Including A-Grade only alerts
█ NON-REPAINTING
All signals require confirmed bars (barstate.isconfirmed for EQH/EQL). Signal confirmation waits for the next candle. HTF data uses lookahead=barmerge.lookahead_off. No future data leakage. No repainting.
█ WORKS ON
Crypto, Forex, Stocks, Futures, Indices — any timeframe from 1 minute to Monthly.
█ DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice. Always do your own research and manage your risk. Past performance does not guarantee future results. Trading involves substantial risk of loss.
Indicator

[ A L P H A X ] Structure - Smart Money Concepts [SMC]AlphaX Structure — Smart Money Concepts: BOS, CHoCH, Order Blocks, FVG, Liquidity Sweeps, Equal H/L, Displacement & Live Dashboard
AlphaX Structure is a comprehensive Smart Money Concepts (SMC) and ICT-methodology visualization tool that automatically maps market structure, institutional order flow zones, imbalances, and liquidity levels on your chart. It detects Break of Structure, Change of Character, Order Blocks with touch tracking, Fair Value Gaps with real-time fill percentage, liquidity sweeps, equal highs and lows, displacement candles, premium and discount zones — all presented through a clean, professional interface with a live dashboard showing market context at a glance.
Built for traders who analyze markets through the lens of institutional order flow and smart money behavior.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📐 Market Structure — BOS & CHoCH
The foundation of smart money analysis is understanding where structure breaks and when character changes .
Break of Structure (BOS)
A BOS occurs when price breaks a swing high or swing low in the direction of the existing trend — confirming that the current trend is continuing. BOS is plotted as a dashed horizontal line at the broken level with a "BOS" label offset slightly above or below for clear visibility.
Bullish BOS — price closes above a prior swing high while the market is already in a bullish structure. This confirms buyers remain in control and the uptrend is intact.
Bearish BOS — price closes below a prior swing low while the market is already in a bearish structure. This confirms sellers remain dominant and the downtrend continues.
Change of Character (CHoCH)
A CHoCH occurs when price breaks a swing high or swing low against the direction of the existing trend — signaling a potential trend reversal. CHoCH is plotted as a dotted horizontal line (visually distinct from BOS) with a "CHoCH" label.
Bullish CHoCH — price closes above a swing high while the market was previously bearish. This is the first structural sign that sellers may have lost control and a bullish reversal is forming.
Bearish CHoCH — price closes below a swing low while the market was previously bullish. This warns that buyers may be exhausted and a bearish reversal could be underway.
CHoCH is the earliest structural reversal signal. When you see a CHoCH followed by a BOS in the new direction, the trend shift is confirmed.
The indicator tracks the internal market trend state automatically. Once a bullish CHoCH fires, all subsequent structure breaks in the same direction are classified as BOS (continuation) until a bearish CHoCH resets the trend — and vice versa.
Swing Classification
When swing point labels are enabled, each pivot is classified as:
HH — Higher High (bullish continuation)
HL — Higher Low (bullish continuation)
LH — Lower High (bearish continuation)
LL — Lower Low (bearish continuation)
This gives you the complete market structure sequence — HH + HL = uptrend, LH + LL = downtrend — at a glance without manually marking swings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📦 Order Blocks (OB) — With Touch Tracking
Order Blocks are the last opposing candle before a strong move — the zone where institutional orders were placed. AlphaX Structure detects Order Blocks automatically using two methods:
Engulfing Pattern Detection — a candle that fully engulfs the prior candle's body, indicating aggressive institutional entry
Strong Displacement Detection — a candle that breaks through two prior bars' highs or lows, showing powerful directional commitment
Each Order Block is drawn as a filled box spanning the body of the origin candle. The box extends forward in time, remaining on the chart as a potential reaction zone.
What makes this unique — Touch Counting:
Most SMC indicators simply show or hide Order Blocks. AlphaX Structure tracks how many times price retests each Order Block and displays the count directly on the label:
OB — fresh, untested Order Block
OB ×1 — price has retested this zone once
OB ×2 — price has retested this zone twice
OB ×3+ — multiple retests — the zone is weakening
This is critical information. A fresh OB with zero touches is the highest probability reaction zone. An OB that has been tested 3 or more times is significantly weaker — institutional orders at that level have likely been filled, and the zone may fail on the next test.
Mitigation:
When price closes through an Order Block (beyond its far edge), the OB is considered mitigated . It grays out and stops extending — visually clearing the chart while preserving the historical record of where the zone existed.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Fair Value Gaps (FVG) — With Fill Percentage
A Fair Value Gap is a three-candle imbalance where the wick of the first candle and the wick of the third candle do not overlap — creating a gap in price that represents inefficient price delivery. These gaps act as magnets that price tends to return to and fill.
Bullish FVG — gap between the high of candle 1 and the low of candle 3 (upward imbalance). Price tends to pull back down to fill this gap before continuing higher.
Bearish FVG — gap between the low of candle 1 and the high of candle 3 (downward imbalance). Price tends to push back up to fill this gap before continuing lower.
Each FVG is drawn as a dotted-border box with a midpoint line through the center. The midpoint represents the 50% level of the imbalance — often the precise level where price reacts.
What makes this unique — Real-Time Fill Percentage:
AlphaX Structure calculates and displays how much of each FVG has been filled as price returns to the zone:
FVG — unfilled gap, no price has entered the zone
FVG 35% — price has partially filled 35% of the gap
FVG 72% — price has filled most of the gap
FVG ✓ — gap has been fully mitigated (price closed through the entire zone)
This gives you precision that no standard FVG indicator provides. A gap that is 70% filled but holding at the midpoint is behaving differently than one that was filled in a single candle. The fill percentage helps you judge whether the imbalance has been respected (potential bounce) or is being aggressively closed (continuation through).
A minimum FVG size filter (in ticks) is available to remove insignificant micro-gaps that clutter the chart on lower timeframes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💰 Liquidity Sweeps
Liquidity sweeps occur when price wicks beyond a recent high or low but closes back inside the range — indicating a stop hunt or liquidity grab by institutional players. This is one of the most important concepts in ICT methodology.
Buy-side Sweep — price wicks above the recent highest high (grabbing buy-stop liquidity) but closes back below with a bearish candle. This often precedes a reversal lower. Labeled as "$ sweep" above the bar.
Sell-side Sweep — price wicks below the recent lowest low (grabbing sell-stop liquidity) but closes back above with a bullish candle. This often precedes a reversal higher. Labeled as "$ sweep" below the bar.
The lookback period for defining "recent" highs and lows is configurable, allowing you to tune sensitivity from tight scalping sweeps to broader swing-level liquidity grabs.
Liquidity sweeps are most powerful when they occur at key levels — equal highs/lows, Order Block zones, or previous day/week extremes. When a sweep aligns with an OB or FVG, the probability of a reaction increases significantly.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚖ Equal Highs & Equal Lows (EQH / EQL)
When two consecutive swing highs or swing lows form at approximately the same price, they create a liquidity pool . Retail traders place stops just beyond these levels, and institutional players know exactly where those stops are clustered.
EQH (Equal Highs) — two swing highs at nearly identical prices. A dashed line extends forward marking this level as a target for buy-side liquidity sweeps. Market makers frequently drive price above equal highs to trigger stops before reversing.
EQL (Equal Lows) — two swing lows at nearly identical prices. A dashed line marks this as a sell-side liquidity target. Expect price to sweep below before potentially reversing.
The tolerance for what counts as "equal" is configurable as a percentage (default 0.02%). This prevents false matches while catching genuinely significant double-top and double-bottom liquidity formations.
Equal Highs and Equal Lows are prime targets — when you see price approaching an EQH from below or an EQL from above, be prepared for either a sweep-and-reverse or a clean breakout. The market structure context (BOS vs CHoCH) and the presence of nearby Order Blocks will help you determine which scenario is more likely.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔥 Displacement Candles
Displacement represents aggressive institutional commitment — a candle whose body is significantly larger than normal, showing that smart money entered with force. AlphaX Structure identifies displacement candles using two criteria:
The candle body must exceed the Average True Range (ATR) multiplied by a configurable factor (default 2.0×)
The body must occupy more than 60% of the total candle range (strong body-to-wick ratio — institutional candles close near their extreme, not in the middle)
Bullish displacement candles are marked with a diamond below the bar. Bearish displacement candles are marked with a diamond above the bar.
Displacement candles are the engine behind structure breaks . When a BOS or CHoCH is accompanied by a displacement candle, the move has genuine institutional backing. When structure breaks occur on weak, indecisive candles, the break is more likely to fail.
Additionally, displacement candles often create Fair Value Gaps . When you see a displacement diamond next to an FVG box, you know the imbalance was created by a powerful move — making that FVG a higher-probability reaction zone.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💪 Candle Strength Dots
An optional feature that marks individual candles based on their relative strength compared to the ATR:
Strong Bullish Candle — body exceeds 1.2× ATR with body ratio above 55%, bullish close. Dot appears below the bar.
Strong Bearish Candle — same criteria, bearish close. Dot appears above the bar.
This is a quick visual filter for identifying which candles represent genuine conviction versus noise. Disabled by default to keep the chart clean — enable it when you want granular candle-level analysis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Premium & Discount Zones
The indicator calculates the current trading range using a configurable lookback period and divides it into:
Premium Zone — the upper 25% of the range, shaded with the bear color. In ICT methodology, the premium zone is where smart money sells. Buying in premium is inherently risky.
Discount Zone — the lower 25% of the range, shaded with the bull color. This is where smart money buys. Selling in discount is inherently risky.
Equilibrium (EQ) — the exact 50% midpoint of the range, marked with a dotted cross line. This is the fair value level. Price above EQ is in premium territory; price below EQ is in discount territory.
The Premium and Discount zones are drawn using boxes and lines that do not affect the chart's price scale — your candles will always display at their natural size regardless of the range lookback setting.
The dashboard displays your exact position within the range as a percentage: "DISCOUNT 18%" means price is in the lower 18% of the range — deep discount. "PREMIUM 85%" means price is in the upper portion — extended and vulnerable to pullback.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Live Dashboard
A comprehensive real-time reference panel that updates on every bar, providing complete market context without needing to scan the chart:
STRUCTURE — current market structure direction: ▲ BULLISH, ▼ BEARISH, or — NEUTRAL, based on the most recent BOS or CHoCH
EMA BIAS — longer-term directional bias based on price position relative to 50 and 200 EMA alignment
ZONE — whether price is currently in PREMIUM, UPPER EQ, LOWER EQ, or DISCOUNT territory, with exact percentage
EQ LEVEL — the exact price of the current range equilibrium, formatted to the instrument's tick size
RSI (14) — current RSI value, color-coded: green in oversold territory, red in overbought, neutral in the middle
VOLATILITY — current volatility regime (HIGH / NORMAL / LOW) based on ATR as a percentage of price, with the exact ATR value
VOLUME — current volume relative to the 20-period average: SPIKE (>2×), ABOVE AVG (>1.3×), NORMAL, or DRY (<0.7×)
ORDER BLOCKS — number of currently active (unmitigated) Order Blocks, broken down by bullish and bearish count
FAIR VALUE GAPS — number of currently active (unfilled) FVGs, broken down by bullish and bearish count
SWING HIGH — the most recent confirmed swing high price
SWING LOW — the most recent confirmed swing low price
The dashboard title "A L P H A X S T R U C T U R E" is displayed in the signature yellow-green theme color. All values are color-coded to match their significance — bullish values in yellow-green, bearish values in red, neutral in gray.
Dashboard position (Top Left, Top Right, Bottom Left, Bottom Right) and text size (Tiny, Small, Normal) are fully configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 Visual Design Philosophy
AlphaX Structure follows a strict dual-tone color theme for maximum clarity:
Yellow-Green (#c8e624) — all bullish elements: bullish BOS, bullish OBs, bullish FVGs, equal lows, discount zones, bullish displacement, sweep recoveries
Red (#ff1744) — all bearish elements: bearish BOS, bearish OBs, bearish FVGs, equal highs, premium zones, bearish displacement, sweep rejections
Gray (#555555) — neutral and mitigated elements: mitigated OBs and FVGs, equilibrium line, inactive zones
Structure labels (BOS, CHoCH, OB, FVG, EQH, EQL) are offset from their reference lines by a dynamic ATR-based spacing value. This ensures labels never sit directly on top of the lines they reference — maintaining readability at any zoom level and on any instrument.
All label sizes are configurable from a single setting (Tiny, Small, Normal, Large), and structure line widths for BOS and CHoCH are independently adjustable.
Mitigated zones are visually dimmed — OB and FVG boxes turn gray with increased transparency, clearly distinguishing active zones from historical ones without removing them from the chart entirely.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Read AlphaX Structure — Step by Step
Step 1 — Identify the Trend
Check the dashboard: what does STRUCTURE say? What does EMA BIAS say?
If both agree (both bullish or both bearish), you have a confirmed directional environment
If they disagree, the market may be in transition — wait for alignment
Step 2 — Locate Key Levels
Identify active Order Blocks — these are your primary reaction zones
Note any unfilled FVGs — price is likely to return to these imbalances
Check for Equal Highs or Equal Lows — these are liquidity targets
Step 3 — Determine Premium or Discount
Check the ZONE reading in the dashboard
In a bullish trend, look for entries in DISCOUNT or LOWER EQ
In a bearish trend, look for entries in PREMIUM or UPPER EQ
Avoid entering long in deep premium or short in deep discount — you are fighting the range
Step 4 — Wait for Confluence
The highest probability setups occur when multiple elements align at the same price level
Example: A bullish OB with zero touches sitting inside the discount zone, with an unfilled bullish FVG overlapping the same area, and a recent sell-side liquidity sweep just below — this is a textbook smart money long entry
Example: A bearish CHoCH forms at a premium zone equal high, followed by a displacement candle creating a bearish FVG — this is a high-probability short setup
Step 5 — Monitor Displacement
When structure breaks occur, check for displacement diamonds
BOS or CHoCH with displacement = high conviction move
BOS or CHoCH without displacement = weaker break, may fail or consolidate
Step 6 — Track FVG Fill Progress
As price returns to an FVG, watch the fill percentage update in real time
If price fills to 50% (the midpoint line) and rejects — the FVG is acting as support or resistance
If price fills beyond 70% — the imbalance is mostly resolved, the level is losing significance
If the label shows "FVG ✓" — the gap is fully mitigated, it is no longer a valid zone
Step 7 — Count OB Touches
Fresh OBs (zero touches) are the strongest — institutional orders are still there
OBs with 1–2 touches are still valid but weakening
OBs with 3+ touches — expect the zone to break on the next test. Consider trading the break rather than the bounce
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features Summary
📐 Automatic Break of Structure (BOS) and Change of Character (CHoCH) detection with proper trend state tracking
📦 Order Blocks with real-time touch counting — know exactly how many times each zone has been tested
⚡ Fair Value Gaps with live fill percentage — see partial fills update as price enters the zone
✓ FVG mitigation checkmark — clear visual confirmation when an imbalance is fully resolved
💰 Liquidity sweep detection — buy-side and sell-side stop hunts automatically identified
⚖ Equal Highs and Equal Lows — institutional liquidity pool targets marked with extension lines
🔥 Displacement candle detection — identify the high-conviction institutional candles behind structure breaks
💪 Optional candle strength dots — quick visual filter for strong vs weak bars
🎯 Premium and Discount zones with equilibrium line — know whether you are buying cheap or expensive
📋 12-row live dashboard — structure, EMA bias, zone, RSI, volatility, volume, active OB/FVG counts, swing levels
🏷 HH / HL / LH / LL swing classification labels — complete market structure sequence at a glance
🎨 Clean dual-tone color theme — yellow-green bullish, red bearish, gray neutral — no visual clutter
📏 ATR-based label spacing — labels never overlap their reference lines regardless of instrument or timeframe
⚙ Fully configurable — label size, line widths, max drawings, transparency, lookback periods, all from the settings panel
🔔 18 alert conditions covering every event type including combined alerts for multi-condition monitoring
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
Structure
Swing Detection Length — number of bars on each side to confirm a pivot (default: 5)
Show Break of Structure — toggle BOS lines and labels
Show Change of Character — toggle CHoCH lines and labels
Show Swing Points — toggle HH/HL/LH/LL labels at pivots
Max Structure Lines — limit on total BOS/CHoCH drawings (default: 15)
Order Blocks
Show Order Blocks — toggle OB detection and drawing
Remove Mitigated OBs — gray out and stop extending OBs that price has closed through
Max Order Blocks — maximum active OB drawings (default: 8)
Bullish / Bearish OB Color — independent color pickers
OB Fill Transparency — control how transparent the OB fill appears (default: 88)
Fair Value Gaps
Show Fair Value Gaps — toggle FVG detection and drawing
Remove Mitigated FVGs — gray out and checkmark FVGs that price has fully closed through
Max FVG Boxes — maximum active FVG drawings (default: 10)
Bullish / Bearish FVG Color — independent color pickers
FVG Fill Transparency — control fill transparency (default: 90)
Min FVG Size (ticks) — filter out micro-gaps below this threshold
Liquidity
Show Liquidity Sweeps — toggle sweep detection labels
Liquidity Lookback — how many bars to look back for the recent high/low that defines the sweep level (default: 20)
Buy-side / Sell-side Sweep Color — independent color pickers
Equal H/L
Show Equal Highs / Lows — toggle EQH/EQL detection
Equal Level Tolerance % — how close two swing pivots must be to qualify as "equal" (default: 0.02%)
Equal Highs / Lows Color — independent color pickers
Premium & Discount
Show Premium/Discount — toggle zone boxes and equilibrium line
Range Lookback — how many bars to calculate the current range (default: 50)
Discount / Premium Zone Color — independent color pickers
Displacement
Show Displacement Candles — toggle displacement diamond markers
ATR Multiplier — how many times larger than ATR the candle body must be (default: 2.0)
ATR Period — the ATR calculation period (default: 14)
Bull / Bear Displacement Color — independent color pickers
Candle Strength
Show Candle Strength Dots — toggle strong candle markers (default: off)
Strength ATR Period — ATR period for strength comparison (default: 14)
Appearance
Label Size — Tiny, Small, Normal, or Large for all chart labels
Structure Line Width — thickness of BOS lines (default: 1)
CHoCH Line Width — thickness of CHoCH lines (default: 2)
Dashboard
Show Dashboard — toggle the information panel
Dashboard Position — Top Left, Top Right, Bottom Left, or Bottom Right
Dashboard Text Size — Tiny, Small, or Normal
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions (18 Total)
Individual Alerts:
Bullish BOS — fires when a bullish Break of Structure is confirmed
Bearish BOS — fires when a bearish Break of Structure is confirmed
Bullish CHoCH — fires when a bullish Change of Character is detected
Bearish CHoCH — fires when a bearish Change of Character is detected
Buy-side Liquidity Sweep — fires when price sweeps above recent highs and closes back below
Sell-side Liquidity Sweep — fires when price sweeps below recent lows and closes back above
Bullish FVG Formed — fires when a new bullish Fair Value Gap is created
Bearish FVG Formed — fires when a new bearish Fair Value Gap is created
Bullish OB Formed — fires when a new bullish Order Block is detected
Bearish OB Formed — fires when a new bearish Order Block is detected
Bullish Displacement — fires when a bullish displacement candle is confirmed
Bearish Displacement — fires when a bearish displacement candle is confirmed
Combined Alerts:
Any Bullish Structure Break — fires on either bullish BOS or bullish CHoCH
Any Bearish Structure Break — fires on either bearish BOS or bearish CHoCH
Any Liquidity Sweep — fires on either buy-side or sell-side sweep
Any FVG Formed — fires on either bullish or bearish FVG
Any OB Formed — fires on either bullish or bearish Order Block
Any Displacement Candle — fires on either bullish or bearish displacement
All alert messages are prefixed with and include ticker, interval, and price for clean webhook and notification integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
🧠 ICT and SMC traders — every core concept is mapped automatically: BOS, CHoCH, OB, FVG, liquidity sweeps, EQH/EQL, premium/discount, displacement
🥇 Gold (XAUUSD) traders — gold's price action is heavily driven by institutional order flow and liquidity sweeps; this tool maps exactly where those events occur
📉 Forex traders — applicable to all major and minor pairs; session-based liquidity sweeps are particularly effective on EURUSD, GBPUSD, and USDJPY
📊 Index traders — works on US30, NAS100, SPX500, DAX — Order Blocks and FVGs are core institutional concepts on indices
📈 Traders who want clean charts — every element uses the same dual-tone theme with proper spacing, mitigation graying, and configurable drawing limits. No clutter, no overlapping elements
⚠ Traders learning SMC methodology — the indicator maps every concept in real time, making it an excellent study tool for understanding how structure, order flow, and liquidity interact
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
Designed for intraday to swing timeframes — M1 through H4. Works on daily and weekly charts but intraday timeframes provide the best resolution for OB and FVG detection.
Premium and Discount zones are drawn using boxes and lines on the last bar only — they do not affect the chart's vertical price scale. Your candles will always display at their natural size.
Structure detection uses bar close confirmation — a swing high or low must be confirmed by the configured number of bars on each side before it is recognized as a pivot.
The maximum number of drawings for OBs, FVGs, structure lines, and EQ lines are all independently configurable. Older drawings beyond the limit are automatically removed.
Touch counting on Order Blocks uses a de-duplication method — price must leave the OB zone and re-enter to count as a new touch. Consecutive bars inside the same OB count as one touch.
FVG fill percentage is calculated based on the deepest penetration into the gap — even if price subsequently leaves the zone, the fill percentage reflects the maximum penetration achieved.
All calculations are non-repainting — signals are confirmed on bar close.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All structure levels, Order Blocks, Fair Value Gaps, and liquidity levels shown are derived from historical price data and their significance as support, resistance, or reaction zones is not guaranteed. Smart Money Concepts and ICT methodology are interpretive frameworks — they describe market behavior patterns but do not predict future price action with certainty. Past reactions at these levels do not guarantee future reactions. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who read the market the way institutions move it. Indicator

Proximated LiquidityProximated Liquidity: Adaptive Heatmap
Liquidity is the fuel that moves the market. However, it is important to clarify that this indicator is NOT based on L2 (Level 2) data or real-time Order Book data. Genuine liquidity can only be seen through order books.
Instead, this tool provides a Proximated Model of liquidity. While standard liquidity heatmaps often rely solely on simple ATR values (which can lack structural context), this indicator uses a sophisticated Pivot-based Hybrid Logic combined with ATR Adaptability to offer a more precise and structurally sound analysis of where liquidity is likely resting.
=================================================================================
🧠 The Philosophy: Why Pivot + ATR?
Many existing liquidity heatmaps simply draw boxes based on Volume & ATR, which often results in "floating" zones that don't align with market structure.
Proximated Liquidity solves this by:
Pivot-Based Anchoring: Using structural swing highs and lows as the "source" of liquidity. This ensures every zone is anchored to a price level that market participants actually react to.
ATR-Based Volume Scaling: Once a structural point is identified, ATR is used to calculate the "gravity field" or range of that liquidity, ensuring the zones adapt perfectly to current market volatility.
「 Note for ICT Purists : I understand that traditional ICT methodology often prioritizes "pure" price action and may view indicators like ATR or Volume weighting with skepticism. However, these elements have been meticulously integrated here to maximize the indicator's robustness and objectivity. My goal is not to replace the core principles of ICT, but to provide a data-driven "bridge" that helps traders identify high-probability liquidity clusters with greater consistency and visual clarity. 」
=================================================================================
=================================================================================
🚀 Key Features
1. Smart Auto Scaling
The indicator analyzes your current timeframe and pivot density to optimize visual output. The "Smart Scaling" logic ensures the liquidity zones are perfectly sized—thinner in low volatility and broader in high volatility—without manual tweaking.
2. State-Based Sweep Detection
This engine tracks the internal state of price action within the zone rather than deactivating it upon a simple touch.
Sweep (X Marker): If price enters a zone and is rejected back outside within your defined candle limit, it is marked with an 'X'.
Breakout: If price closes decisively beyond the outer edge of the zone, the liquidity is considered "mitigated," signaling a potential trend continuation.
3. Dual-Saturation Heatmap
Session Levels: Liquidity zones saturate within their session-specific colors based on volume and density.
Super Liquidity (Purple): When a zone's strength crosses a critical threshold, it transforms into a high-visibility Purple "Super Zone," acting as a major magnet for price.
4. Performance Optimized
Includes a History Limit toggle to focus calculations on recent bars, ensuring a lag-free experience even on 1-minute charts.
=================================================================================
=================================================================================
📈 How to Trade with Proximated Liquidity
A. The Liquidity Sweep (Rejection Play)
Look for the 'X' marker. When price "sweeps" a high-density pivot zone and rejects within 3-5 candles, it often signals a powerful reversal.
B. Structural Mitigation (Breakout Play)
If price closes through the outer edge of a box, that specific structural liquidity has been consumed. Watch for these levels to flip from resistance to support (or vice versa).
C. Super Liquidity Targeting
Purple zones represent clusters of significant historical interest. These areas frequently serve as high-probability Take Profit (TP) targets.
=================================================================================
=================================================================================
🛠 Settings Guide
Smart Auto Scaling: Recommended 'ON' for an optimized experience.
Max Sweep Candle Limit: Adjust based on your style (recommand 3 to 5).
Recent Bars Limit: Control how far back the indicator calculates to preserve browser performance.
=================================================================================
Disclaimer: This is a mathematical approximation model and does not represent actual exchange order book data. It is for educational and analytical purposes only and does not constitute financial advice.
License: CC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike) Indicator

Indicator

Statistical FVG | ProjectSyndicateStatistical FVG automatically identifies Fair Value Gaps, filters them by session Asian, London, NY, and presents a live statistical dashboard quantifying the historical performance of every FVG type. It transforms the subjective FVG pattern into a purely objective, data-driven trading tool.
🧠 Live Statistical Dashboard — The core of the indicator. This is not a static score. The dashboard displays the live, data-driven statistics for both Bullish and Bearish FVGs, including the Win Rate, Probability of Touch, Average Win/Loss Bars, R:R Ratio, Sample Size, and the critical Expected Value (EV). This gives you an instant, quantifiable edge.
🎯 Session-Specific Edge — The engine's most powerful feature. It doesn't just find FVGs; it categorizes them by the session in which they formed Asian, London, or New York. The dashboard allows you to see if, for example, Bearish FVGs from the New York session have a historically higher win rate and EV than those from the Asian session, allowing you to focus only on the highest-probability setups.
🎨 Normalized & Extended Zones — Eliminates visual noise from inconsistent FVG sizes. This feature forces every FVG zone to a uniform, clean height. It also extends the zones far into the future until they are mitigated, ensuring you never miss a reaction to a key level.
📊 Historical Zone Plotting — Mitigated doesn't mean forgotten. A toggleable option allows you to see all past, mitigated FVGs as faded, non-intrusive zones on your chart. This provides a complete historical footprint of where the market has reacted, allowing for deeper analysis of legacy price structures.
✅ Full-History Accumulator — The statistical engine's credibility comes from its depth. On every bar, it simulates the outcome of every valid FVG across the chart's full history, constantly feeding the win/loss accumulator. The stats you see are robust and based on a large sample size — not just the last few signals.
🔧 Fully Customizable — Control every aspect of the engine, including the TP/SL ATR ratios used for the statistical calculations and the colors/visibility of Bullish, Bearish, and Historical FVG zones.
🔬 Why this algo is unique: Standard FVG indicators are subjective — they just draw boxes on a 3-candle imbalance with no statistical proof of edge. The Manus FVG Stats Engine transforms this common pattern into an objective, quantitative trading instrument. It doesn't just show you an FVG; it shows you the historical performance and statistical probability of that FVG type working out, broken down by session, based on thousands of back-tested examples on the exact chart you are viewing.
🌐 Apply to Gold (XAUUSD), Indices (US30, NAS100), Forex Majors, and Crypto on M5, M15, or H1 timeframes. The engine is designed for intraday assets and timeframes that exhibit clear FVG structures and respect liquidity dynamics.
🗂️ How to use this? The most critical metric is the Expected Value (EV) on the dashboard. A positive EV for a specific FVG type e.g., Bullish NY/London indicates a statistical edge over the long term. Consider only taking trades from FVG types with a positive EV and a Win Rate that aligns with your risk tolerance. For higher-probability setups, align your trades with the prevailing higher-timeframe trend.
⚙️ IMPORTANT NOTICE: This indicator is a professional-grade tool designed to identify a statistical edge. It should NOT be used as a standalone signal for entering trades. Always use it in conjunction with your own trading strategy, price action analysis, and other technical indicators to confirm trade setups and manage risk. Indicator

Volumetric Inverse Fair Value Gap (VIFVG) [UAlgo]Volumetric Inverse Fair Value Gap is an imbalance analysis tool that tracks the full lifecycle of a Fair Value Gap and then focuses on what happens after that gap fails. Instead of stopping at the initial gap detection, the script stores qualifying bullish and bearish FVGs, waits for price to invalidate them from the opposite side, and then converts those failed imbalances into active Inverse Fair Value Gaps.
The main idea is rooted in role reversal. A bullish Fair Value Gap may initially represent an area of inefficiency below price, but if price later trades through that gap in the opposite direction, the same zone can flip into a bearish inverse area. The same logic applies in reverse for bearish gaps that later fail to the upside. This script automates that transition and keeps the resulting IFVG visible on the chart as long as it remains active.
What makes this version more distinctive is the volumetric overlay inside the inverse zone. Once an IFVG is created, the script attaches three internal metrics to it. The first estimates bullish participation, the second estimates bearish participation, and the third measures relative volume strength using percentile rank. These values are then displayed inside the box as horizontal progress bars, turning the IFVG into both a structural level and a compact participation summary.
The indicator also supports a ghost box that preserves the original FVG location from the moment it was created until the moment it became inverse. This gives the user a clearer narrative of how the imbalance formed and where the role reversal occurred. Combined with the active box, the result is a visually informative workflow for traders who want to study failed imbalances, structure flips, and how strong the inversion candle was when the role change happened.
In practical use, the script can help identify zones where a former inefficiency has turned into a reaction area, while also showing whether the inversion event carried more bullish pressure, more bearish pressure, or unusually strong participation relative to recent volume history.
🔹 Features
🔸 Fair Value Gap Detection With ATR Filtering
The script first detects classic three candle FVG structures, then filters them using a minimum gap size expressed in ATR units. This helps reduce noise and removes smaller gaps that may be less meaningful.
🔸 Strict and Non Strict Detection Modes
Strict mode requires actual wick separation between the first and third candle. Non strict mode allows close based confirmation instead. This gives the user control over how precise the gap definition should be.
🔸 Pending FVG Lifecycle Tracking
Detected FVGs are not immediately turned into inverse zones. They are first stored as pending gaps and monitored until price later crosses them in the opposite direction.
🔸 Automatic FVG to IFVG Conversion
When price invalidates a pending gap from the opposite side, the script creates a new Inverse Fair Value Gap object and begins tracking it as an active zone.
🔸 Ghost Box Support
The original FVG can be preserved visually as a dashed ghost box from the creation time of the imbalance to the inversion time. This makes it easier to see the original gap and the later role reversal event together.
🔸 Volumetric Breakdown Inside the IFVG
Each active inverse gap includes three stacked internal bars:
estimated bullish participation,
estimated bearish participation,
and relative strength.
This gives the zone more context than a normal box alone.
🔸 Participation Estimation From Candle Anatomy
Bullish and bearish participation are estimated from the inversion candle’s structure and volume. This creates a practical volume split model that helps describe how the inversion occurred.
🔸 Strength Metric From Volume Percentile Rank
The script measures how strong the inversion candle’s volume is relative to the last one hundred bars. This is displayed as a separate strength bar inside the IFVG.
🔸 Live Box Expansion
As long as an IFVG remains active, its container extends forward in time. The internal volumetric bars and text labels are updated continuously so the zone remains clear and readable.
🔸 Automatic Invalidation
A bullish IFVG is removed if price closes below its bottom. A bearish IFVG is removed if price closes above its top. This keeps the display focused on still valid inverse zones.
🔸 Controlled History Size
The script limits how many active IFVGs remain on the chart. Older ones are removed once the display exceeds the selected history count.
🔹 Calculations
1) Defining the Pending Gap and Active IFVG Objects
type PendingFVG
float top
float btm
bool is_bull_gap
bool processed
int created_time
type IFVG
int start_time
int origin_time
float top
float btm
bool is_bull_ifvg
float pct_bull
float pct_bear
float pct_strength
box container
box ghost_box
box bg_bull
box bar_bull
box bg_bear
box bar_bear
box bg_str
box bar_str
label lbl_bull
label lbl_bear
label lbl_str
bool active
This is the structural foundation of the script.
A PendingFVG stores an imbalance that has been detected but has not yet inverted. It contains the gap boundaries, whether the original gap was bullish or bearish, whether it has already been processed into an inverse gap, and the time when it was created.
An IFVG stores the full active inverse gap state. In addition to the price boundaries and direction, it also stores the three internal metrics, the container box, the optional ghost box, the internal background and progress bars, the labels, and the active state.
So the script is not just drawing boxes. It is managing two linked object lifecycles:
pending FVGs,
and active inverse FVGs.
2) ATR Filter for Gap Significance
float atr_val = ta.atr(14)
The ATR value is used as the script’s minimum significance filter.
Instead of accepting every visible gap, the script compares gap size against a fraction of ATR. This is useful because a fixed price threshold would behave very differently across markets and timeframes, while ATR gives a volatility aware reference.
So ATR acts as the noise filter that decides whether a newly found gap deserves to be tracked.
3) Estimating Bullish and Bearish Participation
calc_metrics(float o, float h, float l, float c, float v) =>
float rng = h - l
float buy_v = 0.0
if rng == 0
buy_v := v * 0.5
else
if c >= o
buy_v := v * ((math.abs(c - o) + (math.min(o, c) - l)) / rng)
else
buy_v := v * ((h - math.max(o, c)) / rng)
float sell_v = v - buy_v
float total = buy_v + sell_v
float p_bull = total > 0 ? buy_v / total : 0
float p_bear = total > 0 ? sell_v / total : 0
float p_str = ta.percentrank(v, 100) / 100.0
This function is one of the most important parts of the whole script.
Its goal is to turn one candle into three interpretable metrics:
bullish share,
bearish share,
and strength.
First, the script measures the candle range. If the candle has zero range, volume is split evenly.
If the candle has a real range, the script estimates buying pressure differently depending on candle direction.
For bullish candles, buy volume is influenced by the candle body plus the lower section of the candle.
For bearish candles, buy volume is approximated from the remaining upper section.
The result is not true exchange level aggressor volume, but it is a practical candle anatomy based estimate of how much of the inversion bar behaved more like buying versus selling.
Then the script converts those raw buy and sell estimates into proportions:
p_bull
and
p_bear
Finally, it calculates p_str using the percentile rank of current volume over the last one hundred bars. That means the strength value is not just raw volume. It describes how relatively strong the inversion candle was compared with recent history.
4) Reading the Current Candle Metrics
= calc_metrics(open, high, low, close, volume)
This line applies the volumetric function to the current bar.
These three values are later attached to a new IFVG at the moment of inversion. So each active inverse gap inherits the participation and strength profile of the candle that caused the role reversal.
That is important conceptually. The internal bars inside the IFVG are not random decorations. They represent the inversion event itself.
5) Detecting Bullish and Bearish FVGs
bool bull_cond = strict_mode ? (low > high ) : (close > high )
bool bear_cond = strict_mode ? (high < low ) : (close < low )
This block defines the actual Fair Value Gap logic.
In strict mode:
a bullish gap exists only when the current low is above the high from two bars ago,
and a bearish gap exists only when the current high is below the low from two bars ago.
That means actual wick separation is required.
In non strict mode:
the script relaxes this and allows close based confirmation instead.
So the user can choose whether the script should only accept clean wick gaps or allow a softer close based definition.
6) Measuring the Gap Size
float gap_size = 0.0
if bull_cond and close > open
gap_size := low - high
if bear_cond and close < open
gap_size := low - high
bool is_significant = gap_size >= (atr_val * fvg_threshold_atr)
Once a candidate FVG is found, the script measures how large the gap actually is.
For bullish gaps, the size is the distance between the current low and the high from two bars ago.
For bearish gaps, the size is the distance between the low from two bars ago and the current high.
The script also adds a candle direction filter on the middle bar:
bullish gaps require the middle candle to be bullish,
and bearish gaps require the middle candle to be bearish.
Finally, the measured gap must be at least as large as:
ATR × threshold
This removes smaller gaps that may simply be noise.
7) Storing a Pending FVG
if is_significant
PendingFVG p = PendingFVG.new()
p.created_time := time
p.processed := false
if bull_cond
p.is_bull_gap := true
p.top := low
p.btm := high
else
p.is_bull_gap := false
p.top := low
p.btm := high
array.push(pending_fvgs, p)
If the gap is significant, the script stores it as a pending FVG.
The gap is not drawn yet as an inverse zone. Instead, it is placed into the pending list with:
its direction,
its boundaries,
its creation time,
and a flag showing it has not yet been processed.
This is important because an FVG only becomes an IFVG after it fails. The pending list is the waiting room for that future role reversal.
8) Detecting the Inversion Event
if array.size(pending_fvgs) > 0
for i = array.size(pending_fvgs) - 1 to 0
PendingFVG p = array.get(pending_fvgs, i)
if not p.processed
bool inverted = false
bool to_bull = false
if not p.is_bull_gap and close > p.top
inverted := true
to_bull := true
if p.is_bull_gap and close < p.btm
inverted := true
to_bull := false
This is the core IFVG transition logic.
A pending bearish FVG becomes a bullish IFVG if price closes above its top.
A pending bullish FVG becomes a bearish IFVG if price closes below its bottom.
That is the actual role reversal event. Price has invalidated the original imbalance from the opposite side, so the gap flips into an inverse form.
The to_bull flag determines the direction of the new inverse zone.
9) Creating the IFVG Object
if inverted
IFVG obj = IFVG.new()
obj.start_time := time
obj.origin_time := p.created_time
obj.top := p.top
obj.btm := p.btm
obj.is_bull_ifvg := to_bull
obj.pct_bull := curr_p_bull
obj.pct_bear := curr_p_bear
obj.pct_strength := curr_p_str
obj.active := true
obj.create_drawings()
array.push(active_ifvgs, obj)
p.processed := true
Once inversion is confirmed, the script creates the active IFVG.
The new object inherits:
the original FVG boundaries,
the original creation time,
the inversion start time,
and the new inverse direction.
It also stores:
the bullish participation percentage,
the bearish participation percentage,
and the strength percentage from the inversion candle.
So the IFVG is a structural object with a built in event profile. It tells the user not only where the failed gap is located, but also what the inversion bar looked like in participation terms.
10) Creating the Ghost Box and Main Container
if show_ghost
this.ghost_box := box.new(
left=this.origin_time,
top=this.top,
right=this.start_time,
bottom=this.btm,
border_color=color.new(c_border, 20),
border_width=1,
border_style=line.style_dashed,
bgcolor=c_ghost,
xloc=xloc.bar_time
)
this.container := box.new(
left=this.start_time,
top=this.top,
right=time,
bottom=this.btm,
border_color=c_border,
border_width=1,
bgcolor=color(na),
xloc=xloc.bar_time
)
This is the first part of the IFVG drawing engine.
If ghost mode is enabled, the script draws a dashed box from the original FVG creation time to the inversion time. This visually represents the original gap before it failed.
Then it creates the main IFVG container box starting from the inversion time and extending to the current bar.
So the chart can show both:
where the original gap existed,
and where the inverse zone now lives.
11) Building the Internal Volumetric Bar Areas
this.bg_bull := box.new(this.start_time, this.top, time, this.top, border_width=0, bgcolor=c_bg_dark, xloc=xloc.bar_time)
this.bar_bull := box.new(this.start_time, this.top, this.start_time, this.top, border_width=0, bgcolor=c_bull_bar, xloc=xloc.bar_time)
this.bg_bear := box.new(this.start_time, this.top, time, this.top, border_width=0, bgcolor=c_bg_dark, xloc=xloc.bar_time)
this.bar_bear := box.new(this.start_time, this.top, this.start_time, this.top, border_width=0, bgcolor=c_bear_bar, xloc=xloc.bar_time)
this.bg_str := box.new(this.start_time, this.top, time, this.top, border_width=0, bgcolor=c_bg_dark, xloc=xloc.bar_time)
this.bar_str := box.new(this.start_time, this.top, this.start_time, this.top, border_width=0, bgcolor=c_str_bar, xloc=xloc.bar_time)
Inside every IFVG, the script creates three horizontal rows.
Each row has:
a dark background box,
and a colored progress bar box.
The three rows represent:
bullish participation,
bearish participation,
and strength.
Initially these boxes are created with minimal size. Their real geometry is set later during updates.
So the IFVG is designed as a mini information panel embedded directly inside the zone.
12) Slicing the IFVG Into Three Metric Rows
float total_h = this.top - this.btm
float h_slice = total_h / 3
float y1 = this.top
float y2 = this.top - h_slice
float y3 = this.top - 2 * h_slice
float y4 = this.btm
This block divides the IFVG vertically into three equal sections.
The full height of the box is measured, then split into thirds:
the first slice for bullish participation,
the second slice for bearish participation,
the third slice for strength.
This makes the internal visualization clean and consistent regardless of zone height.
13) Converting Percentages Into Horizontal Width
int now = time
int dur = now - this.start_time
if dur <= 0
dur := timeframe.in_seconds() * 1000
int w_bull = math.round(dur * this.pct_bull)
int w_bear = math.round(dur * this.pct_bear)
int w_str = math.round(dur * this.pct_strength)
This is how the script turns percentages into visible progress bars.
The available horizontal width is the elapsed time from the IFVG start to the current bar. That duration becomes the maximum usable width.
Then each stored metric is multiplied by that duration:
bullish percentage controls the bullish bar width,
bearish percentage controls the bearish bar width,
strength percentage controls the strength bar width.
So the internal bars behave like proportion meters stretched across the live duration of the zone.
14) Updating the Bull, Bear, and Strength Bars
this.bg_bull.set_left(this.start_time)
this.bg_bull.set_right(now)
this.bg_bull.set_top(y1)
this.bg_bull.set_bottom(y2)
this.bar_bull.set_left(this.start_time)
this.bar_bull.set_right(this.start_time + w_bull)
this.bar_bull.set_top(y1)
this.bar_bull.set_bottom(y2)
this.bg_bear.set_left(this.start_time)
this.bg_bear.set_right(now)
this.bg_bear.set_top(y2)
this.bg_bear.set_bottom(y3)
this.bar_bear.set_left(this.start_time)
this.bar_bear.set_right(this.start_time + w_bear)
this.bar_bear.set_top(y2)
this.bar_bear.set_bottom(y3)
this.bg_str.set_left(this.start_time)
this.bg_str.set_right(now)
this.bg_str.set_top(y3)
this.bg_str.set_bottom(y4)
this.bar_str.set_left(this.start_time)
this.bar_str.set_right(this.start_time + w_str)
this.bar_str.set_top(y3)
this.bar_str.set_bottom(y4)
These blocks physically place the three metric layers inside the IFVG.
Each background row spans the full current width of the active zone.
Each colored bar spans only the proportional amount determined by the stored metric.
So if bullish participation is high, the bullish bar stretches farther across its row. If strength is low, the strength bar remains shorter.
This gives the zone an at a glance internal profile.
15) Updating the Text Labels
this.lbl_bull.set_xy(center_x, mid_bull)
this.lbl_bull.set_text(str.format("Bull: {0}%", math.round(this.pct_bull * 100)))
this.lbl_bear.set_xy(center_x, mid_bear)
this.lbl_bear.set_text(str.format("Bear: {0}%", math.round(this.pct_bear * 100)))
this.lbl_str.set_xy(center_x, mid_str)
this.lbl_str.set_text(str.format("Str: {0}%", math.round(this.pct_strength * 100)))
The script also prints the numerical values inside the three rows.
Each label is placed at the center of its row and updated with the rounded percentage value.
So the user sees both:
the visual bar length,
and the exact stored percentage.
This makes the IFVG readable even when box width is large or when color alone is not enough.
16) IFVG Invalidation Logic
bool broken = false
if this.is_bull_ifvg and close < this.btm
broken := true
if not this.is_bull_ifvg and close > this.top
broken := true
if broken
this.active := false
this.remove()
An active IFVG only remains valid while price stays on the correct side of its structure.
For bullish IFVG:
if close falls below the bottom, the zone is broken.
For bearish IFVG:
if close rises above the top, the zone is broken.
When that happens, the IFVG is marked inactive and all associated objects are deleted.
So the indicator is not just drawing inverse gaps indefinitely. It actively monitors whether they continue to behave as valid reaction zones.
17) Display Limit Management
while array.size(active_ifvgs) > show_last_n
IFVG d = array.shift(active_ifvgs)
d.remove()
This final block controls how many IFVGs remain visible.
If the number of active inverse gaps exceeds the selected display limit, the oldest one is removed from the front of the array and all of its drawings are deleted.
This keeps the chart focused on the most recent inverse gaps and prevents excessive visual clutter. Indicator

Liquidity Heatmap [MTF] - Volume Delta [PhenLabs]Liquidity Heatmap — Volume Delta
Version: PineScript™ v6
📌 Description
The PhenLabs Liquidity Heatmap — Volume Delta is an advanced, anti-clutter volume and order flow analysis tool. It calculates and visualizes a single composite profile by merging Volume and Delta data across up to four distinct timeframes simultaneously. By isolating the Point of Control (PoC) and Delta-PoC, this indicator helps traders pinpoint high-probability liquidity zones, accumulation/distribution nodes, and critical support/resistance levels without overwhelming the chart with overlapping profiles.
🚀 Points of Innovation
Single Composite Profile: Merges multiple timeframe profiles into one clean, unified heatmap, drastically reducing chart clutter.
Integrated Delta Analysis: Evaluates intrabar buying and selling pressure to locate the Delta-PoC, revealing where institutional aggression is concentrated.
Automated MTF Confluence: Detects and highlights overlapping liquidity zones across different timeframes based on customizable tolerance percentages.
🔧 Core Components
Bin Computation Engine: Divides price action into a user-defined number of price bins, aggregating both total volume and delta over a specified lookback period.
MTF Data Aggregation: Utilizes advanced security requests to fetch bin data from up to four different timeframes (e.g., 1m, 15m, 1H, 4H) without repainting.
State Tracking: Monitors the shift in PoC and Delta-PoC to detect bias flips and momentum changes.
🔥 Key Features
Dynamic Dashboard: An interactive on-chart table displays current PoC, Delta-PoC, directional bias, and structural flips for each active timeframe.
Actionable Signals: Automatically plots on-chart labels for PoC Breakouts (▲/▼) and Delta Reversals (Δ↑/Δ↓) to highlight immediate trade opportunities.
Accumulation/Distribution Tinting: Visually labels volume nodes to quickly identify where buyers or sellers are trapped.
Customizable Cutoffs: Includes a volume cutoff filter to hide insignificant price bins and maintain visual clarity.
🎨 Visualization
Shaded Heatmap Bins: Projects volume nodes directly onto the price axis.
Precision Lines: Clearly plots the PoC and Delta-PoC levels for precise entry and exit targeting.
On-Chart Labels: Minimalist signal tags keep the focus on price action while alerting to structural shifts.
📖 Usage Guidelines
Lookback & Bins: Adjust the lookback bars (default 200) and price bins (default 50) based on your chart's volatility. Fewer bins provide a cleaner look.
Timeframes: Enable up to three additional higher timeframes to build a comprehensive view of macro liquidity.
Volume Cutoff: Increase the cutoff percentage to hide thin, irrelevant volume nodes and focus solely on high-value areas.
✅ Best Use Cases
Liquidity Sweeps: Watch for price to pierce the composite PoC or Delta-PoC and reject, signaling a successful liquidity sweep.
Trend Continuation: Enter trades in the direction of the macro bias when lower timeframe Delta Reversal signals align with higher timeframe PoCs.
Breakout Trading: Capitalize on explosive moves when price definitively breaks and holds outside a clustered MTF confluence zone.
💡 Note
This indicator is optimized for lower timeframes acting as the base chart, with higher timeframes providing the macro structural data. Always use this tool in conjunction with price action analysis and broader market context.
Indicator
