Turbulence Fractal Scanner [JOAT]Turbulence Fractal Scanner
Introduction
The Turbulence Fractal Scanner is an advanced open-source volatility chaos prediction engine that combines ATR, Bollinger Band Width, Keltner Channels, Historical Volatility, and Squeeze detection into a unified volatility analysis system. This indicator measures market turbulence across multiple dimensions, creating a comprehensive volatility index that reveals expansion/contraction cycles, squeeze conditions, and breakout predictions.
Unlike single-dimension volatility indicators, the Turbulence Fractal Scanner provides multi-layered volatility intelligence through percentile ranking, composite indexing, regime classification, and squeeze detection. The indicator is designed for traders who understand that volatility precedes price movement and that multi-dimensional volatility analysis provides early warning of significant market shifts.
Why This Indicator Exists
This indicator addresses the need for comprehensive volatility analysis that goes beyond simple ATR or Bollinger Bands. By combining five distinct volatility methodologies, it reveals:
ATR Analysis: Average True Range measures actual price movement volatility
Bollinger Band Width: Measures price dispersion relative to moving average
Keltner Channels: ATR-based bands for volatility envelope detection
Historical Volatility: Statistical measure of price returns volatility
Squeeze Detection: Identifies when Bollinger Bands contract inside Keltner Channels
Composite Volatility Index: Unified measure combining all five components
Regime Classification: Categorizes volatility as Low, Normal, High, or Squeeze
Breakout Prediction: Detects squeeze breakouts with directional bias
Core Components Explained
1. ATR (Average True Range) Analysis
ATR measures the average range of price movement:
True Range: Maximum of (high - low), (high - previous close), (previous close - low)
ATR Calculation: Moving average of true range over period (default 14)
ATR Smoothing: Additional EMA smoothing (default 7) reduces noise
ATR Percent: ATR divided by close, expressed as percentage
ATR Percentile: ATR ranked against 100-bar history (0-100 scale)
ATR percentile shows whether current volatility is high or low relative to recent history. High percentile (> 70) indicates elevated volatility, low percentile (< 30) indicates compressed volatility.
2. Bollinger Band Width Analysis
BB Width measures price dispersion:
Bollinger Bands: SMA ± (standard deviation × multiplier)
BB Width: (Upper band - Lower band) / Middle band × 100
BB Width Percentile: Current width ranked against 100-bar history
Narrow BB Width indicates low volatility and potential breakout setup. Wide BB Width indicates high volatility and potential mean reversion.
3. Keltner Channel Analysis
Keltner Channels use ATR for volatility bands:
Basis: EMA of close (default 20 periods)
Range: ATR × multiplier (default 1.5)
Upper/Lower: Basis ± Range
Keltner Channels adapt to volatility changes and are used in squeeze detection.
4. Squeeze Detection
Squeeze occurs when Bollinger Bands contract inside Keltner Channels:
Squeeze On: BB Lower > KC Lower AND BB Upper < KC Upper
Squeeze Off: Bands no longer contracted
Squeeze Breakout: Transition from Squeeze On to Squeeze Off
Breakout Direction: Determined by close comparison (close > close = bullish)
Squeezes indicate extreme volatility compression. Breakouts from squeezes often lead to significant directional moves.
5. Historical Volatility (HV) Calculation
HV measures statistical volatility of returns:
Returns: Logarithmic price changes (log(close / close ))
Standard Deviation: StdDev of returns over period (default 20)
Annualization: Multiply by sqrt(252) for annual volatility (optional)
HV Percentile: Current HV ranked against 100-bar history
HV provides a statistical measure of actual price volatility, complementing the technical measures (ATR, BB Width).
6. Composite Volatility Index
All three percentile measures are combined into a unified index:
Volatility Index = (ATR Percentile + BB Width Percentile + HV Percentile) / 3
This composite index provides a balanced view of volatility across multiple methodologies. Values range from 0 (extremely low volatility) to 100 (extremely high volatility).
7. Volatility Regime Classification
The indicator classifies volatility into four regimes:
Squeeze (Priority): When squeeze is active, regardless of volatility index
Low Volatility: Volatility Index < threshold (default 30)
Normal Volatility: Volatility Index between low and high thresholds (30-70)
High Volatility: Volatility Index > threshold (default 70)
Regime classification helps traders adapt strategies to current volatility conditions.
8. Volatility Trend Analysis
The indicator tracks volatility direction:
Volatility Trend: 5-period SMA of Volatility Index
Rising Volatility: Trend rising for 3+ consecutive bars
Falling Volatility: Trend falling for 3+ consecutive bars
Expansion: Volatility Index rising for 3+ consecutive bars
Contraction: Volatility Index falling for 3+ consecutive bars
Volatility trends help predict whether turbulence is increasing or decreasing.
9. Breakout Prediction System
The indicator predicts breakouts from squeeze conditions:
Squeeze Breakout: Detected when squeeze transitions from On to Off
Direction: Bullish if close > close , bearish if close < close
Volatility Confirmation: Best breakouts occur when Volatility Index < 40 (compressed)
Breakouts from low volatility squeezes often lead to sustained directional moves.
10. Turbulence Shift Detection
The indicator identifies regime changes:
Regime Shift: When volatility regime changes (Low ↔ Normal ↔ High ↔ Squeeze)
Anti-Overlap: Minimum 10 bars between shift signals
High Vol Entry: Shift into High Volatility regime
Low Vol Entry: Shift into Low Volatility regime
Regime shifts provide early warning of changing market conditions.
Visual Elements
Volatility Index Line: Main line showing composite volatility with regime-based coloring (purple = squeeze, red = high, cyan = low, yellow = normal)
Component Lines: Three thin lines showing ATR, BB Width, and HV percentiles
Volatility Trend Line: Step-line showing smoothed volatility trend
Threshold Lines: Horizontal lines at high (70) and low (30) thresholds, plus median (50)
Zone Fills: Shaded areas above high threshold (red) and below low threshold (cyan)
Squeeze Background: Purple background when squeeze is active
Breakout Signals: Triangles marking squeeze breakouts (cyan = bullish, red/orange = bearish)
Regime Shift Circles: Small circles marking regime transitions
Information Dashboard: Displays regime, volatility index, ATR/BB/HV percentiles, squeeze status, volatility trend, expansion/contraction, breakout status, ATR/BB values, and overall signal
How to Use This Indicator
Step 1: Check Volatility Regime
Monitor the dashboard for current regime (Squeeze, Low Vol, Normal, High Vol). Adapt strategy to regime.
Step 2: Monitor Volatility Index
Volatility Index < 30 = compressed (potential breakout setup)
Volatility Index > 70 = elevated (potential mean reversion or continuation)
Step 3: Watch for Squeeze Conditions
Purple background indicates squeeze. Prepare for breakout when squeeze ends.
Step 4: Identify Breakout Direction
When squeeze breakout occurs, triangle color shows direction (cyan = bullish, red = bearish).
Step 5: Check Volatility Trend
Rising volatility = increasing turbulence, falling volatility = calming conditions.
Step 6: Monitor Expansion/Contraction
Expanding volatility often precedes strong moves. Contracting volatility suggests consolidation.
Step 7: Use Regime Shifts as Alerts
Shifts into High Vol or Low Vol regimes provide early warning of changing conditions.
Best Practices
Trade breakouts from squeeze conditions with low volatility index (< 40)
Avoid trend-following strategies in high volatility regimes (> 70)
Use low volatility regimes (< 30) to prepare for breakout setups
Monitor all three components (ATR, BB, HV) for confirmation
Rising volatility in low regime warns of impending breakout
Falling volatility in high regime suggests consolidation ahead
Combine with trend indicators - volatility shows when, trend shows direction
Be cautious of false breakouts - wait for volatility confirmation
Input Parameters
ATR Configuration:
ATR Length: Period for ATR calculation (default: 14)
ATR Smoothing: EMA smoothing period (default: 7)
Bollinger Bands:
BB Length: Period for BB calculation (default: 20)
BB Multiplier: Standard deviation multiplier (default: 2.0)
Keltner Channels:
KC Length: Period for KC basis (default: 20)
KC Multiplier: ATR multiplier for bands (default: 1.5)
Historical Volatility:
HV Length: Period for HV calculation (default: 20)
Annualize HV: Convert to annual volatility (default: enabled)
Regime Thresholds:
Low Volatility: Threshold for low regime (default: 30)
High Volatility: Threshold for high regime (default: 70)
Visual Configuration:
Low/Normal/High/Squeeze Colors: Customizable regime colors
Originality Statement
This indicator is original in its comprehensive volatility analysis approach. While individual components (ATR, BB, KC, HV, Squeeze) are established concepts, this indicator is justified because:
It combines five distinct volatility methodologies into a unified composite index
Percentile ranking normalizes all components to a common 0-100 scale
The regime classification system categorizes volatility conditions systematically
Squeeze detection with breakout prediction provides actionable trading signals
Volatility trend and expansion/contraction analysis predict volatility direction
Turbulence shift detection identifies regime changes early
The comprehensive dashboard presents all volatility dimensions simultaneously
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Volatility analysis does not guarantee profitable trades. Low volatility does not guarantee breakouts. High volatility does not guarantee reversals. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Velocity Spectrum Analyzer [JOAT]Velocity Spectrum Analyzer
Introduction
The Velocity Spectrum Analyzer is an advanced open-source momentum wave system that combines Munich Wave methodology with ALMA enhancement and multi-basis momentum tracking. This indicator analyzes momentum across five distinct velocity layers, creating a spectrum of momentum waves that reveal trend strength, regime shifts, and momentum alignment across multiple timeframes.
Unlike single-line momentum indicators, the Velocity Spectrum Analyzer provides multi-dimensional momentum analysis through layered EMA calculations, ALMA enhancement, regime classification, and spread analysis. The indicator is designed for traders who understand that momentum flows in waves and that multi-layer alignment signals institutional conviction.
Why This Indicator Exists
This indicator addresses the need for multi-dimensional momentum analysis. By combining five momentum layers with ALMA enhancement and regime detection, it reveals:
Five Velocity Layers: Fast (9), Medium (21), Slow (55), Very Slow (100), and Ultra Slow (200) EMAs create a momentum spectrum
ALMA Enhancement: Arnaud Legoux Moving Average provides adaptive smoothing with reduced lag
Basis Calculations: Averages between EMA layers create intermediate momentum levels
Regime Classification: Extreme Bull/Bear detection using Bollinger-style bands
Spread Analysis: Distance between fast and slow layers measures momentum strength
Wave State Detection: All layers bullish or bearish signals strong directional momentum
Background Coloring: Visual regime indication shows extreme conditions
Core Components Explained
1. Core Momentum Calculation
The indicator starts with basic momentum (current close minus close N bars ago), then applies ALMA for adaptive smoothing:
The ALMA offset (default 0.85) and sigma (default 6) parameters control the balance between responsiveness and smoothness. Higher offset values shift the average toward recent prices, while higher sigma values increase smoothness.
2. Five EMA Layers
Five EMAs are calculated on the momentum values:
Fast EMA (9): Captures short-term momentum shifts
Medium EMA (21): Tracks intermediate momentum trends
Slow EMA (55): Identifies primary momentum direction
Very Slow EMA (100): Reveals long-term momentum bias
Ultra Slow EMA (200): Shows institutional momentum positioning
Each layer responds at different speeds, creating a spectrum of momentum perspectives.
3. Basis Calculations
Five basis levels are calculated as averages between EMA layers:
Basis 1: Average of Fast and Medium EMAs
Basis 2: Average of Medium and Slow EMAs
Basis 3: Average of Slow and Very Slow EMAs
Basis 4: Average of Very Slow and Ultra Slow EMAs
Basis 5: Average of Ultra Slow and Fast EMAs (wraps around)
These basis levels create intermediate momentum zones that smooth transitions between layers.
4. Trend Classification Functions
Two functions classify momentum direction:
Growing: Momentum > basis (bullish momentum)
Falling: Momentum <= basis AND momentum <= ALMA (bearish momentum)
Each basis is classified independently, creating five separate momentum assessments.
5. Regime Detection with Bollinger-Style Bands
The indicator calculates bands around the average of all five basis levels:
Origin: SMA of basis average (default 25 periods)
Deviation: Standard deviation multiplied by factor (default 6.0)
Top Band: Origin + deviation (extreme bullish threshold)
Bottom Band: Origin - deviation (extreme bearish threshold)
When basis 1 and ALMA both exceed the top band with rising momentum, the indicator signals extreme bullish conditions. When both fall below the bottom band with falling momentum, it signals extreme bearish conditions.
6. Mean Range Calculation
A long-term mean range (default 415 bars) tracks the highest and lowest basis average values. The center of this range serves as a reference point for ALMA positioning. When ALMA is above the center mean with all layers bullish, strong upward momentum is confirmed.
7. Wave State Analysis
The indicator tracks when all five basis levels are simultaneously bullish or bearish:
All Bullish: All five basis levels show growing momentum - strong uptrend
All Bearish: All five basis levels show falling momentum - strong downtrend
Mixed: Some layers bullish, some bearish - transitional or choppy conditions
Wave state alignment indicates institutional conviction across all momentum timeframes.
8. Spread Calculation
The spread between Basis 1 (fastest) and Basis 5 (slowest) measures momentum divergence:
Positive Spread (> 10): Fast momentum exceeds slow momentum - bullish acceleration
Negative Spread (< -10): Fast momentum below slow momentum - bearish acceleration
Extreme Spread (> 20 or < -20): Very strong momentum divergence - potential exhaustion
Large spreads indicate strong directional momentum, while narrowing spreads warn of momentum loss.
Visual Elements
Five Velocity Layer Lines: Thick colored lines showing each basis level with dynamic coloring (cyan = bullish, yellow = bearish, white = neutral)
ALMA Enhanced Line: Separate line showing ALMA-adjusted momentum with tri-color scheme
Wave State Line: Zero line colored based on overall wave state
Background Regime: Red background for extreme bull, green background for extreme bear
Information Dashboard: Displays wave state, regime, spread, ALMA position, momentum value, layer alignment, and signal status
Signal Generation
The indicator generates four types of signals:
Lean Short: Bearish crossover with falling Basis 1 and 2, spread <= -10
Maybe Buy: Bearish crossover with falling Basis 1 and 2, extreme bear regime, spread <= -20 (oversold)
Lean Long: Bullish crossover with growing Basis 1 and 2, spread >= 10
Maybe Sell: Bullish crossover with growing Basis 1 and 2, extreme bull regime, spread >= 20 (overbought)
Additional signals:
All Aqua: All layers bullish for 4+ consecutive bars - strong uptrend confirmation
All Yellow: All layers bearish for 4+ consecutive bars - strong downtrend confirmation
How to Use This Indicator
Step 1: Check Wave State
Monitor the dashboard for wave state (All Bullish, All Bearish, or Mixed). Trade in the direction of wave state alignment.
Step 2: Analyze Regime
Watch for extreme bull/bear regimes (red/green backgrounds). These often precede reversals or strong continuation moves.
Step 3: Monitor Spread
Large spreads (> 20 or < -20) indicate strong momentum but potential exhaustion. Narrowing spreads warn of momentum loss.
Step 4: Check ALMA Position
ALMA above center mean with bullish layers confirms uptrend. ALMA below center mean with bearish layers confirms downtrend.
Step 5: Count Layer Alignment
The dashboard shows how many layers are bullish (X/5). 5/5 bullish = strongest uptrend, 0/5 bullish = strongest downtrend.
Step 6: Wait for Signal Confirmation
Lean Long/Short signals work best when wave state aligns. Maybe Buy/Sell signals at extremes offer reversal opportunities.
Best Practices
Trade with wave state alignment, not against it
Use extreme regimes as reversal warnings, not continuation signals
Monitor spread for momentum strength - large spreads indicate strong trends
Wait for all layers to align (5/5) before taking aggressive positions
Use Maybe Buy/Sell signals only at extreme regimes with high spread
Combine with price action - momentum shows intent, price shows result
Be cautious when layers are mixed (2/5 or 3/5) - indicates choppy conditions
Watch for spread narrowing as early warning of trend exhaustion
Input Parameters
Momentum Engine:
Source: Price input (default: close)
Momentum Length: Period for momentum calculation (default: 21)
ALMA Offset: Offset parameter for ALMA (default: 0.85)
ALMA Sigma: Sigma parameter for ALMA (default: 6)
Momentum Layers:
Fast EMA: Short-term momentum (default: 9)
Medium EMA: Intermediate momentum (default: 21)
Slow EMA: Primary momentum (default: 55)
Very Slow EMA: Long-term momentum (default: 100)
Ultra Slow EMA: Institutional momentum (default: 200)
Regime Classification:
Mean Lookback: Period for mean range (default: 415)
StdDev Length: Period for standard deviation (default: 25)
StdDev Multiplier: Band width multiplier (default: 6.0)
Background Offset: Shift background display (default: 0)
Visual Configuration:
Bullish Color: Color for bullish momentum (default: cyan)
Bearish Color: Color for bearish momentum (default: yellow)
Neutral Color: Color for neutral momentum (default: white)
Enable Alerts: Toggle alert conditions (default: enabled)
Originality Statement
This indicator is original in its multi-layer momentum approach. While individual components (EMAs, ALMA, momentum) are established concepts, this indicator is justified because:
It combines five distinct momentum layers into a unified spectrum analysis
The basis calculation system creates intermediate momentum zones between layers
ALMA enhancement provides adaptive smoothing with reduced lag
Regime detection using Bollinger-style bands on basis average identifies extremes
Wave state analysis tracks alignment across all five layers simultaneously
Spread calculation measures momentum divergence between fast and slow layers
The comprehensive dashboard presents all momentum dimensions simultaneously
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Momentum analysis does not guarantee profitable trades. Past momentum patterns do not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Bastion Execution Protocol [JOAT]Bastion Execution Protocol
Introduction
The Bastion Execution Protocol is an open-source automated trading strategy built in Pine Script v6. It combines regime detection, market structure analysis, dual momentum confirmation (RSI + Stochastic Momentum Index), order flow validation (CVD), candle pattern recognition, session filtering, and dynamic risk management into a single institutional-grade execution framework. The strategy is designed to take high-confluence directional trades only when multiple independent factors align — regime, structure, momentum, volume flow, and session — while managing risk through ATR-based stop losses, configurable reward-to-risk ratios, trailing stops, regime-adaptive position sizing, daily trade limits, and end-of-day forced closes.
This is not a "set and forget" black box. It is a transparent, fully configurable framework where every entry condition, risk parameter, and filter can be adjusted. The strategy is published open-source so traders can study the logic, understand why each trade is taken, and adapt the parameters to their instruments and timeframes.
Why This Strategy Exists
Most published strategies on PulseWire fall into two categories: overly simple (single indicator crossover) or overly complex (dozens of conditions that overfit to historical data). This strategy occupies the middle ground — it requires meaningful confluence from independent analytical dimensions without over-optimizing to specific historical patterns:
Multi-Factor Entry Gate: Every trade requires agreement from regime detection, market structure, momentum oscillators, and optionally CVD order flow and candle patterns. No single factor can trigger a trade alone.
Regime-Aware Execution: The strategy only trades in trending regimes by default. It avoids squeeze conditions and can be configured to require specific regime states. Position sizing automatically reduces in volatile or uncertain regimes.
Session Intelligence: Trades are filtered by session (London, New York, Kill Zones) and day of week. The strategy avoids low-quality periods and forces position closure at end of day.
Dynamic Risk Management: ATR-based stop losses adapt to current volatility. Trailing stops activate after a configurable profit threshold. Position sizing is calculated from account equity and risk percentage, then adjusted by regime conditions.
Performance Tracking: Real-time HUD displays win rate, profit factor, max drawdown, daily trade count, and current position status.
Strategy Architecture — 9 Modules
The strategy is organized into 9 sequential modules, each responsible for a specific aspect of the trading process:
Module 1: Regime Detection
The regime engine classifies the market into four states using SMA alignment and VWAP slope:
Trend Up: SMA 20 > 50 > 200 (bull alignment) AND positive VWAP slope — clear upward momentum
Trend Down: SMA 20 < 50 < 200 (bear alignment) AND negative VWAP slope — clear downward momentum
Squeeze: Bollinger Band width in the bottom 10th percentile — volatility compression
Range: No SMA alignment and flat VWAP slope — sideways conditions
The VWAP slope is normalized by ATR to make it comparable across instruments with different price scales. The regime state directly controls whether trading is allowed — by default, the strategy requires a trending regime.
Module 2: Market Structure
Swing-based structure tracking identifies the directional bias:
Pivot highs and lows are detected using configurable lookback
When price closes above the last swing high while structure was bearish or neutral, structure flips bullish
When price closes below the last swing low while structure was bullish or neutral, structure flips bearish
Structure must agree with the regime for entries — regime bullish + structure bullish = long allowed
Displacement candle detection identifies aggressive institutional order flow — candles with body >= 70% of range and body >= 1.8x the 20-bar average body. These serve as entry triggers when all other conditions are met.
Module 3: Momentum Confirmation
Dual momentum confirmation requires both RSI and SMI to agree:
RSI: Must be above the bull threshold (default 55) for longs, below the bear threshold (default 45) for shorts
Stochastic Momentum Index: Must be positive for longs, negative for shorts. The SMI measures where price sits relative to the midpoint of its recent range, double-smoothed for noise reduction.
Both must agree — RSI bullish AND SMI bullish = momentum confirmed for longs
Module 3B: CVD Order Flow Confirmation
When enabled, Cumulative Volume Delta must support the trade direction:
Buy volume is estimated from bullish candles (close > open = full volume, otherwise proportional)
Sell volume = total volume minus buy volume
CVD = cumulative sum of (buy volume - sell volume)
CVD must be above its moving average for longs, below for shorts
This ensures that actual volume flow supports the intended trade direction
Module 3C: Candle Pattern Detection
When enabled, the strategy detects institutional candle patterns as entry triggers:
Bullish Engulfing: Current bullish candle fully engulfs the prior bearish candle's body, with volume above average
Bearish Engulfing: Current bearish candle fully engulfs the prior bullish candle's body, with volume above average
Bullish Pin Bar: Lower wick > 2x body, upper wick < 0.5x body — rejection of lower prices
Bearish Pin Bar: Upper wick > 2x body, lower wick < 0.5x body — rejection of higher prices
Patterns serve as alternative entry triggers alongside displacement candles. Either a displacement candle, a pattern, or price above SMA20 + VWAP can trigger entry when all other conditions are met.
Module 4: Session Filter
The session filter controls when trading is allowed:
Four session windows: NY Kill Zone (7-10am), London Kill Zone (2-5am), NY Session (9:30am-4pm), London Session (3am-9:30am)
Each session can be individually enabled/disabled
Day of week filter allows disabling specific days (e.g., avoid Mondays or Fridays)
Configurable timezone (default: America/New_York)
End-of-day forced close at configurable time (default: 3:45pm)
Module 5: Daily Trade Counter
A daily trade counter prevents overtrading:
Resets at the start of each new day
Configurable maximum trades per day (default: 3)
Combined with squeeze avoidance and regime filtering for comprehensive trade gating
Module 6: Entry Signal Generation
Entry signals require ALL of the following to be true simultaneously:
// Long entry requires full confluence:
// 1. Regime = Trend Up
// 2. Structure trend = Bullish (swing break confirmed)
// 3. RSI > bull threshold AND SMI > 0
// 4. CVD above its MA (if enabled)
// 5. Bar is confirmed (barstate.isconfirmed)
// 6. Trade is allowed (daily limit, session, no squeeze)
// 7. Trigger: displacement candle OR pattern OR price > SMA20 + VWAP
This multi-gate approach ensures that trades are only taken when regime, structure, momentum, volume flow, session, and a specific trigger all agree. The probability of a random signal passing all gates is very low, which is by design.
Module 7: Risk Calculations
Risk is calculated dynamically for each trade:
Stop Loss: ATR * configurable multiplier (default 1.5x) below entry for longs, above for shorts
Take Profit: SL distance * reward-to-risk ratio (default 2.0x)
Position Size: (Account Equity * Risk Percentage * Regime Multiplier) / SL Distance
Regime-Adaptive Sizing: When enabled, position size is reduced to 50% during squeeze conditions and 70% during non-trending conditions. Full size is used only in trending regimes.
Module 8: Trade Execution
Entries are executed using strategy.entry() with calculated position size. The strategy tracks active trade parameters (entry price, SL, TP) for trailing stop management.
Module 9: Exit Management
Three exit mechanisms operate simultaneously:
Fixed SL/TP: strategy.exit() with the calculated stop loss and take profit levels
Trailing Stop: When enabled, activates after price moves a configurable multiple of R in profit (default 1.0R). The trail distance is ATR * configurable multiplier (default 1.0x). The trailing stop only moves in the favorable direction and replaces the fixed SL when it is tighter.
End-of-Day Close: All positions are closed at the configured time to avoid overnight risk
Performance Tracking
The strategy tracks and displays real-time performance metrics:
Win Rate: Wins / (Wins + Losses) as a percentage
Profit Factor: Gross Profit / Gross Loss — values above 1.5 indicate a healthy edge
Max Drawdown: Peak-to-trough equity decline as a percentage
Net P&L: Total net profit/loss
Daily Trade Count: Current day's trades vs maximum allowed
Strategy Settings and Backtesting Notes
The strategy is configured with realistic default parameters:
Initial Capital: $100,000
Default Position Size: 2% of equity
Risk Per Trade: 1.5% (configurable)
Commission: Not included by default — users should add commission appropriate to their broker in the strategy settings
Slippage: Not included by default — users should add slippage appropriate to their instrument
calc_on_every_tick: false — the strategy only evaluates on confirmed bar closes to prevent repainting
calc_on_order_fills: true — allows trailing stop updates on fill events
Important: Before evaluating backtest results, users should:
Add realistic commission for their broker (e.g., $5 per trade for stocks, 0.1% for crypto)
Add realistic slippage (e.g., 1-2 ticks for liquid instruments)
Verify that the backtest period includes different market conditions (trending, ranging, volatile)
Check that the number of trades is sufficient for statistical significance (100+ trades recommended)
Understand that past performance does not guarantee future results
Input Parameters
Risk Management:
Risk Per Trade %: Percentage of equity risked per trade (default: 1.5%)
Reward:Risk Ratio: TP distance as multiple of SL distance (default: 2.0)
SL ATR Multiplier: Stop loss distance as ATR multiple (default: 1.5)
ATR Length: Period for ATR calculation (default: 14)
Use Trailing Stop: Enable/disable trailing (default: true)
Trail After X R Profit: Profit threshold to activate trail (default: 1.0R)
Trail ATR Multiplier: Trail distance as ATR multiple (default: 1.0)
Max Trades Per Day: Daily trade limit (default: 3)
Regime-Adaptive Sizing: Reduce size in non-trending conditions (default: true)
Regime Filter:
VWAP Slope Lookback: Period for slope calculation (default: 20)
Slope Threshold: Normalized threshold for trend detection (default: 0.12)
Bollinger Length/Multiplier: BB parameters for squeeze detection (default: 20/2.0)
Avoid Squeeze Entries: Skip entries during squeeze (default: true)
Require Trend Regime: Only trade in trending conditions (default: true)
Structure:
Swing Lookback: Pivot detection length (default: 5)
Displacement Min Body Ratio: Minimum body/range for displacement (default: 0.7)
Displacement Body Multiplier: Minimum body vs average for displacement (default: 1.8)
Momentum:
RSI Length/Thresholds: RSI parameters (default: 14, bull 55, bear 45)
SMI Lookback/Smoothing: SMI parameters (default: 13/25/2)
Session Filter:
Enable Session Filter: Toggle session-based trade gating
Individual session toggles: NY KZ, London KZ, NY, London
Day of week toggles: Monday through Friday
Force Close End of Day: Toggle EOD position closure
Close Hour/Minute: EOD close time (default: 15:45)
Order Flow:
CVD Confirmation: Require delta direction to match entry (default: true)
CVD Lookback: Period for CVD moving average (default: 10)
Candle Patterns:
Use Pattern Confirmation: Enable pattern detection as entry trigger (default: true)
Pattern Volume Multiplier: Minimum volume for pattern confirmation (default: 1.3x)
How to Use This Strategy
Step 1: Configure for Your Instrument
Adjust the ATR multiplier and displacement thresholds for your instrument's volatility. Add realistic commission and slippage in PulseWire's strategy settings.
Step 2: Set Your Risk Parameters
Choose a risk percentage that matches your risk tolerance. The default 1.5% with 2:1 R:R is conservative. Adjust the trailing stop parameters based on your preference for locking in profits vs giving trades room.
Step 3: Configure Sessions
Enable the sessions relevant to your instrument. For US equities, NY KZ and NY Session are most relevant. For forex, both London and NY Kill Zones are important. Disable days you prefer not to trade.
Step 4: Run the Backtest
Apply the strategy to your chart and review the backtest results. Check win rate, profit factor, max drawdown, and number of trades. Ensure results are realistic and not the product of overfitting.
Step 5: Forward Test
Before trading live, run the strategy in paper trading mode for at least 2-4 weeks to verify that live performance matches backtest expectations.
Best Practices
Always add commission and slippage before evaluating backtest results
The strategy works best on liquid instruments with reliable volume data
Higher timeframes (15m+) produce fewer but higher-quality trades
The multi-gate entry system means trades are infrequent by design — this is a feature, not a bug
Regime-adaptive sizing is recommended — it automatically reduces exposure in uncertain conditions
The daily trade limit prevents revenge trading and overexposure
End-of-day forced close eliminates overnight gap risk for intraday strategies
Monitor the HUD during live trading for real-time regime, momentum, and session context
If win rate drops below 40% or profit factor drops below 1.0, re-evaluate parameters for current market conditions
Limitations
The strategy uses lagging indicators (SMAs, RSI, SMI) for entry conditions. Entries occur after the trend has started, not at the exact turn.
Regime detection can lag regime changes. The strategy may miss the first portion of a new trend or take a trade just as a trend is ending.
CVD is estimated from candle direction, not true order flow data. This is an approximation.
Backtest results are hypothetical and do not account for real-world execution issues (partial fills, requotes, connectivity).
The strategy is designed for intraday/swing trading. It is not optimized for scalping or long-term position trading.
Session filtering is based on EST timezone. Instruments traded primarily in other timezones may need different session definitions.
The multi-gate entry system can be too restrictive in some market conditions, producing very few trades. This is intentional — the strategy prioritizes quality over quantity.
Past performance in backtesting does not guarantee future results. Market conditions change, and strategies that worked historically may not work in the future.
Technical Implementation
Built with Pine Script v6 using:
calc_on_every_tick=false for non-repainting execution
barstate.isconfirmed gating on all signal generation
9-module architecture with clear separation of concerns
ATR-based dynamic stop loss and take profit calculation
Trailing stop with configurable activation threshold and trail distance
Regime-adaptive position sizing with squeeze and non-trending penalties
Session detection with timezone support and day-of-week filtering
Daily trade counter with automatic reset
End-of-day forced close mechanism
Real-time performance tracking (win rate, profit factor, max drawdown)
Dual momentum confirmation (RSI + SMI)
CVD order flow validation
Candle pattern detection (engulfing, pin bar) with volume confirmation
6 alert conditions covering entries, regime changes, EOD close, patterns, and drawdown
Originality Statement
This strategy is original in its multi-dimensional confluence framework. While individual components (RSI, SMI, SMA alignment, session filtering) are established concepts, this strategy is justified because:
The 9-module architecture creates a clear, auditable decision pipeline where each module's contribution to the final trade decision is transparent
The multi-gate entry system (regime + structure + dual momentum + CVD + session + trigger) requires an unusually high level of confluence, reducing false signals
Regime-adaptive position sizing automatically adjusts exposure based on market conditions, a feature rarely seen in published strategies
The combination of trailing stops with regime-aware sizing creates a dynamic risk framework that adapts to changing conditions
Session filtering with Kill Zone preference and day-of-week controls provides institutional-grade time management
CVD order flow confirmation adds a volume-based validation layer that pure price-based strategies lack
The real-time HUD with performance tracking provides transparency into strategy behavior that most published strategies do not offer
The Volcanic theme provides a cohesive visual identity where every color choice carries meaning (lava = entry, amber = warning, teal = VWAP, crimson = bearish)
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. Backtested results are hypothetical and do not represent actual trading. Past performance does not guarantee future results. The strategy involves risk of loss, including the potential loss of the entire investment. Commission, slippage, and other real-world execution costs are not included in the default configuration and must be added by the user for realistic evaluation. The author makes no claims about the profitability of this strategy and is not responsible for any losses incurred from its use. Always use proper risk management, trade with capital you can afford to lose, and consider consulting a qualified financial advisor before trading.
-Made with passion by officialjackofalltrades
Strategy

Cadence Refracted Oscillator [JOAT]Cadence Refracted Oscillator
Introduction
The Cadence Refracted Oscillator is an open-source multi-layer momentum analysis tool built in Pine Script v6. It combines three distinct momentum methodologies — Spectral-Filtered RSI, Stochastic Momentum Index (SMI), and Cumulative Volume Delta (CVD) divergence detection — into a single composite oscillator displayed in a separate pane below the chart. The indicator produces a blended momentum reading (0-100), a gradient histogram, a signal line with crossover detection, Z-score extreme markers, and Wyckoff absorption alerts. It is designed for traders who want a deeper, noise-reduced view of momentum that goes beyond what a standard RSI or stochastic can provide.
The key innovation is the spectral filtering stage. Instead of applying RSI directly to raw price, the indicator first passes price data through a Discrete Fourier Transform (DFT) to extract dominant frequency components, then applies RSI-weighted filtering to produce a cleaner, less noisy momentum signal. This filtered signal is then blended with the Stochastic Momentum Index to create a composite that captures both trend momentum and mean-reversion potential.
Why This Indicator Exists
Standard momentum oscillators have well-known limitations. RSI is noisy on lower timeframes and produces frequent false signals in choppy markets. Stochastic oscillators are fast but whipsaw-prone. Neither incorporates volume information. This indicator addresses these issues by layering three complementary approaches:
Spectral-Filtered RSI: Applies a Discrete Fourier Transform to extract the dominant price cycle, then weights the filtered output by RSI distance from the midpoint. This removes high-frequency noise while preserving the meaningful momentum signal. The result is a smoother RSI that responds to genuine trend changes rather than random fluctuations.
Stochastic Momentum Index: Measures where the close is relative to the midpoint of the recent high-low range, double-smoothed with configurable EMA periods. Unlike classic stochastic which measures close relative to the range boundaries, SMI measures distance from the center — making it more sensitive to directional momentum and less prone to ceiling/floor effects.
CVD Divergence: Tracks Cumulative Volume Delta (buy volume minus sell volume) and compares it to price extremes. When price makes a new low but CVD is higher than its previous low, buying pressure is diverging from price — a bullish signal. The reverse applies for bearish divergences. This adds a volume-based confirmation layer that pure price-based oscillators lack.
How the Spectral Filter Works
The spectral filtering process uses a Discrete Fourier Transform — the same mathematical tool used in signal processing, audio analysis, and scientific computing — to decompose price data into frequency components:
// Discrete Fourier Transform implementation
// Decomposes price into frequency components
// DC component (index 0) represents the dominant trend
// Higher harmonics represent shorter-term oscillations
The process works in four stages:
Stage 1 — Short RSI Weighting: A short-period RSI is calculated and converted to an "absolute distance from 50" value. Bars where RSI is far from 50 (strong momentum) receive higher weight in the filter.
Stage 2 — Forward DFT: Price data is transformed into the frequency domain using a configurable number of harmonics (default 3). The magnitude spectrum is extracted, and the DC component (the dominant low-frequency trend) becomes the filtered subject.
Stage 3 — RSI-Weighted Smoothing: The filtered subject is smoothed using the RSI absolute distance as weights. This means the filter responds more to bars with strong momentum and less to bars with weak, indecisive momentum.
Stage 4 — Final RSI: RSI is calculated on the filtered data with the main length (default 21). A divergence component (rate of change of the spectral RSI) is added to create the final Cadence RSI value.
The result is an RSI-like oscillator that is significantly smoother than standard RSI while still being responsive to genuine trend changes. The Fourier harmonics parameter controls how many frequency components are retained — fewer harmonics produce a smoother signal, more harmonics preserve more detail.
Stochastic Momentum Index Component
The SMI component provides a complementary momentum perspective. While the spectral RSI focuses on trend momentum, the SMI captures where price sits within its recent range:
The lookback period defines the range (highest high, lowest low)
The distance from the midpoint of that range is double-smoothed with two EMA passes
The range itself is also double-smoothed and halved to create the denominator
The resulting value oscillates between -100 and +100, where positive values indicate price is above the range midpoint and negative values indicate it is below
This is normalized to 0-100 for blending with the spectral RSI
The SMI is particularly useful for detecting mean-reversion opportunities. When the spectral RSI shows a trend but the SMI is at an extreme, it suggests the trend may be overextended.
Composite Blending
The final composite oscillator blends the spectral RSI (60% weight) with the normalized SMI (40% weight). This weighting prioritizes the trend-following spectral RSI while incorporating the mean-reversion sensitivity of the SMI. The composite oscillates between 0 and 100, with 50 as the neutral midpoint.
The histogram displays the difference from 50, making it easy to see momentum direction and intensity at a glance. Positive histogram bars indicate bullish momentum, negative bars indicate bearish momentum, and the gradient coloring intensifies with momentum strength.
Signal Line and Crossovers
An EMA-based signal line (default 9 periods) is applied to the composite. Crossovers between the composite and signal line provide timing signals:
Bull Cross: Composite crosses above the signal line — momentum is accelerating upward
Bear Cross: Composite crosses below the signal line — momentum is decelerating or reversing
The distance between composite and signal line indicates momentum conviction — wide separation means strong momentum, tight convergence suggests a potential cross is forming
Z-Score Extreme Detection
The indicator calculates a Z-score of the composite value over a configurable lookback (default 50 bars). When the Z-score exceeds +2.0 or falls below -2.0, the momentum is at a statistical extreme — more than two standard deviations from the mean. These events are marked with square markers and indicate:
Potential exhaustion of the current move
High probability of mean reversion
Possible climax buying or selling
Z-score extremes are not automatic reversal signals — strong trends can sustain extremes for extended periods. They are best used as warnings to tighten stops or take partial profits.
Wyckoff Absorption Detection
The indicator detects Wyckoff absorption events — bars where volume is significantly above average (1.5x) but the price range is significantly below average (0.5x). This pattern indicates that large institutional orders are being filled without moving price, which often precedes a directional breakout. Absorption markers appear as circles at the midline.
Visual Design
The indicator uses a "Solar Flare" color theme — golds, ambers, magentas, and plasma purples on a dark background:
Composite Line: Neon glow effect with three layered plots (outer glow at 85% transparency, mid glow at 65%, core line at full intensity). Color adapts to trend state — gold/amber for bullish, magenta/red for bearish, ash for neutral.
Gradient Histogram: 10-level color gradient from bright gold (strong bull) through amber to magenta (strong bear). Rising momentum within a direction intensifies the color.
Signal Line: Plasma purple with glow effect
Zone Fills: Subtle fills between threshold lines — gold tint in the bull zone, magenta tint in the bear zone, ash in the neutral zone
OB/OS Fills: When the composite enters overbought (>75) or oversold (<25) territory, a colored fill highlights the extreme
SMI Reference: A thin blue line showing the normalized SMI for comparison
Markers: Triangles for signal crossovers, diamonds for CVD divergences, squares for Z-score extremes, circles for absorption
HUD Dashboard
The real-time HUD displays 14 metrics:
Composite value with color-coded bull/bear/neutral state
Trend direction (Bullish/Bearish/Neutral)
Z-Score value with classification (Extreme Bull/Bear, Strong, Normal)
Momentum Percentile Rank (0-100%)
SMI value
Signal Line distance (Wide/Moderate/Tight)
Volume Flow direction (Buying/Selling/Neutral) from CVD
Spectral RSI component value
Momentum Strength percentage with classification (Very Strong to Very Weak)
Overbought/Oversold pressure state
Divergence status (Bull Div/Bear Div/None)
Current mode description (Bull Momentum/Bear Momentum/Consolidating)
Input Parameters
Spectral RSI:
RSI Length: Main RSI period (default: 21)
Source: Price source (default: close)
Filter Length: Short RSI period for weighting (default: 12)
Fourier Harmonics: Number of DFT components (default: 3). Lower = smoother, higher = more detail.
Stochastic Momentum:
SMI Lookback: Range period (default: 13)
SMI Smooth 1/2: Double-smoothing EMA periods (default: 25/2)
Signal Length: Signal line EMA period (default: 13)
Volume Delta:
Show CVD Divergence: Toggle divergence detection
CVD Divergence Lookback: Period for comparing CVD extremes to price extremes (default: 14)
Levels:
Overbought/Oversold: Extreme thresholds (default: 75/25)
Bull/Bear Threshold: Trend classification levels (default: 58/42)
How to Use This Indicator
Step 1: Read the Composite Direction
Above 58 = bullish momentum. Below 42 = bearish momentum. Between = consolidation. The histogram makes this immediately visible.
Step 2: Watch for Signal Crossovers
Bull crosses (composite above signal) in the lower half of the range are potential long entries. Bear crosses in the upper half are potential short entries. Crosses near the midline are less significant.
Step 3: Check for Divergences
CVD divergences at price extremes are powerful reversal warnings. A bullish CVD divergence at an oversold composite reading is a high-probability long setup.
Step 4: Monitor Z-Score Extremes
Z-score beyond +/-2.0 warns of potential exhaustion. Consider tightening stops or taking partial profits when the Z-score reaches extreme levels.
Step 5: Use Absorption as Early Warning
Absorption events (high volume, small range) often precede breakouts. When absorption appears near a threshold level, be prepared for a directional move.
Best Practices
The spectral filter works best on timeframes with sufficient data — 5-minute and above is recommended
Fewer Fourier harmonics (2-3) produce a smoother, more trend-following signal. More harmonics (5-8) produce a more responsive but noisier signal.
The composite is most reliable when the spectral RSI and SMI agree. Divergence between the two components suggests mixed conditions.
CVD divergences are most significant at overbought/oversold extremes
Z-score extremes in trending markets can persist — do not blindly fade them
The signal line crossover is a timing tool, not a standalone entry signal. Combine with price action and structure analysis.
Absorption events are context-dependent — they are most meaningful near support/resistance levels
Limitations
The DFT calculation is computationally intensive. Very high harmonic counts may slow chart loading on lower timeframes with large datasets.
The spectral filter introduces a small amount of lag compared to raw RSI. This is the tradeoff for noise reduction.
CVD divergence detection uses a simple comparison of extremes over the lookback period. It may miss complex divergences or flag simple pullbacks as divergences.
Buy/sell volume separation is estimated from candle direction, not true order flow data.
The composite blending weights (60/40) are fixed. Different instruments or timeframes might benefit from different weights.
Z-score extremes are relative to the lookback period. A Z-score of +2.0 over 50 bars may not be extreme over 200 bars.
Like all oscillators, this indicator can remain at extremes during strong trends. It is not a contrarian tool by default.
Technical Implementation
Built with Pine Script v6 using:
Custom Discrete Fourier Transform implementation (forward and inverse) with configurable harmonics
RSI-weighted spectral filtering for noise reduction
Double-smoothed Stochastic Momentum Index with normalization
Cumulative Volume Delta tracking with divergence detection
Z-score calculation for statistical extreme identification
Wyckoff absorption detection (effort vs result)
10-level gradient histogram coloring function
Multi-layer neon glow effect on composite and signal lines
barstate.isconfirmed gating on all signal markers
10 alert conditions covering threshold crosses, divergences, signal crossovers, and Z-score extremes
Originality Statement
This indicator is original in its synthesis of spectral analysis with momentum oscillators and volume delta. While RSI, stochastic, and CVD are established concepts, this indicator is justified because:
The Discrete Fourier Transform spectral filtering applied to RSI calculation is a novel approach that significantly reduces noise while preserving signal responsiveness
The RSI-weighted filtering stage ensures the spectral filter responds more to high-momentum bars and less to noise, creating an adaptive smoothing mechanism
Blending spectral RSI with SMI combines trend-following and mean-reversion perspectives into a single composite that captures both dimensions of momentum
CVD divergence detection adds a volume-based confirmation layer that pure price-based oscillators cannot provide
Z-score extreme detection provides statistical context for momentum readings, helping traders distinguish between normal momentum and genuine extremes
Wyckoff absorption integration connects volume analysis with momentum analysis in a way that standard oscillators do not
The Solar Flare theme with gradient histogram and neon glow provides immediate visual clarity about momentum direction and intensity
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. Momentum oscillators measure the rate and direction of price change — they do not predict future price movement. Overbought conditions can persist in strong uptrends, and oversold conditions can persist in strong downtrends. Signal crossovers and divergences are probabilistic, not deterministic. Past momentum patterns do not guarantee future behavior. Always use proper risk management and never risk more than you can afford to lose. The author is not responsible for any losses incurred from using this indicator.
-Made by officialjackofalltrades
Indicator

Lattice Trend Helix [JOAT]Lattice Trend Helix
Introduction
The Lattice Trend Helix is an open-source trend analysis indicator built in Pine Script v6. It combines a GMMA-inspired multi-EMA fan system (19 exponential moving averages across fast and slow groups) with a pivot-center SuperTrend, RSI momentum confirmation, and a comprehensive trend strength scoring system. The indicator detects EMA fan alignment, measures trend strength on a 0-100 scale, identifies fan expansion/contraction dynamics, and generates priority-ranked signals including full confluence locks, fan crosses, SuperTrend flips, EMA 200 reclaims, fan burst breakouts, SuperTrend bounces, and displacement impulses.
The Guppy Multiple Moving Average (GMMA) concept, originally developed by Daryl Guppy, uses two groups of EMAs to visualize the behavior of short-term traders (fast group) and long-term investors (slow group). When both groups are aligned and separated, a strong trend is in place. When they converge and cross, a trend change is developing. This indicator extends the GMMA concept by adding a pivot-based SuperTrend for dynamic support/resistance, RSI filtering for momentum confirmation, and a quantified scoring system that turns visual alignment into a measurable number.
Why This Indicator Exists
Single moving average crossover systems are prone to whipsaws. Even dual-MA systems produce frequent false signals in choppy markets. The GMMA approach solves this by requiring alignment across many EMAs simultaneously — a much higher bar than a simple crossover. This indicator takes that concept further:
19-EMA Fan System: 11 fast EMAs (periods 3 through 23) capture short-term trader sentiment. 8 slow EMAs (periods 25 through 60) capture longer-term investor positioning. Full alignment of all 11 fast EMAs in order is a strong signal that short-term traders agree on direction. Full alignment of all 8 slow EMAs confirms institutional agreement.
Pivot-Center SuperTrend: Unlike standard SuperTrend which uses HL2 as the center, this implementation uses a weighted average of detected pivot points. Each new pivot high or low updates the center using the formula: center = (center * 2 + pivot) / 3. This creates a more responsive center line that adapts to actual market structure rather than simple bar midpoints. ATR-based bands around this center define the trend direction.
Trend Strength Score (0-100): Quantifies trend strength from three components — fast EMA alignment (50 points), slow EMA alignment (30 points), and price position relative to EMA 200 (20 points). A score of 100 means all 19 EMAs are perfectly aligned and price is on the correct side of the 200 EMA.
Fan Spread Dynamics: The distance between the fastest EMA (3) and slowest fast EMA (23), normalized by ATR, measures how "open" the fan is. An expanding fan indicates strengthening trend momentum. A contracting fan warns of potential trend exhaustion or reversal.
RSI Momentum Filter: RSI must agree with the fan direction for the highest-confidence signals. This prevents false confluence signals during momentum divergences.
EMA 200 Macro Filter: Price must be above the 200 EMA for confirmed bullish signals and below for confirmed bearish signals, ensuring alignment with the macro trend.
How the EMA Fan Alignment Works
The fast fan consists of 11 EMAs at periods 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, and 23. For bullish alignment, every EMA must be above the next longer one:
// Full fast fan bull alignment requires ALL 10 pairs in order
bool fastBull = ef3 > ef5 and ef5 > ef7 and ef7 > ef9 and ef9 > ef11
and ef11 > ef13 and ef13 > ef15 and ef15 > ef17
and ef17 > ef19 and ef19 > ef21 and ef21 > ef23
This is an extremely high bar. In choppy markets, the fast EMAs will be tangled and neither fastBull nor fastBear will be true. Only in genuine trending conditions do all 11 EMAs sort into perfect order. The same logic applies to the 8 slow EMAs.
The indicator counts how many adjacent pairs are aligned (0-10 for fast, 0-7 for slow) to produce a granular alignment score even when full alignment is not achieved. This allows the trend strength score to reflect partial alignment — a market with 8/10 fast pairs aligned is stronger than one with 4/10, even though neither achieves full alignment.
Pivot-Center SuperTrend
The SuperTrend component uses a unique center calculation based on detected pivot points:
Pivot highs and lows are detected using ta.pivothigh() and ta.pivotlow() with a configurable period
Each new pivot updates the center line using an exponentially weighted formula that gives 2/3 weight to the existing center and 1/3 to the new pivot
Upper and lower bands are calculated as center +/- (ATR Factor * ATR)
Trend direction flips when price crosses the opposite band
The trailing stop ratchets in the trend direction — it can only move favorably, never against the trend
This pivot-based center produces a SuperTrend that is more responsive to actual market structure than the standard HL2-based version. It adapts to the rhythm of the market's swing points rather than just the midpoint of each bar.
Signal Priority System
The indicator generates 8 types of signals, ranked by priority with cooldown-based anti-overlap:
P1 — HELIX LOCK (highest): Full fan alignment (fast + slow) + RSI confirmation + price above/below EMA 200. This is the maximum confluence signal — every factor agrees. A highlight box is drawn around the signal candle.
P2 — LATTICE SYNC: Full fan alignment (fast + slow) without RSI/EMA200 confirmation. Strong but not maximum confluence.
P3 — TREND FLIP: SuperTrend direction change. The pivot-center SuperTrend has flipped from bearish to bullish or vice versa.
P4 — FAN CROSS: The fast fan median (EMA 13) crosses the slow fan median (EMA 40). This is the GMMA equivalent of a moving average crossover, but using the center of each fan group.
P5 — MACRO CROSS: Price crosses the EMA 200 — a major structural event that changes the macro trend context.
P6 — FAN BURST: The fan spread transitions from contracting to expanding while the trend score is above 50. This indicates a breakout from compression — similar to a Bollinger squeeze release but measured through EMA dynamics.
P7 — ST BOUNCE: Price touches the SuperTrend line and bounces in the trend direction. This is a pullback-to-support/resistance signal unique to this indicator. A separate 5-bar cooldown prevents repeated bounce signals during extended touches.
P8 — IMPULSE (lowest): Displacement candle detection — large body (>70% of range, >2x average body). These indicate aggressive institutional order flow.
Trend Strength Score Breakdown
The 0-100 score is computed from three weighted components:
Fast EMA Alignment (50 points): The number of aligned adjacent pairs (max 10) divided by 10, multiplied by 50. Full fast alignment = 50 points. Half alignment = 25 points.
Slow EMA Alignment (30 points): The number of aligned adjacent pairs (max 7) divided by 7, multiplied by 30. Full slow alignment = 30 points.
EMA 200 Filter (20 points): If price is above EMA 200 and the fast fan leans bullish, or below EMA 200 and the fast fan leans bearish, 20 points are added. This rewards macro-aligned trends.
The score is displayed in the HUD with both a number and a visual bar (||||......). Scores above 70 indicate strong, tradeable trends. Scores between 40-70 indicate developing or weakening trends. Below 40 indicates choppy or transitional conditions.
Visual Design
The indicator uses a "Cyberpunk" color theme — electric cyan, hot magenta, neon yellow, deep violet, and chrome accents:
Fast EMA Fan: All 11 lines in a single color that adapts to alignment — cyan for bullish, magenta for bearish, steel grey for neutral. Configurable opacity.
Slow EMA Fan: All 8 lines in deeper tones — teal for bullish, violet for bearish, steel grey for neutral.
EMA 200: Three-layer neon glow effect (outer glow, mid glow, core line) that shifts between cyan (above) and violet (below).
Holographic Ribbon: Fill between the fastest (EMA 3) and slowest (EMA 23) fast EMAs, creating a ribbon that expands with trend strength and contracts during consolidation.
SuperTrend: Four-layer neon glow step-line (88%, 72%, 50%, 10% transparency) in cyan (bullish) or magenta (bearish).
Regime Background: Subtle background tinting for confirmed bull (cyan) or confirmed bear (magenta) conditions.
Candle Coloring: Multi-tier coloring based on confirmation level — confirmed bull/bear, strong bull/bear, weak bull/bear, or neutral.
HUD Dashboard
The HUD displays 14 metrics:
Trend direction (Bullish/Bearish/Neutral)
Strength score with visual bar (||||......)
Fan state (Strong Bull/Bear, Weak Bull/Bear, Converging)
SuperTrend direction
EMA 200 position (Above/Below)
Alignment counts (Fast: X/10, Slow: X/7)
Fan Spread value with state (Expanding/Contracting/Stable)
RSI value with bull/bear/neutral classification
Confluence count (0-5): fast alignment + slow alignment + SuperTrend agreement + RSI agreement + EMA 200 agreement
SuperTrend distance from price
Volume ratio (current vs 20-bar average)
Confirmed signal status (CONFIRMED BULL/BEAR or ---)
Input Parameters
EMA Fan:
Show Fast/Slow EMAs: Toggle each fan group
Show EMA 200: Toggle macro filter line
Fast/Slow EMA Opacity: Control transparency of each fan group
SuperTrend:
Show SuperTrend: Toggle the pivot-center SuperTrend
Pivot Period: Lookback for pivot detection (default: 3)
ATR Factor: Band width multiplier (default: 2.5)
ATR Length: Period for ATR calculation (default: 14)
Visual:
Show Trend Ribbon: Toggle holographic ribbon fill
Show Fan Crosses: Toggle fan cross signals
Show Regime Background: Toggle background tinting
SuperTrend Neon Glow: Toggle 4-layer glow effect
Color Candles: Toggle multi-tier candle coloring
HUD Panel: Toggle dashboard
Momentum Filter:
Show RSI Confirmation: Toggle RSI requirement for confirmed signals
RSI Length: Period (default: 14)
RSI Bull/Bear Threshold: Directional thresholds (default: 55/45)
How to Use This Indicator
Step 1: Check Fan Alignment
Look at the fan state in the HUD. "Strong Bull" or "Strong Bear" means both fast and slow fans are fully aligned — the strongest trend condition. "Weak" means only the fast fan is aligned — a developing or weakening trend.
Step 2: Verify with SuperTrend
The SuperTrend should agree with the fan direction. Fan bullish + SuperTrend bullish = high conviction. Disagreement suggests a transitional market.
Step 3: Check the Strength Score
Scores above 70 are strong trends. Use the visual bar for quick assessment. The confluence count (0-5) tells you how many independent factors agree.
Step 4: Trade the Signals
HELIX LOCK is the highest-conviction entry — all factors agree. LATTICE SYNC and TREND FLIP are strong. FAN CROSS and MACRO CROSS are structural. ST BOUNCE provides pullback entries within established trends.
Step 5: Monitor Fan Spread
Expanding fan = strengthening trend. Contracting fan = weakening trend or approaching reversal. FAN BURST signals mark the transition from contraction to expansion.
Best Practices
The 19-EMA fan is most effective on timeframes of 5 minutes and above. Very low timeframes produce too much noise for meaningful alignment.
Full fan alignment is rare and powerful. Do not expect it on every trade — it represents the highest-conviction conditions.
The SuperTrend bounce signal works best in established trends. In choppy markets, bounces may fail.
Fan crosses (fast median vs slow median) are the GMMA equivalent of MA crossovers — they confirm trend changes but lag the actual turn.
The EMA 200 filter is a macro-level gate. Ignoring it means trading against the larger trend, which reduces probability.
Use the fan spread dynamics to time entries — entering when the fan is expanding gives you momentum. Entering when it is contracting means you are fighting exhaustion.
The confluence count (0-5) is a quick decision filter. 4-5 = high conviction. 2-3 = moderate. 0-1 = low conviction.
Limitations
EMAs are lagging indicators. Full fan alignment is confirmed after the trend has already started, not at the exact turn.
The 19-EMA system uses significant computational resources. On very long charts with many bars, loading may be slower.
Pivot-center SuperTrend depends on pivot detection, which has an inherent delay equal to the pivot period.
Fan alignment can persist in overextended trends. Full alignment does not mean the trend will continue indefinitely.
The RSI filter can occasionally prevent valid signals during strong momentum divergences.
The indicator is optimized for trending markets. In range-bound conditions, the fan will be tangled and few signals will fire — which is by design.
EMA periods are fixed (3-23 fast, 25-60 slow). Different instruments or timeframes might benefit from different period sets, but the GMMA standard periods are well-tested across markets.
Technical Implementation
Built with Pine Script v6 using:
19 EMA calculations at global scope (11 fast + 8 slow) for Pine v6 compliance
Pivot-based SuperTrend center with exponentially weighted pivot averaging
Granular alignment counting (0-10 fast, 0-7 slow) for trend strength scoring
Fan spread normalization by ATR for cross-instrument comparability
8-tier priority signal system with cooldown-based anti-overlap
Separate cooldown tracking for SuperTrend bounce signals
4-layer neon glow rendering for SuperTrend and EMA 200
Holographic ribbon fill between fan extremes
Multi-tier candle coloring based on confirmation level
barstate.isconfirmed gating on all signal generation
9 alert conditions covering alignment changes, fan crosses, SuperTrend flips, confirmed signals, and fan expansion
Originality Statement
This indicator is original in its synthesis of the GMMA fan concept with pivot-center SuperTrend and quantified trend scoring. While GMMA and SuperTrend are established concepts, this indicator is justified because:
The pivot-center SuperTrend uses a weighted average of actual market pivots rather than simple HL2, creating a more structurally responsive trend line
The trend strength score (0-100) quantifies fan alignment into a single actionable metric with three weighted components
Fan spread dynamics (expansion/contraction tracking normalized by ATR) provide momentum acceleration/deceleration information not available in standard GMMA implementations
The 8-tier priority signal system with separate cooldown tracking for SuperTrend bounces prevents visual clutter while capturing all significant events
RSI momentum filtering and EMA 200 macro gating create a multi-layer confirmation framework that reduces false signals
The confluence count (0-5) provides an instant assessment of how many independent factors agree
The Cyberpunk theme with 4-layer neon glow and holographic ribbon creates a distinctive visual identity where trend strength is immediately apparent from the fan's visual character
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. Moving average systems identify trends after they have started — they do not predict trend changes in advance. Full fan alignment can occur in overextended trends that are about to reverse. SuperTrend bounces can fail. Past alignment patterns do not guarantee future trend behavior. Always use proper risk management and never risk more than you can afford to lose. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
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

APEX V2 [JOAT]APEX V2
Introduction
APEX V2 Enhanced is an advanced open-source algorithmic trading strategy that synthesizes 9 proprietary analytical concepts through a sophisticated confluence system to generate high-probability trade signals. This strategy integrates Flow Absorption Module (FAM), Directional Bias Engine (DBE), Structure Mapping System (SMS), Volatility Classification (VCL), Momentum Divergence Module (MDM), Statistical Reversion Zones (SRZ), Order Flow Analysis (OFA), Anchor Deviation Bands, and Trend Momentum Signals into a unified trading framework with comprehensive risk management.
Unlike single-indicator strategies that produce frequent false signals, APEX V2 requires multi-dimensional confluence before executing trades. This confluence-based approach dramatically reduces false positives while capturing high-conviction institutional moves. The strategy includes adaptive position sizing based on risk percentage, dynamic stop loss and take profit levels, trailing stops, and real-time performance tracking through a comprehensive dashboard.
Why This Strategy Exists
This strategy addresses the fundamental challenge of trading: distinguishing high-probability setups from market noise. Individual analytical methods often produce conflicting signals, leading to whipsaws and losses. APEX V2 solves this by requiring multiple independent confirmation signals before entering trades, ensuring that:
Institutional Activity is Confirmed: FAM and OFA detect when large players are positioning
Directional Bias is Established: DBE quantifies market sentiment through probabilistic analysis
Structural Context is Validated: SMS identifies key support/resistance levels
Volatility Regime is Appropriate: VCL ensures trades occur in favorable volatility conditions
Momentum Divergence is Present: MDM confirms smart money positioning through multi-oscillator divergence
Mean Reversion Opportunity Exists: SRZ identifies statistical extremes for reversal trades
Order Flow is Toxic: OFA detects aggressive institutional buying/selling
Anchor Deviation is Extreme: Multi-timeframe VWAP deviation signals absorption zones
Trend Momentum Confirmation: Trend-following signals with minimal lag
Each analytical module provides a unique perspective on market structure. By requiring confluence across multiple dimensions, APEX V2 captures only the highest-quality setups where institutional activity, technical structure, momentum, volatility, and order flow all align.
Strategy Components Explained
1. Flow Absorption Module (FAM)
FAM analyzes VWAP deviation across 2-minute, 5-minute, and 15-minute timeframes to identify institutional liquidity absorption zones. When price deviates significantly from VWAP (default: 8.0 sigma on 2m/5m, 4.0 sigma on 15m) combined with volume surges (2.25x average) and sufficient relative volume (0.6+), FAM signals institutional absorption.
The strategy requires 2+ timeframe confirmation for FAM signals. Buy signals occur when price is below VWAP with volume surge across multiple timeframes (institutions absorbing at lows). Sell signals occur when price is above VWAP with volume surge (institutions distributing at highs).
FAM contributes 1 point to the confluence score when absorption is detected, indicating institutional players are actively positioning at price extremes.
2. Directional Bias Engine (DBE)
DBE calculates directional bias by analyzing the ratio of bullish vs bearish bars over a lookback period (default: 100 bars) combined with momentum analysis. The engine weights directional bias (60%) and momentum bias (40%) to produce a combined bias score ranging from -1.0 (extreme bearish) to +1.0 (extreme bullish).
When combined bias exceeds the threshold (default: 0.65), DBE signals bullish bias. When below -0.65, it signals bearish bias. This probabilistic approach quantifies market sentiment and filters trades against the prevailing bias.
DBE contributes 1 point to confluence when bias aligns with trade direction, ensuring trades flow with statistical probability rather than against it.
3. Structure Mapping System (SMS)
SMS detects structural pivot highs and pivot lows using configurable left/right bar parameters (default: 10 bars each). The system maintains arrays of the 10 most recent resistance and support levels, then checks if current price is within 1% of any tracked level.
When price approaches support (within 1% of recent pivot lows), SMS signals potential bounce. When price approaches resistance (within 1% of recent pivot highs), SMS signals potential rejection. These structural levels represent areas where price previously reversed, making them high-probability zones for future reversals.
SMS contributes 1 point to confluence when price is near support (for longs) or resistance (for shorts), providing structural context for entries.
4. Volatility Classification (VCL)
VCL classifies current volatility regime using ATR percentile ranking over a lookback period (default: 100 bars). The system calculates normalized ATR (ATR / price * 100) and determines its percentile rank. High volatility is defined as 70th percentile or above, low volatility as 30th percentile or below.
While VCL doesn't directly contribute to confluence scoring, it provides critical context displayed in the dashboard. High volatility regimes may require wider stops, while low volatility regimes may produce more reliable mean reversion signals.
The strategy adapts to volatility by using ATR-based position sizing and stop loss placement, ensuring risk management scales with market conditions.
5. Momentum Divergence Module (MDM)
MDM detects multi-oscillator divergences by comparing price pivots with RSI pivots. Bullish divergence occurs when price makes lower lows but RSI makes higher lows (indicating weakening selling pressure). Bearish divergence occurs when price makes higher highs but RSI makes lower highs (indicating weakening buying pressure).
The system tracks divergence counts and requires a minimum number of divergences (default: 2) before signaling. This prevents single-divergence false signals and ensures sustained divergence patterns.
MDM contributes 1 point to confluence when divergence aligns with trade direction, confirming that smart money is positioning against the prevailing price trend.
6. Statistical Reversion Zones (SRZ)
SRZ combines Bollinger Bands with RSI to identify statistical extremes for mean reversion trades. The system calculates Bollinger Bands (default: 20-period, 2.0 standard deviations) and RSI (default: 14-period) to detect oversold and overbought conditions.
Oversold signals occur when price is below the lower Bollinger Band AND RSI is below 30. Overbought signals occur when price is above the upper Bollinger Band AND RSI is above 70. These dual conditions ensure both price and momentum are at extremes.
SRZ contributes 1 point to confluence when statistical extremes align with trade direction, identifying high-probability mean reversion opportunities.
7. Order Flow Analysis (OFA)
OFA detects institutional order flow through toxicity analysis and absorption coefficient calculation. The toxicity index measures aggressive vs passive order flow by analyzing candle position and volume. When toxicity exceeds threshold (default: 0.7), it indicates institutions are aggressively taking liquidity.
The absorption coefficient quantifies institutional absorption by measuring volume intensity relative to price movement. High absorption (default: 0.75+) with minimal price movement indicates institutions are positioning without moving price significantly.
OFA calculates a confidence score (0-100%) based on absorption strength and toxicity. When confidence exceeds minimum threshold (default: 75%), OFA signals high-probability institutional activity.
OFA contributes 1 point to confluence when institutional footprints are detected with high confidence, confirming large players are actively positioning.
8. Anchor Deviation Bands
Anchor Deviation analyzes multi-timeframe VWAP deviation (2m, 5m, 15m) combined with oscillator sigma gap confirmation. The system calculates VWAP deviation using configurable methods (Price Volatility, Z-Score, or Spread StDev) and measures the gap between VWAP deviation and oscillator z-scores.
Buy signals occur when 2+ timeframes show negative VWAP deviation (price below VWAP) with 2+ timeframes confirming oscillator gap. Sell signals occur when 2+ timeframes show positive VWAP deviation with gap confirmation.
Anchor Deviation contributes 1 point to confluence when multi-timeframe tension is detected, indicating price is at extreme deviation from institutional reference levels.
9. Trend Momentum Signals
Trend Momentum Signals use a zero-lag EMA combined with volatility bands and trend strength analysis. The system calculates a zero-lag EMA by compensating for lag (EMA of price + (price - price )), then applies volatility bands using ATR multiplier (default: 1.5x).
The trend strength score is calculated by comparing current zero-lag EMA with historical values over a loop range (default: 1-70 bars). Long signals occur when trend score exceeds uptrend threshold (default: 5) AND price is above the upper volatility band. Short signals occur when trend score is below downtrend threshold (default: -5) AND price is below the lower volatility band.
Trend Momentum contributes 1 point to confluence when trend signals align with trade direction, providing trend-following confirmation with minimal lag.
10. Deviation Reversion System Component
The Deviation Reversion System component calculates deviation levels from a moving average (configurable: WMA, SMA, RMA, EMA, HMA). Three deviation levels are defined (default: 1.3%, 7.5%, 13.3%) representing progressively extreme deviations from the mean.
Buy signals occur when price drops below the first deviation level (mean - 1.3%). Sell signals occur when price rises above the first deviation level (mean + 1.3%). This component identifies when price has deviated sufficiently from its mean to warrant mean reversion trades.
Deviation Reversion contributes 1 point to confluence when price is at deviation extremes, complementing the SRZ module with a simpler percentage-based approach.
Confluence System & Signal Aggregation
APEX V2's core innovation is its confluence system. The strategy counts bullish and bearish signals from all 9 analytical modules:
FAM: Absorption buy/sell (2+ timeframe confirmation)
DBE: Bullish/bearish bias (>0.65 or <-0.65)
SMS: Near support/resistance (within 1%)
MDM: Bullish/bearish divergence (2+ divergences)
SRZ: Oversold/overbought (BB + RSI extremes)
OFA: Institutional buy/sell (75%+ confidence)
Anchor Deviation: Tension buy/sell (2+ timeframe + gap confirmation)
Deviation Reversion: Buy/sell signal (price at deviation levels)
Trend Momentum: Long/short signal (trend score + volatility bands)
When confluence mode is enabled (default: ON), the strategy requires a minimum number of modules to agree (default: 3 out of 9) before executing trades. This dramatically reduces false signals by ensuring multiple independent perspectives confirm the setup.
If both long and short signals meet confluence requirements simultaneously, the strategy selects the direction with more confirming modules. If tied, no trade is executed to avoid ambiguous setups.
Risk Management System
APEX V2 includes comprehensive risk management:
Position Sizing: Calculated based on risk per trade percentage (default: 2% of equity). The system calculates stop distance using ATR and sizes positions so that if stopped out, the loss equals exactly 2% of account equity.
Stop Loss: Set at a percentage below entry (default: 2% for longs, 2% above for shorts). Stops are placed immediately upon entry to limit maximum loss per trade.
Take Profit: Set at a percentage above entry (default: 4% for longs, 4% below for shorts). This provides a 2:1 reward-to-risk ratio.
Trailing Stop: Activates when take profit level is reached, then trails price by a percentage (default: 1.5%). This locks in profits while allowing winners to run.
Reversal Exits: If an opposite signal meets confluence requirements while in a position, the strategy immediately closes the current position. This prevents holding losing positions when market structure shifts.
Strategy Properties & Backtesting Parameters
The strategy uses realistic backtesting parameters to avoid misleading results:
Initial Capital: $10,000 (realistic for average retail trader)
Position Size: 100% of equity (controlled by risk-based position sizing)
Pyramiding: 3 (allows up to 3 positions in same direction)
Commission: Should be set to realistic levels (0.1% for crypto, 0.05% for forex, $1-5 per trade for stocks)
Slippage: Should be set to realistic levels (5-10 ticks for liquid markets)
Risk Per Trade: 2% (sustainable risk level)
Stop Loss: 2% (prevents catastrophic losses)
Take Profit: 4% (2:1 reward-to-risk ratio)
These parameters ensure backtesting results reflect realistic trading conditions. The strategy is designed to generate 100+ trades over a sufficient dataset to produce statistically significant results.
Visual Elements
FAM Gradient Ribbon: 5-layer cyan/magenta ribbon showing liquidity absorption intensity around VWAP
OFA Gradient Ribbon: 5-layer gold/indigo ribbon showing institutional order flow intensity
Anchor Deviation Ribbon: 5-layer teal/purple ribbon showing multi-timeframe VWAP tension
Entry Signals: Green triangle up for LONG entries, red triangle down for SHORT entries
Position Markers: Small circles below/above bars indicating active positions
Stop Loss Lines: Red lines showing stop loss levels for active positions
Take Profit Lines: Green lines showing take profit targets for active positions
Average Entry Price: White line showing average entry price for active positions
Comprehensive Dashboard: Real-time metrics including position status, P&L, signal confluence, individual module status, and performance metrics
Dashboard Metrics
The dashboard displays 20+ real-time metrics:
Position Status:
Status: LONG, SHORT, or FLAT
Position Size: Current position quantity
P&L: Open profit/loss in currency and percentage
Signal Confluence:
Bull Signals: Count of bullish indicators (X/9) with checkmark if confluence met
Bear Signals: Count of bearish indicators (X/9) with checkmark if confluence met
Individual Indicator Status:
FAM: BUY/SELL with deviation value
DBE: BULL/BEAR with bias score
SMS: SUP/RES (support/resistance proximity)
VCL: HIGH/LOW/NORM with percentile
MDM: BULL/BEAR with RSI value
SRZ: OS/OB (oversold/overbought) with RSI value
OFA: INST+/INST-/TOX+/TOX- with confidence percentage
ADB: BUY/SELL with deviation value
TMS: LONG/SHORT with trend score
Performance Metrics:
Win Rate: Percentage and win/loss ratio
Net Profit: Currency and percentage return
Equity: Current equity and percentage change from initial capital
Input Parameters
Strategy Settings:
Enable LONG/SHORT Trades: Toggle trade directions
Require Multi-Module Confluence: Enable/disable confluence requirement
Minimum Confluence Count: Number of modules that must agree (1-7, default: 3)
FAM Settings:
Enable FAM, VWAP Mode, Deviation Method, Volume Lookback, Volume Surge Multiplier, RVOL Threshold, 2m/5m/15m Thresholds, Show Gradient Ribbon
DBE Settings:
Enable DBE, Bias Lookback, Bias Threshold, Momentum Weight
SMS Settings:
Enable SMS, Pivot Left/Right Bars, Structure Lookback
VCL Settings:
Enable VCL, ATR Length, Regime Lookback, High/Low Vol Thresholds
MDM Settings:
Enable MDM, RSI Length, Pivot Lookback, Min Divergences
SRZ Settings:
Enable SRZ, Bollinger Length/Multiplier, RSI Length, RSI Overbought/Oversold
OFA Settings:
Enable OFA, Toxicity Lookback/Threshold, Min Absorption Coefficient, Minimum Confidence %, Show Gradient Ribbon
Anchor Deviation Settings:
Enable Anchor Deviation, VWAP Dev Mode, 2m/5m/15m VWAP Thresholds, 2m/5m/15m Osc σ-Gap Thresholds, Show Gradient Ribbon
Deviation Reversion Settings:
Enable Deviation Reversion System, MA Type, MA Period, Deviation 1/2/3 percentages
Trend Momentum Settings:
Enable Trend Momentum Signals, Zero Lag Length, Volatility Multiplier, Loop Start/End, Threshold Uptrend/Downtrend
Risk Management Settings:
Enable Stop Loss, Stop Loss %, Enable Take Profit, Take Profit %, Enable Trailing Stop, Trailing Stop %, Risk Per Trade %
Visualization Settings:
Show Entry/Exit Signals, Show Dashboard, Show All Gradient Ribbons, Ribbon Brightness Adjust
How to Use This Strategy
Step 1: Configure Backtesting Parameters
Set realistic commission and slippage in Strategy Properties. For crypto: 0.1% commission, 10 ticks slippage. For forex: 0.05% commission, 5 ticks slippage. For stocks: $1-5 per trade commission, 5 ticks slippage.
Step 2: Set Risk Parameters
Configure Risk Per Trade (default: 2%), Stop Loss (default: 2%), and Take Profit (default: 4%). These provide sustainable risk management with 2:1 reward-to-risk ratio.
Step 3: Choose Confluence Level
Set Minimum Confluence Count based on your risk tolerance. Higher confluence (4-5 indicators) produces fewer but higher-quality signals. Lower confluence (2-3 indicators) produces more signals but with more false positives.
Step 4: Enable/Disable Indicators
Toggle individual modules based on market conditions and your trading style. For trending markets, emphasize DBE, Trend Momentum, and Anchor Deviation. For ranging markets, emphasize SRZ, MDM, and Deviation Reversion.
Step 5: Monitor Dashboard
Watch the dashboard for signal confluence. When Bull Signals shows 3+/9 with checkmark, the strategy is ready to enter long. When Bear Signals shows 3+/9 with checkmark, ready to enter short.
Step 6: Review Individual Indicators
Check which specific modules are signaling. High-quality setups show alignment across multiple module types (institutional + technical + momentum + volatility).
Step 7: Backtest on Sufficient Data
Run backtests on datasets that generate 100+ trades for statistical significance. Review win rate, net profit, maximum drawdown, and profit factor.
Step 8: Optimize Parameters
Adjust module parameters for your specific instrument and timeframe. Avoid over-optimization - parameters should work across multiple instruments and time periods.
Step 9: Forward Test
After backtesting, forward test on paper trading or small live positions to validate strategy performance in real market conditions.
Step 10: Monitor Performance
Track Win Rate, Net Profit, and Equity metrics in the dashboard. If performance degrades, re-evaluate parameters or market conditions.
Best Practices
Use on liquid instruments with sufficient volume for reliable signals
Higher confluence (4-5 modules) is recommended for beginners to reduce false signals
Lower confluence (2-3 modules) can be used by experienced traders who can filter signals manually
Backtest on multiple timeframes (5m, 15m, 1h, 4h) to find optimal timeframe for your instrument
Use realistic commission and slippage - overly optimistic parameters produce misleading results
Risk no more than 2% per trade to ensure account survival during drawdown periods
Monitor VCL (Volatility Classification) - high volatility may require wider stops or reduced position size
Combine with higher timeframe trend analysis - trading with the trend improves win rate
Review individual module signals to understand why confluence was met
Disable modules that consistently produce false signals for your specific instrument
Enable trailing stops to lock in profits on winning trades
Use pyramiding (default: 3) to add to winning positions when additional confluence signals appear
Avoid trading during major news events - volatility spikes can invalidate technical signals
Backtest over multiple market conditions (trending, ranging, high volatility, low volatility)
Forward test for at least 100 trades before committing significant capital
Strategy Limitations
Requires sufficient historical data for all modules - may not work well on newly listed instruments
Multi-timeframe analysis (FAM, Anchor Deviation) requires data availability on 2m, 5m, 15m timeframes
Confluence requirement reduces trade frequency - may produce few signals on some instruments/timeframes
Backtesting results are historical and do not guarantee future performance
Strategy performance degrades during extreme volatility events (flash crashes, circuit breakers)
Commission and slippage significantly impact profitability - must use realistic values
Pyramiding can amplify losses if market reverses after adding to position
Stop loss placement using fixed percentage may be suboptimal during volatility regime changes
Module parameters optimized for one instrument may not work on others
Requires regular monitoring and parameter adjustment as market conditions evolve
Dashboard metrics are real-time snapshots and can change rapidly during volatile periods
Strategy assumes sufficient liquidity to execute at desired prices - may not work on illiquid instruments
Trailing stops can be triggered by normal volatility, closing winning trades prematurely
Reversal exits may close positions too early if opposite signal is temporary
Technical Implementation
Built with Pine Script v6 using:
9 independent analytical modules with individual enable/disable controls
Multi-timeframe security requests for FAM and Anchor Deviation (2m, 5m, 15m)
Confluence-based signal aggregation with configurable minimum threshold
Risk-based position sizing using ATR and account equity
Dynamic stop loss, take profit, and trailing stop management
Strategy.entry and strategy.exit functions for automated trade execution
Reversal exit logic to close positions when opposite confluence is met
Three 5-layer gradient ribbons (FAM, OFA, Anchor Deviation) with progressive transparency
Comprehensive dashboard with 20+ real-time metrics using table visualization
5 alert conditions for trade signals and position changes
Performance tracking (win rate, net profit, equity) displayed in dashboard
Pyramiding support (up to 3 positions) for scaling into winning trades
The code is fully open-source and can be modified to suit individual trading styles and risk tolerances.
Originality Statement
This strategy is original in its multi-confluence approach to algorithmic trading. The strategy synthesizes multiple analytical concepts into a unified framework:
It synthesizes 9 proprietary analytical concepts into a unified confluence system
The confluence requirement dramatically reduces false signals compared to single-method strategies
Each concept provides a unique perspective: institutional activity (FAM, OFA), directional bias (DBE), structural context (SMS), volatility regime (VCL), momentum divergence (MDM), mean reversion (SRZ), anchor deviation (multi-timeframe), and trend following (Trend Momentum)
Risk management system uses ATR-based position sizing to risk exactly 2% per trade regardless of stop distance
Reversal exit logic closes positions when opposite confluence is met, preventing holding losing positions during structure shifts
Comprehensive dashboard synthesizes 20+ metrics into actionable intelligence
Three gradient ribbons (FAM, OFA, Anchor Deviation) provide visual confirmation of institutional activity and order flow
Strategy is designed with realistic backtesting parameters (commission, slippage, position sizing) to avoid misleading results
Pyramiding support allows scaling into winning positions when additional confluence appears
Individual module enable/disable controls allow customization for different market conditions and trading styles
The strategy's value lies in its systematic approach to trade selection through multi-dimensional confluence. By requiring agreement across institutional activity, technical structure, momentum, volatility, and order flow, APEX V2 captures only the highest-quality setups where all factors align. This reduces emotional decision-making and provides a repeatable, testable framework for algorithmic trading.
Disclaimer
This strategy is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Past performance does not guarantee future results. Backtesting results are hypothetical and may not reflect actual trading performance. Always use proper risk management, never risk more than you can afford to lose, and thoroughly test any strategy on paper before committing real capital. Commission, slippage, and market conditions significantly impact profitability. No strategy works in all market conditions. Regular monitoring and parameter adjustment are required.
-Made with passion by officialjackofalltrades
Strategy

Statistical Reversion Engine [JOAT]Statistical Reversion Engine
Introduction
The Statistical Reversion Engine (SRE) is an advanced open-source mean reversion indicator that combines statistical deviation bands, premium/discount zone analysis, DCA level calculation, Z-score measurement, and enhanced reversion probability scoring to identify high-probability mean reversion opportunities. This indicator quantifies price deviation from statistical mean using multiple calculation methods (SMA, EMA, VWAP, HMA) and provides probabilistic assessment of reversion likelihood through multi-factor analysis including deviation magnitude, volatility regime, and historical reversion patterns.
Unlike basic Bollinger Band indicators that simply plot standard deviation bands, SRE employs a sophisticated statistical framework that calculates Z-scores, premium/discount percentages, enhanced reversion probability (incorporating volatility and premium factors), and tracks historical reversion speed to provide traders with quantitative mean reversion intelligence. The indicator also generates DCA (Dollar Cost Averaging) levels with volatility-adjusted spacing for systematic position building.
Why This Indicator Exists
This indicator addresses the challenge of identifying when price has deviated sufficiently from mean to warrant mean reversion trades. Traditional mean reversion indicators lack probabilistic quantification and don't account for volatility regime or historical reversion patterns. SRE systematically reveals:
Multiple Mean Calculations: SMA, EMA, VWAP (session/continuous), HMA for flexible mean definition
Statistical Deviation Bands: 1σ, 2σ, 3σ bands with customizable multipliers
Z-Score Calculation: Quantifies deviation in standard deviation units
Premium/Discount Analysis: Percentage deviation from mean with zone classification
Enhanced Reversion Probability: Multi-factor scoring (Z-score + premium + volatility)
DCA Level Generation: Volatility-adjusted levels for systematic position building
Historical Reversion Tracking: Measures average bars to return to mean after extreme deviation
Each component provides unique intelligence. Mean calculation defines center, deviation bands show extremes, Z-score quantifies magnitude, premium/discount shows percentage, probability scores likelihood, DCA levels provide entry framework, and historical tracking provides context.
Core Components Explained
1. Flexible Mean Calculation System
SRE supports four mean calculation methods:
f_calculate_mean(string type, int length) =>
float result = close
if type == "SMA"
result := ta.sma(close, length)
else if type == "EMA"
result := ta.ema(close, length)
else if type == "VWAP"
result := session_reset ? ta.vwap(hlc3) : ta.vwma(hlc3, length)
else if type == "HMA"
result := ta.hma(close, length)
result
Mean selection impacts reversion behavior:
- SMA: Simple average, slower to respond
- EMA: Exponential weighting, faster response
- VWAP: Volume-weighted, institutional reference
- HMA: Hull Moving Average, smoothest with minimal lag
2. Statistical Deviation Band System
Three deviation bands calculated using standard deviation:
float mean_line = f_calculate_mean(mean_type, mean_length)
float stdev = f_calculate_stdev(close, deviation_period)
float upper_band_1 = mean_line + (stdev * band_multiplier_1) // 1σ
float lower_band_1 = mean_line - (stdev * band_multiplier_1)
float upper_band_2 = mean_line + (stdev * band_multiplier_2) // 2σ
float lower_band_2 = mean_line - (stdev * band_multiplier_2)
float upper_band_3 = mean_line + (stdev * band_multiplier_3) // 3σ
float lower_band_3 = mean_line - (stdev * band_multiplier_3)
Default multipliers: 1.0, 2.0, 3.0 (customizable)
- 1σ: 68% of price action (normal range)
- 2σ: 95% of price action (extended range)
- 3σ: 99.7% of price action (extreme range)
3. Z-Score Calculation & Classification
Z-score quantifies deviation in standard deviation units:
f_calculate_zscore(float price, float mean, float stdev) =>
float zscore = stdev > 0 ? (price - mean) / stdev : 0.0
zscore
float zscore = f_calculate_zscore(close, mean_line, stdev)
Z-score interpretation:
- |Z| < 1.0: Normal deviation (40% reversion probability)
- |Z| 1.0-1.5: Moderate deviation (60% reversion probability)
- |Z| 1.5-2.0: Extended deviation (75% reversion probability)
- |Z| 2.0-2.5: Extreme deviation (85% reversion probability)
- |Z| > 3.0: 3-sigma event (95% reversion probability)
4. Premium/Discount Zone Analysis
Percentage deviation from mean with zone classification:
f_calculate_premium_discount(float price, float mean) =>
float pct = mean > 0 ? ((price - mean) / mean) * 100 : 0.0
pct
float premium_discount_pct = f_calculate_premium_discount(close, mean_line)
string current_zone =
premium_discount_pct >= premium_threshold * 2 ? "Extreme Premium" :
premium_discount_pct >= premium_threshold ? "Premium" :
premium_discount_pct <= discount_threshold * 2 ? "Extreme Discount" :
premium_discount_pct <= discount_threshold ? "Discount" :
"Fair Value"
Zone classification (default thresholds):
- Extreme Premium: >3.0% above mean (strong sell zone)
- Premium: 1.5-3.0% above mean (sell zone)
- Fair Value: -1.5% to +1.5% (neutral zone)
- Discount: -3.0% to -1.5% below mean (buy zone)
- Extreme Discount: <-3.0% below mean (strong buy zone)
5. Enhanced Reversion Probability Scoring
Multi-factor probability calculation:
f_enhanced_reversion_prob(float z, float premium_pct, float vol_rank) =>
float base_prob = f_reversion_probability(z)
// Adjust for premium/discount magnitude
float premium_factor = math.abs(premium_pct) > 3 ? 1.2 :
math.abs(premium_pct) > 2 ? 1.1 :
math.abs(premium_pct) > 1 ? 1.0 : 0.9
// Adjust for volatility (lower vol = higher reversion probability)
float vol_factor = vol_rank < 30 ? 1.2 :
vol_rank < 50 ? 1.1 :
vol_rank < 70 ? 1.0 : 0.85
math.min(base_prob * premium_factor * vol_factor, 99)
Enhanced probability accounts for:
- Base Z-score probability
- Premium/discount magnitude (larger deviation = higher probability)
- Volatility regime (lower volatility = more predictable reversion)
6. Volatility-Adjusted DCA Level Generation
DCA levels automatically adjust spacing based on volatility:
float current_atr = ta.atr(14)
float atr_pct = close > 0 ? (current_atr / close) * 100 : 0
float vol_multiplier = atr_pct > 3 ? 1.5 : atr_pct > 2 ? 1.2 : atr_pct > 1 ? 1.0 : 0.8
for i = 1 to dca_levels
float adjusted_spacing = (dca_spacing * vol_multiplier) / 100
float buy_level = mean_line * (1 - adjusted_spacing * i)
float sell_level = mean_line * (1 + adjusted_spacing * i)
array.push(dca_buy_levels, buy_level)
array.push(dca_sell_levels, sell_level)
Volatility adjustment:
- High vol (ATR% >3): 1.5x spacing (wider levels)
- Elevated vol (ATR% 2-3): 1.2x spacing
- Normal vol (ATR% 1-2): 1.0x spacing (default)
- Low vol (ATR% <1): 0.8x spacing (tighter levels)
7. Historical Reversion Speed Tracking
Measures average bars to return to mean after extreme deviation:
var array reversion_times = array.new_int(0)
var bool tracking_reversion = false
var int reversion_start_bar = 0
if math.abs(zscore) >= 2.5 and not tracking_reversion
tracking_reversion := true
reversion_start_bar := bar_index
if tracking_reversion and math.abs(zscore) < 0.5
int reversion_time = bar_index - reversion_start_bar
array.push(reversion_times, reversion_time)
tracking_reversion := false
float avg_reversion_time = array.size(reversion_times) > 0 ?
array.avg(reversion_times) : na
Average reversion time provides context for expected holding period.
Visual Elements
Mean Line: Electric lime line showing statistical mean
Deviation Bands: 1σ (lime), 2σ (violet), 3σ (deep violet) with gradient fills
Premium/Discount Zones: Background coloring (violet for premium, lime for discount)
DCA Levels: Dotted lines with "B1, B2, B3..." (buy) and "S1, S2, S3..." (sell) labels
Z-Score Label: Current Z-score displayed on price
Gradient Zone Fills: Progressive transparency between bands
Mean Reversion Signals: Triangle markers for strong buy/sell setups
Reversion Probability Heatmap: Background intensity based on enhanced probability
Dashboard: Real-time metrics including zone, P/D%, Z-score, reversion probability, mean value, distance, enhanced probability, deviation percentile, mean trend, nearest DCA, average reversion time, bars since extreme
Input Parameters
Mean Calculation:
Mean Type: SMA, EMA, VWAP, HMA (default: VWAP)
Mean Length: Period for mean calculation (default: 20)
Session Reset (VWAP): Toggle session anchoring (default: true)
Deviation Bands:
Band 1 Multiplier: 1σ multiplier (default: 1.0)
Band 2 Multiplier: 2σ multiplier (default: 2.0)
Band 3 Multiplier: 3σ multiplier (default: 3.0)
Deviation Period: Standard deviation calculation period (default: 20)
Premium/Discount:
Premium Threshold (%): Threshold for premium zone (default: 1.5%)
Discount Threshold (%): Threshold for discount zone (default: -1.5%)
DCA Levels:
Enable DCA Levels: Toggle DCA display (default: true)
Number of DCA Levels: Levels to generate (default: 5)
DCA Spacing (%): Base spacing between levels (default: 1.5%)
Visualization:
Show Deviation Bands: Toggle band display (default: true)
Show Band Fills: Toggle gradient fills (default: true)
Show Premium/Discount Zones: Toggle background coloring (default: true)
Show Z-Score Label: Toggle Z-score display (default: true)
How to Use This Indicator
Step 1: Identify Current Zone
Check dashboard "Zone" row. Extreme Discount = strong buy zone, Extreme Premium = strong sell zone.
Step 2: Assess Z-Score Magnitude
|Z| >2.0 indicates extended deviation. |Z| >3.0 is 3-sigma event (rare, high reversion probability).
Step 3: Check Enhanced Reversion Probability
Dashboard shows enhanced probability accounting for volatility and premium factors. >80% is high probability.
Step 4: Monitor Mean Trend
"Rising" mean suggests uptrend, "Falling" suggests downtrend. Trade with mean trend for higher probability.
Step 5: Use DCA Levels for Entry
Enter positions at DCA levels (B1, B2, B3 for longs; S1, S2, S3 for shorts) to average into position.
Step 6: Wait for Strong Signals
Triangle markers appear when:
- Extreme zone + enhanced probability >80% + band crossover
- These are highest conviction mean reversion setups
Best Practices
Mean reversion works best in ranging markets - avoid strong trends
3-sigma events (|Z| >3.0) have highest reversion probability but occur rarely
Use DCA levels to build positions systematically rather than all-in entries
Enhanced probability >80% indicates high-quality setup
Mean trend provides context - reversion against trend is lower probability
Volatility-adjusted DCA spacing prevents over-concentration in high vol
Average reversion time helps set realistic profit target timeframes
Combine with higher timeframe trend - mean reversion with trend is safer
Deviation percentile >90% indicates extreme deviation
Bars since extreme >50 suggests extended deviation may persist
Indicator Limitations
Mean reversion fails during strong trending markets
3-sigma events can persist longer than expected during major news
DCA levels don't account for fundamental catalysts
Enhanced probability is statistical, not deterministic
Historical reversion time doesn't guarantee future reversion speed
VWAP mean resets daily - may not be appropriate for all timeframes
Standard deviation assumes normal distribution - markets have fat tails
Premium/discount thresholds may need adjustment for different instruments
Technical Implementation
Built with Pine Script v6 using:
Four mean calculation methods (SMA, EMA, VWAP, HMA)
Three-tier deviation band system with customizable multipliers
Z-score calculation with standard deviation
Premium/discount percentage with zone classification
Enhanced reversion probability (Z-score + premium + volatility)
Volatility-adjusted DCA level generation
Historical reversion speed tracking with arrays
Deviation percentile ranking
Mean trend detection (fast vs slow mean)
Gradient zone fills with progressive transparency
Reversion probability heatmap background
Comprehensive dashboard with 12 metrics
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive statistical mean reversion approach. While Bollinger Bands and mean reversion are established concepts, this indicator is justified because:
It combines four mean calculation methods with three-tier deviation bands
Enhanced reversion probability incorporates Z-score, premium magnitude, and volatility regime
Volatility-adjusted DCA level generation adapts to market conditions
Historical reversion speed tracking provides empirical context
Premium/discount zone classification adds percentage-based perspective
Mean trend detection (fast vs slow) provides directional context
Deviation percentile ranking shows historical extremity
Integration of statistical measures (Z-score, stdev, percentile) with practical tools (DCA levels, signals)
Each component contributes unique information: mean defines center, deviation bands show extremes, Z-score quantifies magnitude, premium/discount shows percentage, enhanced probability scores likelihood, DCA levels provide framework, historical tracking provides context, and mean trend shows direction. The indicator's value lies in presenting these complementary perspectives simultaneously with unified statistical framework.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Mean reversion probabilities do not guarantee outcomes. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Divergence Confirmation System [JOAT]Divergence Confirmation System
Introduction
The Divergence Confirmation System (DCS) is an advanced open-source multi-oscillator divergence detection indicator that combines RSI, MFI, Stochastic, MACD, CCI, and Stochastic RSI analysis to identify high-probability divergence setups through systematic pivot comparison and multi-oscillator confirmation. This indicator reveals when price action diverges from underlying momentum across six independent oscillators, providing traders with early warning signals of potential trend reversals or continuations through rigorous confirmation requirements.
Unlike basic divergence indicators that rely on a single oscillator, DCS employs a sophisticated 6-oscillator confirmation system that detects both regular divergences (trend reversal signals) and hidden divergences (trend continuation signals) across multiple momentum indicators. The indicator requires minimum oscillator confirmation (default 2/6) to filter false signals and provides divergence strength scoring based on oscillator count, volume confirmation, and price momentum.
Why This Indicator Exists
This indicator addresses the challenge of identifying reliable divergence signals in noisy market conditions. Single-oscillator divergences often produce false signals, but when multiple independent oscillators confirm the same divergence pattern, probability of successful reversal increases significantly. DCS systematically reveals:
6-Oscillator Analysis: RSI, MFI, Stochastic, MACD, CCI, Stochastic RSI for comprehensive momentum assessment
Regular Divergence Detection: Price makes new high/low but oscillators don't confirm (reversal signal)
Hidden Divergence Detection: Price makes higher low/lower high but oscillators show opposite (continuation signal)
Multi-Oscillator Confirmation: Requires 2+ oscillators to agree before generating signal
Divergence Strength Scoring: 0-100% score based on oscillator count, volume, and momentum
Multi-Timeframe Divergence: Confirms divergences on higher timeframe for added conviction
Divergence Clustering: Detects multiple divergences in short period indicating strong reversal potential
Each component provides unique intelligence. Multiple oscillators reduce false signals, regular divergences show reversals, hidden divergences show continuations, strength scoring quantifies quality, MTF confirmation adds conviction, and clustering shows intensity.
Core Components Explained
1. Multi-Oscillator Divergence Detection System
DCS calculates six independent oscillators and detects divergences on each:
// RSI
float rsi = ta.rsi(close, rsi_period)
float rsi_high = ta.pivothigh(rsi, pivot_left, pivot_right)
float rsi_low = ta.pivotlow(rsi, pivot_left, pivot_right)
// MFI (Money Flow Index - volume-weighted RSI)
float mfi = ta.mfi(hlc3, mfi_period)
// Stochastic
float stoch_k = ta.stoch(close, high, low, stoch_period)
// MACD Histogram
= ta.macd(close, macd_fast, macd_slow, macd_signal)
// CCI (Commodity Channel Index)
float cci = ta.cci(close, 20)
// Stochastic RSI
float rsi_for_stoch = ta.rsi(close, rsi_period)
float stoch_rsi_k = ta.stoch(rsi_for_stoch, rsi_for_stoch, rsi_for_stoch, stoch_period)
Each oscillator provides independent momentum perspective. RSI shows price momentum, MFI adds volume weighting, Stochastic shows position in range, MACD shows trend momentum, CCI shows deviation from mean, and Stochastic RSI shows RSI momentum.
2. Regular Divergence Detection (Reversal Signals)
Regular bullish divergence occurs when price makes lower low but oscillator makes higher low:
f_detect_bull_regular_div(float osc_val, float osc_pivot) =>
bool detected = false
if not na(osc_pivot) and not na(price_low) and array.size(price_lows) >= 2
float curr_price = array.get(price_lows, last_idx)
float prev_price = array.get(price_lows, prev_idx)
// Price makes lower low, oscillator makes higher low
if curr_price < prev_price and osc_pivot > osc_pivot
if (bar_index - prev_bar) <= max_pivot_distance
detected := true
detected
Regular bearish divergence occurs when price makes higher high but oscillator makes lower high. These signal potential trend reversals.
3. Hidden Divergence Detection (Continuation Signals)
Hidden bullish divergence occurs when price makes higher low but oscillator makes lower low:
f_detect_bull_hidden_div(float osc_val, float osc_pivot) =>
bool detected = false
if detect_hidden and not na(osc_pivot) and not na(price_low)
float curr_price = array.get(price_lows, last_idx)
float prev_price = array.get(price_lows, prev_idx)
// Price makes higher low, oscillator makes lower low
if curr_price > prev_price and osc_pivot < osc_pivot
if (bar_index - prev_bar) <= max_pivot_distance
detected := true
detected
Hidden bearish divergence occurs when price makes lower high but oscillator makes higher high. These signal trend continuation after pullback.
4. Multi-Oscillator Confirmation Aggregation
DCS counts how many oscillators confirm each divergence type:
int bull_reg_count = (rsi_bull_reg ? 1 : 0) + (mfi_bull_reg ? 1 : 0) +
(stoch_bull_reg ? 1 : 0) + (macd_bull_reg ? 1 : 0) +
(cci_bull_reg ? 1 : 0) + (srsi_bull_reg ? 1 : 0)
bool confirmed_bull_regular = bull_reg_count >= min_oscillators
// Optional volume confirmation
float vol_avg = ta.sma(volume, 20)
bool vol_confirm = volume > vol_avg * 1.2
bool final_bull_regular = confirmed_bull_regular and
(not require_volume_confirm or vol_confirm)
Minimum oscillator requirement (default 2/6) filters false signals. Volume confirmation adds additional filter.
5. Divergence Strength Scoring System
Strength score (0-100%) calculated from multiple factors:
f_divergence_strength(int osc_count, bool vol_confirm_param, float price_momentum) =>
float score = 0.0
// Oscillator count (0-50 points)
score += osc_count * 8.33 // 6 oscillators max = 50 points
// Volume confirmation (0-25 points)
score += vol_confirm_param ? 25 : 0
// Price momentum (0-25 points)
float momentum_score = math.min(math.abs(price_momentum) * 5, 25)
score += momentum_score
math.min(score, 100)
Strength classification:
- 75-100%: Very Strong (highest probability)
- 60-74%: Strong (high probability)
- 40-59%: Moderate (medium probability)
- 0-39%: Weak (low probability)
6. Multi-Timeframe Divergence Confirmation
DCS checks for divergences on higher timeframe (default 15m):
f_get_htf_divergence(string tf) =>
= request.security(syminfo.tickerid, tf,
)
float htf_rsi_high = ta.pivothigh(htf_rsi, pivot_left, pivot_right)
float htf_rsi_low = ta.pivotlow(htf_rsi, pivot_left, pivot_right)
bool htf_bull = f_detect_bull_regular_div(htf_rsi, htf_rsi_low)
bool htf_bear = f_detect_bear_regular_div(htf_rsi, htf_rsi_high)
bool mtf_bull_confirmed = final_bull_regular and htf_bull_div
bool mtf_bear_confirmed = final_bear_regular and htf_bear_div
MTF confirmation significantly increases signal reliability.
7. Divergence Clustering Detection
Clustering identifies multiple divergences in short period:
var array div_bars = array.new_int(0)
if final_bull_regular or final_bear_regular
array.push(div_bars, bar_index)
// Count divergences in last 50 bars
int recent_div_count = 0
for i = 0 to array.size(div_bars) - 1
int div_bar = array.get(div_bars, i)
if bar_index - div_bar <= 50
recent_div_count += 1
bool in_div_cluster = recent_div_count >= 3
string cluster_intensity = recent_div_count >= 5 ? "High" :
recent_div_count >= 3 ? "Moderate" : "Low"
Clusters indicate strong reversal pressure building.
Visual Elements
Primary Oscillator Display: User-selectable (RSI/MFI/Stochastic/MACD) with gradient shadow effect
Reference Lines: 70 (overbought), 50 (midline), 30 (oversold)
Oscillator Histogram: Gradient-colored bars showing oscillator deviation from 50
Background Zones: Cyan for bullish divergence, red for bearish divergence
Divergence Labels: "BULL DIV" or "BEAR DIV" with oscillator count (e.g., "4/6")
Hidden Divergence Markers: Small "H" circles for hidden divergences
Elite Signals: Large labels for 4+ oscillator confirmation with strength >75%
MTF Confirmation: Triangle markers when higher timeframe confirms
Multi-Oscillator Confirmation: Labels showing oscillator count (e.g., "3/6 CONF")
Institutional Flow: "INST BUY/SELL" labels when delta confirms divergence
Input Parameters
Oscillator Settings:
RSI Period: RSI calculation period (default: 14)
MFI Period: MFI calculation period (default: 14)
Stochastic Period: Stochastic calculation period (default: 14)
MACD Fast: MACD fast EMA (default: 12)
MACD Slow: MACD slow EMA (default: 26)
MACD Signal: MACD signal line (default: 9)
Divergence Detection:
Pivot Left Bars: Bars to left of pivot (default: 5)
Pivot Right Bars: Bars to right of pivot (default: 2)
Detect Hidden Divergences: Toggle hidden divergence detection (default: true)
Max Pivot Distance: Maximum bars between pivots (default: 60)
Confirmation Rules:
Minimum Oscillator Confirmation: Required oscillators (default: 2/6)
Require Volume Confirmation: Toggle volume filter (default: false)
Visualization:
Show Divergence Lines: Toggle divergence line drawing (default: true)
Show Labels: Toggle divergence labels (default: true)
Primary Display: Select oscillator to display (RSI/MFI/Stochastic/MACD)
How to Use This Indicator
Step 1: Monitor Primary Oscillator
Watch selected oscillator (default RSI) for overbought/oversold conditions.
Step 2: Wait for Divergence Labels
"BULL DIV" or "BEAR DIV" labels appear when 2+ oscillators confirm divergence.
Step 3: Check Oscillator Count
Higher count = higher probability. 4/6 or better is ideal.
Step 4: Assess Divergence Strength
Tooltip shows strength percentage. >75% is very strong, >60% is strong.
Step 5: Confirm with MTF
Triangle markers indicate higher timeframe confirmation - highest probability setups.
Step 6: Watch for Elite Signals
Large "BULL DIV" or "BEAR DIV" labels with 4+ oscillators and >75% strength are highest conviction.
Best Practices
Focus on divergences with 3+ oscillator confirmation for best results
Regular divergences work best at price extremes (support/resistance)
Hidden divergences confirm trend continuation - trade with trend
MTF confirmation adds significant edge - wait when possible
Divergence clustering indicates strong reversal pressure
Volume confirmation reduces false signals but adds lag
Elite signals (4+ oscillators, >75% strength) have highest win rate
Use cooldown system (15 bars minimum) to avoid overtrading
Combine with price action - divergence shows momentum, price shows structure
Indicator Limitations
Divergence detection requires clear pivot formation - lags by pivot_right bars
Multiple oscillators can produce conflicting signals during choppy markets
Hidden divergences are less reliable than regular divergences
Strength scoring is probabilistic, not deterministic
MTF confirmation adds lag but increases reliability
Clustering detection has fixed lookback - may miss longer-term patterns
Volume confirmation may not work well on illiquid instruments
Extreme market conditions can invalidate divergence signals
Technical Implementation
Built with Pine Script v6 using:
6-oscillator system (RSI, MFI, Stochastic, MACD, CCI, Stochastic RSI)
Pivot-based divergence detection with array tracking
Regular and hidden divergence algorithms
Multi-oscillator confirmation aggregation
Divergence strength scoring (oscillator count + volume + momentum)
Multi-timeframe security requests for HTF confirmation
Divergence clustering detection (50-bar lookback)
Signal cooldown system (15 bars minimum)
Gradient visualization with dynamic coloring
Institutional flow integration (CVD delta analysis)
Elite signal filtering (4+ oscillators, >75% strength)
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive multi-oscillator divergence confirmation approach. While individual oscillator divergences are established concepts, this indicator is justified because:
It combines 6 independent oscillators (RSI, MFI, Stochastic, MACD, CCI, Stochastic RSI) for robust confirmation
The multi-oscillator confirmation system (2-6 required) significantly reduces false signals
Divergence strength scoring quantifies setup quality through multi-factor analysis
Multi-timeframe divergence confirmation adds conviction layer
Divergence clustering detection identifies high-probability reversal zones
Integration of institutional flow (CVD delta) with divergence analysis is unique
Elite signal filtering (4+ oscillators, >75% strength) isolates highest probability setups
Signal cooldown system prevents overtrading while maintaining signal quality
Each component contributes unique information: multiple oscillators reduce false signals, regular divergences show reversals, hidden divergences show continuations, strength scoring quantifies quality, MTF confirmation adds conviction, clustering shows intensity, and institutional flow confirms with volume. The indicator's value lies in presenting these complementary perspectives simultaneously with rigorous confirmation requirements.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Divergence signals do not guarantee reversals. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Adaptive Volatility Matrix [JOAT]Adaptive Volatility Matrix
Introduction
The Adaptive Volatility Matrix (AVM) is an advanced open-source volatility regime classification indicator that combines Bollinger Band Width Percentile (BBWP), ATR percentile analysis, regime transition prediction, volatility clustering detection, and historical regime statistics to classify market conditions into distinct volatility regimes. This indicator helps traders adapt their strategies to current market conditions by systematically identifying when volatility is expanding, contracting, or transitioning between regimes.
Unlike basic volatility indicators that simply plot ATR or Bollinger Bands, AVM employs a sophisticated dual-metric system that combines BBWP (measuring price range compression/expansion) with ATR percentile (measuring absolute volatility) to create a combined volatility score (0-100%). The indicator then classifies this score into five distinct regimes and predicts regime transitions through momentum analysis.
Why This Indicator Exists
This indicator addresses the challenge of adapting trading strategies to volatility conditions. Different market regimes require different approaches - mean reversion works in low volatility, breakout strategies work in expansion, and risk management becomes critical in extreme volatility. AVM systematically reveals:
BBWP Analysis: Measures Bollinger Band width percentile to identify compression/expansion cycles
ATR Percentile: Tracks normalized ATR percentile to measure absolute volatility levels
Combined Volatility Score: Weighted average (60% BBWP, 40% ATR) for robust regime classification
Regime Classification: Five distinct regimes (Extreme Expansion, Expansion, Normal, Contraction, Extreme Contraction)
Transition Prediction: Momentum-based forecasting of next regime with probability
Volatility Clustering: Detects sustained high/low volatility periods
Historical Statistics: Tracks regime duration and frequency for context
Each component provides unique intelligence. BBWP shows compression cycles, ATR shows absolute volatility, combined score provides robust classification, regime system categorizes conditions, transition prediction anticipates changes, clustering detects persistence, and statistics provide historical context.
Core Components Explained
1. BBWP (Bollinger Band Width Percentile) Calculation
BBWP measures where current Bollinger Band width ranks relative to historical width:
f_calculate_bbwp(int length, int lookback) =>
float basis = ta.sma(close, length)
float dev = ta.stdev(close, length)
float bb_width = (dev * 2) / basis * 100
// Calculate percentile rank
int count = 0
for i = 1 to lookback
if bb_width > nz(bb_width )
count += 1
float bbwp = (count / lookback) * 100
BBWP ranges from 0-100%:
- 0-20%: Extreme compression (volatility squeeze)
- 20-40%: Contraction (below average volatility)
- 40-60%: Normal (average volatility)
- 60-80%: Expansion (above average volatility)
- 80-100%: Extreme expansion (volatility breakout)
2. ATR Percentile Analysis
ATR percentile measures where current normalized ATR ranks historically:
f_atr_percentile(int period, int lookback) =>
float atr_val = ta.atr(period)
float natr = close > 0 ? (atr_val / close) * 100 : 0.0
float percentile = ta.percentrank(natr, lookback)
Normalized ATR (NATR) accounts for price level differences, making volatility comparable across different price ranges. Percentile ranking shows where current volatility sits in historical distribution.
3. Combined Volatility Score & Regime Classification
The combined score weights BBWP more heavily than ATR percentile:
float combined_score = (bbwp_value * 0.6) + (atr_percentile * 0.4)
f_classify_regime(float bbwp_val, float atr_perc, float exp_th, float con_th, float ext_th) =>
string regime = "Normal"
int regime_code = 0
if bbwp_val >= ext_th or atr_perc >= ext_th
regime := "Extreme Expansion"
regime_code := 4
else if bbwp_val >= exp_th or atr_perc >= exp_th
regime := "Expansion"
regime_code := 3
// Additional classifications...
Five regime classifications:
1. Extreme Contraction (code 1): Both metrics <30%, volatility squeeze
2. Contraction (code 2): One metric <40%, below average volatility
3. Normal (code 0): Both metrics 40-60%, average conditions
4. Expansion (code 3): One metric >70%, above average volatility
5. Extreme Expansion (code 4): Both metrics >85%, volatility breakout
4. Regime Transition Prediction
AVM predicts next regime through momentum analysis:
float regime_momentum = combined_score - combined_score
string momentum_direction = regime_momentum > 2 ? "Accelerating" :
regime_momentum < -2 ? "Decelerating" : "Stable"
string predicted_regime = regime_code == 4 and regime_momentum < -5 ? "→ Expansion" :
regime_code == 3 and regime_momentum < -3 ? "→ Normal" :
// Additional predictions...
"Stable"
float transition_prob = math.min(math.abs(regime_momentum) * 10, 100)
Transition probability (0-100%) based on momentum magnitude. >50% probability triggers warning.
5. Volatility Clustering Detection
Clustering identifies sustained high/low volatility periods:
int cluster_lookback = 20
float cluster_threshold = 70.0
int high_vol_count = 0
for i = 0 to cluster_lookback - 1
if combined_score >= cluster_threshold
high_vol_count += 1
float cluster_ratio = high_vol_count / cluster_lookback * 100
bool in_vol_cluster = cluster_ratio >= 60 // 60% of bars are high vol
string cluster_strength = cluster_ratio >= 80 ? "Strong" :
cluster_ratio >= 60 ? "Moderate" :
cluster_ratio >= 40 ? "Weak" : "None"
Clusters indicate persistent volatility conditions that tend to continue.
6. Historical Regime Statistics
AVM tracks regime history for context:
var array regime_history = array.new_int(0)
var array regime_durations = array.new_int(0)
if regime_changed
array.push(regime_history, regime_code)
array.push(regime_durations, bars_in_regime)
// Calculate statistics
float avg_expansion_duration = exp_sum / exp_cnt
float avg_contraction_duration = con_sum / con_cnt
float duration_ratio = bars_in_regime / avg_expansion_duration
bool regime_extended = duration_ratio > 1.5
Statistics show if current regime is extended (>1.5x average duration), suggesting potential transition.
Visual Elements
Combined Score Line: Main plot (0-100%) with regime-based coloring
ATR Percentile Overlay: Circles showing ATR percentile for comparison
Histogram: Gradient-colored bars showing volatility score with regime colors
Reference Lines: 70% (expansion), 50% (neutral), 30% (contraction), 85% (extreme)
Background Zones: Regime-colored backgrounds (purple for expansion, yellow for contraction)
Transition Warnings: ⚠ symbols when transition probability >50%
BBWP Percentile Bands: 20th, 50th, 80th percentile circles for context
Dashboard: Real-time metrics including regime, score, BBWP, ATR%, trend, duration, momentum, transition prediction, cluster status, duration ratio, historical stats
Input Parameters
BBWP Parameters:
BBWP Length: Bollinger Band period (default: 13)
BBWP Lookback: Historical comparison period (default: 252)
ATR Analysis:
ATR Period: ATR calculation period (default: 14)
ATR Percentile Lookback: Historical ranking period (default: 100)
Regime Classification:
Expansion Threshold: Score for expansion regime (default: 70%)
Contraction Threshold: Score for contraction regime (default: 30%)
Extreme Threshold: Score for extreme regimes (default: 85%)
Visualization:
Show Regime Zones: Toggle background coloring
Show Histogram: Toggle volatility histogram
Show ATR Overlay: Toggle ATR percentile circles
How to Use This Indicator
Step 1: Identify Current Regime
Check dashboard "Regime" row. Adjust strategy based on classification.
Step 2: Monitor Combined Score
Score >70% = expansion (use breakout strategies)
Score <30% = contraction (use mean reversion)
Score 40-60% = normal (use balanced approach)
Step 3: Check Momentum Direction
"Accelerating" = volatility increasing
"Decelerating" = volatility decreasing
"Stable" = no significant change
Step 4: Watch for Transition Warnings
⚠ symbols indicate >50% probability of regime change. Prepare to adjust strategy.
Step 5: Assess Cluster Status
"Strong" or "Moderate" cluster = persistent conditions likely to continue
Step 6: Consider Duration Ratio
Ratio >1.5x = extended regime, higher probability of mean reversion
Best Practices
Use regime classification to select appropriate trading strategies
Extreme contraction often precedes volatility breakouts - prepare for expansion
Extreme expansion often mean-reverts - reduce position sizes
Transition warnings provide early signal to adjust risk management
Volatility clusters suggest persistence - don't fight the regime
Extended regimes (>1.5x average) have higher reversal probability
BBWP and ATR percentile divergence suggests regime uncertainty
Historical statistics provide context for current regime duration
Combine with directional indicators - AVM shows conditions, not direction
Indicator Limitations
Regime classification is backward-looking - transitions lag actual changes
BBWP calculation is computationally intensive on large lookback periods
Transition predictions are probabilistic, not deterministic
Extreme regimes can persist longer than expected during major events
Historical statistics require sufficient data (50+ regime changes)
Clustering detection has fixed lookback - may miss longer-term patterns
Combined score weighting (60/40) may not be optimal for all instruments
Regime thresholds may need adjustment for different markets
Technical Implementation
Built with Pine Script v6 using:
Custom BBWP calculation with percentile ranking
ATR percentile analysis with normalized ATR
Weighted combined score (60% BBWP, 40% ATR)
Five-tier regime classification system
Momentum-based transition prediction with probability
Volatility clustering detection (20-bar lookback)
Historical regime tracking with arrays (last 50 regimes)
Duration ratio calculation vs historical averages
BBWP percentile bands (20th, 50th, 80th)
Adaptive background coloring based on regime and duration
Comprehensive dashboard with 12 metrics
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive volatility regime classification approach. While BBWP and ATR are established concepts, this indicator is justified because:
It combines BBWP and ATR percentile into weighted combined score for robust classification
The five-tier regime system provides granular volatility categorization
Momentum-based transition prediction with probability quantification is unique
Volatility clustering detection identifies persistent regime conditions
Historical regime statistics provide context for current regime duration
Duration ratio calculation identifies extended regimes with mean reversion potential
BBWP percentile bands add additional context layers
Adaptive background intensity based on regime stability
Each component contributes unique information: BBWP shows compression cycles, ATR shows absolute volatility, combined score provides robust classification, regime system categorizes conditions, transition prediction anticipates changes, clustering detects persistence, statistics provide context, and duration ratio identifies extremes. The indicator's value lies in presenting these complementary perspectives simultaneously with unified regime framework.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Regime classifications do not guarantee future volatility behavior. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Structural Pivot Mapper [JOAT]Structural Pivot Mapper
Introduction
The Structural Pivot Mapper (SPM) is an advanced open-source structural analysis indicator that combines W/M pattern detection, dynamic support/resistance level mapping, pivot point analysis, volume profile integration, and break-retest detection to identify institutional structural pivots and key price levels. This indicator reveals market structure through systematic detection of swing highs/lows, classical chart patterns, and volume-based price levels, providing traders with a comprehensive structural framework for identifying high-probability entry and exit zones.
Unlike basic pivot indicators that simply mark swing points, SPM employs sophisticated pattern recognition algorithms to detect W patterns (bullish reversal), M patterns (bearish reversal), Head & Shoulders formations, and tracks level strength through touch counting and volume analysis. The indicator automatically manages support/resistance levels, removes outdated levels, and highlights Point of Control (POC) from volume profile analysis to show where institutional activity is concentrated.
Why This Indicator Exists
This indicator addresses the challenge of identifying key structural levels where institutional players are likely to defend positions or initiate new trades. Market structure provides the framework for understanding price behavior, and SPM systematically reveals:
W/M Pattern Detection: Identifies classical reversal patterns with strict validation rules
Dynamic Support/Resistance: Tracks pivot-based levels with automatic strength scoring
Level Touch Counting: Quantifies level importance through historical price interaction
Volume Profile Integration: Identifies Point of Control (POC) where maximum volume traded
Break & Retest Detection: Monitors level breaks and subsequent retests for confirmation
Head & Shoulders Patterns: Detects both regular and inverse H&S formations
Smart Level Management: Automatically removes weak levels and maintains only strongest
Each component provides unique intelligence. W/M patterns show reversal zones, pivots show swing structure, touch counting shows level strength, volume profile shows institutional interest, break-retest confirms level validity, and H&S patterns show major reversals.
Core Components Explained
1. W Pattern Detection (Bullish Reversal)
SPM detects W patterns through systematic analysis of 5 pivot points (A-B-C-D-E):
f_detect_w_pattern(float src, int lookback, int offset, bool strict) =>
// Find 5 pivot points forming W shape
// E = current, D = first low, C = middle high, B = second low, A = left high
// Validation: E > C, D < E, D < C, B <= D (strict), B < A
found := a > 0 and a != b and c != 0 and d != 0 and
src > src and src < src and src < src and
(src <= src or not strict) and src < src
W patterns indicate bullish reversal when:
- Price forms double bottom (D and B)
- Middle high (C) is lower than current price (E)
- Second low (B) is higher than or equal to first low (D) in strict mode
- Pattern completes with breakout above middle high (C)
Entry level is at middle high (C), stop loss at second low (B).
2. M Pattern Detection (Bearish Reversal)
M patterns are detected through inverted W logic:
f_detect_m_pattern(float src, int lookback, int offset, bool strict) =>
// Find 5 pivot points forming M shape
// E = current, D = first high, C = middle low, B = second high, A = left low
// Validation: E < C, D > E, D > C, B >= D (strict), B > A
found := a > 0 and a != b and c != 0 and d != 0 and
src < src and src > src and src > src and
(src >= src or not strict) and src > src
M patterns indicate bearish reversal when:
- Price forms double top (D and B)
- Middle low (C) is higher than current price (E)
- Second high (B) is lower than or equal to first high (D) in strict mode
- Pattern completes with breakdown below middle low (C)
Entry level is at middle low (C), stop loss at second high (B).
3. Dynamic Support/Resistance Level Management
SPM tracks pivot-based support and resistance levels with automatic management:
float pivot_high = ta.pivothigh(high, pivot_left, pivot_right)
float pivot_low = ta.pivotlow(low, pivot_left, pivot_right)
// Store levels in arrays
if not na(pivot_high) and barstate.isconfirmed
if array.size(resistance_levels) < max_levels
array.push(resistance_levels, pivot_high)
array.push(resistance_touches, 1)
else if auto_cleanup
array.shift(resistance_levels) // Remove oldest
array.push(resistance_levels, pivot_high)
Level strength is calculated through touch counting:
1 touch: New level (weak)
2 touches: Confirmed level (moderate)
3+ touches: Strong level (high importance)
Levels are automatically removed when max_levels is reached and auto_cleanup is enabled.
4. Level Touch Counting & Strength Scoring
SPM tracks how many times price interacts with each level:
float zone_size = atr_value * zone_width
if high >= level - zone_size and high <= level + zone_size
array.set(resistance_touches, i, array.get(resistance_touches, i) + 1)
Strength score (0-100) is calculated based on:
Touch Count (0-40 points): More touches = stronger level (8 points per touch, max 40)
Age Factor (0-30 points): Older levels = more established (based on level_strength_period)
Volume Factor (0-30 points): Higher volume at level = more institutional interest
Only levels with 2+ touches and strength >60 are displayed to reduce clutter.
5. Volume Profile & Point of Control (POC)
SPM calculates volume profile to identify price levels with maximum trading activity:
f_volume_profile(int bins, int lookback) =>
float price_range = price_high - price_low
float bin_size = price_range / bins
// Accumulate volume in 20 price bins
for i = 0 to lookback - 1
float bar_price = hlc3
int bin = math.floor((bar_price - price_low) / bin_size)
array.set(vp_volumes, bin, current_vol + bar_vol)
// Find POC (highest volume bin)
float poc_price = array.get(vp_prices, poc_bin)
POC represents the price level where most volume traded - typically where institutions have significant positions. Value Area High (VAH) and Value Area Low (VAL) define the range containing 70% of volume.
6. Break & Retest Detection
SPM monitors when price breaks through resistance levels and subsequently retests:
// Detect break (close above resistance)
if not was_broken and close > level and close <= level
array.set(level_broken, i, true)
array.set(break_bar_index, i, bar_index)
// Detect retest (price returns to broken level within 3-20 bars)
if was_broken
int break_bar = array.get(break_bar_index, i)
bool is_retest = bar_index - break_bar >= 3 and bar_index - break_bar <= 20
bool touching_level = math.abs(close - level) < atr_value * 0.5
if is_retest and touching_level
label.new(bar_index, level, "RT", color=c_support_strong)
Successful retests confirm level validity and often provide high-probability entry opportunities.
7. Head & Shoulders Pattern Detection
SPM detects both regular and inverse Head & Shoulders formations:
f_detect_head_shoulders(float src, int lookback) =>
// Find 3 pivot highs: left shoulder, head, right shoulder
float ph1 = ta.pivothigh(src, lookback, lookback)
float ph2 = ta.pivothigh(src, lookback, lookback)
float ph3 = ta.pivothigh(src, lookback, lookback)
// Validate: head higher than shoulders, shoulders roughly equal
if ph2 > ph1 and ph2 > ph3 and math.abs(ph1 - ph3) < (ph2 - ph1) * 0.3
found := true
neckline := math.min(low , low )
H&S patterns are major reversal formations indicating trend exhaustion and potential reversal.
Visual Elements
Support Lines: Blue horizontal lines with strength-based width (2-3px)
Resistance Lines: Pink horizontal lines with strength-based width (2-3px)
Level Labels: "S: price " for support, "R: price " for resistance (N = touch count)
Pivot Markers: Small circles at swing highs (pink) and lows (blue)
POC Line: Yellow dotted line showing Point of Control from volume profile
Retest Markers: "RT" labels when price retests broken levels
Pattern Lines: Optional dashed lines showing W/M pattern structure (disabled by default)
Dashboard: Real-time metrics showing resistance count, support count, pattern status, POC price
Input Parameters
Pattern Detection:
Pattern Range: Lookback period for W/M detection (default: 9)
Pattern Offset: Additional bars to check (default: 0)
Strict Pattern Validation: Enforce stricter pattern rules (default: false)
Pivot Settings:
Pivot Left Bars: Bars to left of pivot (default: 6)
Pivot Right Bars: Bars to right of pivot (default: 1)
Show Pivot Labels: Toggle pivot markers (default: true)
Level Management:
Maximum Levels: Max support/resistance levels to track (default: 3)
Level Strength Period: Lookback for strength calculation (default: 50)
Auto-Cleanup Old Levels: Remove oldest when max reached (default: true)
Visualization:
Show Support/Resistance Zones: Toggle level display (default: true)
Zone Width (ATR %): Width of level zones (default: 0.5)
Show Pattern Lines: Toggle W/M pattern visualization (default: false)
How to Use This Indicator
Step 1: Identify Key Structural Levels
Look for blue (support) and pink (resistance) lines. Thicker lines with higher touch counts are strongest.
Step 2: Monitor Pattern Formations
Watch dashboard for "W Pattern" (bullish) or "M Pattern" (bearish) status. These indicate potential reversal zones.
Step 3: Check POC Proximity
Yellow POC line shows where maximum volume traded. Price often gravitates toward POC or bounces from it.
Step 4: Wait for Break & Retest
When price breaks resistance and retests (RT label), it confirms level as new support. High-probability long entry.
Step 5: Use Level Strength for Confidence
Levels with 3+ touches are most reliable. Dashboard shows total support/resistance count.
Step 6: Combine with Higher Timeframe Structure
Use SPM on multiple timeframes. Daily/weekly levels are stronger than intraday levels.
Best Practices
Focus on levels with 3+ touches - these have proven institutional interest
W/M patterns work best at major support/resistance levels
POC acts as magnet - price often returns to POC after deviating
Break-retest setups have highest win rate when combined with volume confirmation
Disable pattern lines to reduce chart clutter - use dashboard for pattern status
Adjust zone width based on instrument volatility (higher ATR = wider zones)
Auto-cleanup keeps chart clean but may remove valid older levels
H&S patterns are most reliable on higher timeframes (4H+)
Level strength score >70 indicates institutional-grade level
Smart spacing prevents overlapping levels - only strongest levels shown
Indicator Limitations
Pattern detection requires sufficient historical data and clear pivot formation
W/M patterns can produce false signals during strong trends
Level touch counting is historical - doesn't predict future touches
Volume profile requires consistent volume data - may not work on illiquid instruments
Break-retest detection has time window (3-20 bars) - may miss delayed retests
Maximum level limit means some valid levels may be removed
Pivot detection lags by pivot_right bars - not real-time
H&S patterns are rare and require specific market conditions
Level strength scoring is multi-factor but still subjective
Smart spacing may hide valid levels that are too close to stronger levels
Technical Implementation
Built with Pine Script v6 using:
Custom W/M pattern detection with 5-point validation
Pivot-based support/resistance tracking with arrays
Touch counting system with ATR-based zone detection
Multi-factor level strength scoring (touches + age + volume)
Volume profile calculation with 20-bin price distribution
POC detection through maximum volume identification
Break-retest monitoring with time window validation
Head & Shoulders pattern detection (regular and inverse)
Smart level spacing to prevent overlapping (1.5 ATR minimum)
Automatic level cleanup when maximum reached
Dynamic line and label management to prevent memory issues
Real-time dashboard with 4 key metrics
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive structural analysis approach. While pivot detection and pattern recognition are established concepts, this indicator is justified because:
It combines W/M pattern detection with dynamic support/resistance management in a unified system
The multi-factor level strength scoring (touches + age + volume) provides quantitative level assessment
Volume profile integration with POC detection adds institutional perspective to structural analysis
Break-retest detection with time window validation automates a manual trading technique
Smart level spacing prevents chart clutter while maintaining strongest levels
Head & Shoulders detection (both regular and inverse) adds major reversal pattern recognition
Automatic level cleanup maintains chart readability without manual intervention
Integration of classical patterns (W/M, H&S) with modern volume analysis creates layered confirmation
Each component contributes unique information: W/M patterns show reversals, pivots show structure, touch counting shows strength, volume profile shows institutional interest, break-retest confirms validity, H&S shows major reversals, and strength scoring quantifies importance. The indicator's value lies in presenting these complementary perspectives simultaneously with intelligent level management.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Structural levels and patterns do not guarantee price behavior. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Probabilistic Bias Engine [JOAT]Probabilistic Bias Engine
Introduction
The Probabilistic Bias Engine (PBE) is an advanced open-source directional bias indicator that combines Bayesian probability analysis, historical for-loop pattern recognition, multi-timeframe confluence detection, and ensemble learning to quantify market directional bias with statistical confidence. This indicator transforms raw price action into probabilistic bias scores (0-100%), helping traders identify high-probability directional setups through systematic analysis of historical price behavior across multiple timeframes.
Unlike simple trend indicators that use moving averages or momentum oscillators, PBE employs a sophisticated for-loop analysis system that compares current price against historical price points across customizable lookback periods, applies Bayesian probability theory to calculate directional likelihood, and aggregates signals across multiple timeframes to generate confidence-weighted bias scores. The indicator provides both current timeframe bias and multi-timeframe confluence analysis for comprehensive directional assessment.
Why This Indicator Exists
This indicator addresses the challenge of quantifying directional bias with statistical rigor. Traditional trend indicators provide binary signals (bullish/bearish) without probability quantification. PBE systematically analyzes historical price behavior to reveal:
Bayesian Probability Calculation: Converts for-loop analysis into probabilistic bias scores using Bayesian inference
Historical Pattern Recognition: Analyzes price position relative to 1-70 historical bars to identify directional patterns
Multi-Timeframe Confluence: Confirms bias across short (5m), medium (15m), and long (60m) timeframes
Ensemble For-Loop Analysis: Combines multiple lookback periods (30, 70, 150 bars) for robust bias calculation
Volatility Regime Scaling: Adjusts probability scores based on current volatility environment
Divergence Confirmation Layer: Detects RSI divergences to enhance signal quality
Confidence Heatmap: Visualizes setup quality through multi-factor confidence scoring (0-100%)
Each component provides unique intelligence. For-loop analysis shows historical price position, Bayesian calculation quantifies probability, MTF confluence shows conviction, ensemble analysis adds robustness, volatility scaling adjusts for regime, divergence layer confirms reversals, and confidence scoring synthesizes all factors.
Core Components Explained
1. For-Loop Historical Analysis
PBE's core innovation is systematic comparison of current price against historical price points:
f_forloop_analysis(float src, int start, int lookback) =>
float sum = 0.0
for i = start to lookback
sum += src > src ? 1 : -1
float normalized = sum / (lookback - start + 1)
normalized
This function iterates through historical bars, adding +1 when current price is above historical price and -1 when below. The normalized result ranges from -1.0 (price below all historical points) to +1.0 (price above all historical points).
2. Bayesian Probability Calculation
The for-loop score is converted to probability using Bayesian inference:
f_bayesian_probability(float loop_value) =>
float evidence = loop_value > 0 ? 0.7 : 0.3
float prior = 0.5
float posterior = (prior * evidence) /
(prior * evidence + (1 - prior) * (1 - evidence))
posterior
This calculates the posterior probability of bullish bias given the for-loop evidence. Positive loop values increase bullish probability, negative values increase bearish probability. The result is scaled to 0-100% for display.
image]https://www.pulsewire.com/x/CtYqgABU/
3. Multi-Timeframe Confluence Detection
PBE requests bias data from three timeframes and counts alignment:
f_get_timeframe_bias(string tf) =>
= request.security(syminfo.tickerid, tf,
)
float prob_tf = f_bayesian_probability(loop_score_tf)
int bias_tf = prob_tf > 0.5 ? 1 : -1
Confluence is calculated by counting how many timeframes agree:
Strong Aligned (4/4): All timeframes bullish or bearish - highest conviction
Aligned (3/4): Majority alignment - moderate conviction
Weak (2/4): Split alignment - low conviction
No Alignment (1/4 or 0/4): Conflicting signals - no conviction
4. Ensemble For-Loop Analysis
Multiple lookback periods are combined for robust bias calculation:
f_forloop_ensemble(float src, int start, int end1, int end2, int end3) =>
// Calculate for-loop scores for 30, 70, and 150 bar lookbacks
float norm1 = sum1 / (end1 - start + 1)
float norm2 = sum2 / (end2 - start + 1)
float norm3 = sum3 / (end3 - start + 1)
// Weighted ensemble (shorter periods get more weight)
float ensemble = (norm1 * 0.5) + (norm2 * 0.3) + (norm3 * 0.2)
ensemble
Short-term bias (30 bars) receives 50% weight, medium-term (70 bars) receives 30%, and long-term (150 bars) receives 20%. This creates a balanced view across multiple time horizons.
5. Volatility Regime Scaling
Probability scores are adjusted based on volatility environment:
float atr_val = ta.atr(14)
float natr = (atr_val / close) * 100
float vol_percentile = ta.percentrank(natr, 100)
float regime_multiplier =
vol_percentile >= 80 ? 0.85 : // High vol: reduce confidence
vol_percentile >= 60 ? 0.92 : // Elevated: slight reduction
vol_percentile >= 40 ? 1.0 : // Normal: no adjustment
vol_percentile >= 20 ? 1.05 : // Low vol: slight increase
1.1 // Very low: increase confidence
float regime_adjusted_prob = smoothed_probability * regime_multiplier
High volatility reduces probability scores (more uncertainty), while low volatility increases scores (more predictable).
6. Divergence Confirmation Layer
RSI divergences are detected to enhance signal quality:
float rsi = ta.rsi(close, 14)
// Bullish divergence: price lower low, RSI higher low
bool bull_divergence = low < last_rsi_low_price and rsi > last_rsi_low
// Bearish divergence: price higher high, RSI lower high
bool bear_divergence = high > last_rsi_high_price and rsi < last_rsi_high
Divergences add 20 points to confidence score and trigger enhanced signals when combined with probability alignment.
7. Confidence Heatmap Visualization
Multi-factor confidence scoring (0-100%) based on:
Probability Strength (0-40 points): Distance from 50% neutral (max 40 points at 100% or 0%)
MTF Alignment (0-30 points): 30 points for 4/4 alignment, 20 for 3/4, 10 for 2/4
Divergence Confirmation (0-20 points): 20 points when divergence detected
Regime Favorability (0-10 points): 10 points for Normal/Low vol, 5 for Very Low, 0 for High vol
Total confidence score determines background heatmap intensity:
80-100%: Strong signal (bright color, low transparency)
60-79%: Moderate signal (medium color, medium transparency)
40-59%: Weak signal (dim color, high transparency)
0-39%: No signal (neutral color)
Visual Elements
Probability Line: Main plot showing smoothed probability (0-100%) with dynamic coloring
Zero-Lag Line: Circles overlay showing zero-lag probability for early signals
Histogram: Gradient-colored histogram showing probability deviation from 50% neutral
Reference Lines: 70% (strong bullish), 50% (neutral), 30% (strong bearish)
Background Zones: Strong bullish (>70%), strong bearish (<30%) with transparency
Confidence Heatmap: Background intensity based on multi-factor confidence score
Signal Shapes: High conviction bull/bear setups, regime shifts, divergence confirmations
Dashboard: Real-time metrics including current probability, strength, MTF alignment, ensemble score, volatility regime, confidence, and divergence status
Input Parameters
Bayesian Parameters:
Price Source: Data source for calculations (default: hlc3)
Bayesian Period: Smoothing period for probability (default: 14)
Signal Smoothing: EMA smoothing for final probability (default: 2)
Historical Analysis:
Loop Start: Starting bar for for-loop analysis (default: 1)
Loop Lookback: Ending bar for for-loop analysis (default: 70)
Multi-Timeframe Confluence:
Enable MTF Confluence: Toggle multi-timeframe analysis (default: enabled)
Short Timeframe: Fast timeframe for confluence (default: 5m)
Medium Timeframe: Medium timeframe for confluence (default: 15m)
Long Timeframe: Slow timeframe for confluence (default: 60m)
Confluence Requirement: Minimum timeframes required (default: 2)
Visualization:
Show Probability Bands: Toggle 70%/30% reference lines
Show Bias Zones: Toggle background coloring for strong bias
Show Histogram: Toggle probability deviation histogram
How to Use This Indicator
Step 1: Monitor Probability Level
Watch the main probability line. >70% indicates strong bullish bias, <30% indicates strong bearish bias, 40-60% is neutral.
Step 2: Check MTF Confluence
Verify dashboard shows "Strong Aligned" or "Aligned" status. Higher alignment = higher conviction.
Step 3: Assess Confidence Score
Dashboard confidence >70% indicates high-quality setup. >80% is exceptional.
Step 4: Confirm with Ensemble
Ensemble probability should align with current probability. Divergence suggests conflicting time horizons.
Step 5: Consider Volatility Regime
"Normal" or "Low Vol" regimes have higher reliability. "High Vol" regimes require extra caution.
Step 6: Wait for High Conviction Signals
Best setups occur when:
- Probability >65% or <35%
- Confidence >70%
- MTF alignment 3/4 or 4/4
- Cooldown period passed (12+ bars since last signal)
Best Practices
Use probability crossovers of 50% as regime shift signals
Combine with price action - probability shows bias, price shows execution
MTF alignment is most reliable during trending markets
Confidence heatmap provides quick visual assessment of setup quality
Divergence signals add significant edge when combined with probability alignment
Ensemble probability provides longer-term context - use for position bias
Volatility regime scaling is critical - reduce size in high vol environments
Zero-lag line provides early warning of probability shifts
Histogram intensity shows conviction - larger bars = stronger bias
Indicator Limitations
For-loop analysis is computationally intensive - may slow on lower-end devices
Probability scores are based on historical patterns - unprecedented events can invalidate
MTF confluence requires sufficient data on all timeframes
Bayesian calculation assumes price behavior follows historical patterns
High volatility reduces probability reliability - regime scaling helps but doesn't eliminate
Divergence detection requires clear pivot formation - may lag in choppy markets
Confidence scoring is multi-factor but still probabilistic - not deterministic
Zero-lag calculation can produce whipsaws during consolidation
Technical Implementation
Built with Pine Script v6 using:
Custom for-loop historical analysis across 1-70 bars
Bayesian probability calculation with evidence-based inference
Multi-timeframe security requests for 5m, 15m, 60m confluence
Ensemble for-loop analysis with weighted averaging (30, 70, 150 bars)
ATR-based volatility regime classification with percentile ranking
RSI divergence detection using pivot analysis
Multi-factor confidence scoring (probability, MTF, divergence, regime)
Zero-lag EMA calculation for early signal detection
Gradient histogram with dynamic coloring based on probability
Confidence heatmap background with intensity scaling
Signal cooldown system (12 bars minimum) to prevent overtrading
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its probabilistic bias quantification approach. While for-loop analysis and Bayesian probability are established concepts, this indicator is justified because:
It combines systematic for-loop historical analysis with Bayesian probability theory for statistical rigor
The ensemble for-loop system (30, 70, 150 bars) with weighted averaging is unique
Multi-timeframe confluence detection provides conviction measurement across 4 timeframes
Volatility regime scaling adjusts probability scores based on market environment
Divergence confirmation layer adds reversal detection to directional bias
Multi-factor confidence scoring (probability + MTF + divergence + regime) synthesizes all components
Zero-lag overlay provides early warning system for probability shifts
Confidence heatmap visualization makes setup quality immediately apparent
Each component contributes unique information: for-loop shows historical position, Bayesian quantifies probability, MTF shows conviction, ensemble adds robustness, volatility scales for regime, divergence confirms reversals, confidence synthesizes quality, and zero-lag provides early warning. The indicator's value lies in presenting these complementary perspectives simultaneously with unified probabilistic framework.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Probability scores do not guarantee outcomes. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Pressure Zone Analyzer [JOAT]Pressure Zone Analyzer
Introduction
The Pressure Zone Analyzer is an advanced open-source support/resistance indicator that combines dynamic pivot-based zone detection, Fibonacci level analysis, institutional level tracking, zone strength scoring, and multi-timeframe analysis into a comprehensive pressure zone intelligence system. This indicator helps traders identify where significant buying and selling pressure exists, where institutional levels act as magnets for price, and which zones have the highest probability of holding.
Unlike basic support/resistance indicators that draw static horizontal lines, this analyzer dynamically tracks pressure zones based on pivot points, calculates zone strength using volume, touches, and age, integrates Fibonacci golden zone analysis, monitors institutional weekly/daily levels, and provides real-time position assessment. The indicator is designed for traders who understand that not all support/resistance levels are equal and that zone quality determines trading success.
Why This Indicator Exists
This indicator addresses the challenge of identifying high-quality support and resistance zones in real-time. Markets respect some levels and ignore others. By systematically analyzing zone characteristics, this indicator reveals:
Dynamic Pressure Zones: Identifies support and resistance zones based on pivot points with automatic updates
Zone Strength Scoring: Calculates zone quality (0-100%) using volume, touch count, and age
Fibonacci Integration: Tracks key Fibonacci levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) and golden zone (50-61.8%)
Institutional Levels: Monitors weekly and daily highs/lows that act as institutional reference points
Premium/Discount Zones: Identifies institutional buying zones (discount 0-30%) and selling zones (premium 70-100%)
Multi-Timeframe Analysis: Tracks higher timeframe levels for additional confluence
Position Assessment: Provides real-time analysis of price position relative to all zones
Each component provides different zone intelligence. Pivot-based zones show where price reversed, strength scoring shows zone quality, Fibonacci shows mathematical levels, institutional levels show reference points, premium/discount shows institutional bias, and position assessment shows current market context. Together, they create a comprehensive pressure zone system.
Core Components Explained
1. Dynamic Pivot-Based Zone Detection
Pressure zones are identified using pivot highs and lows:
float pivotHigh = ta.pivothigh(high, pivotLength, pivotLength)
float pivotLow = ta.pivotlow(low, pivotLength, pivotLength)
When a pivot high is detected, a resistance zone is created:
if not na(pivotHigh) and barstate.isconfirmed
PressureZone newZone = PressureZone.new()
newZone.zoneLine := line.new(bar_index - pivotLength, pivotHigh, bar_index + 50, pivotHigh,
color=resistanceColor, width=2, extend=extend.right)
newZone.price := pivotHigh
newZone.startBar := bar_index - pivotLength
newZone.zoneType := "resistance"
newZone.volumeAtZone := volume
Similarly for support zones with pivot lows. Zones are stored in arrays and automatically managed (old zones are removed when maximum count is reached).
Zone thickness is calculated as a percentage of price:
calcZoneThickness(float price, float thicknessPercent) =>
float thickness = price * (thicknessPercent / 100)
Default thickness is 0.5% of price, creating a zone rather than a single line. This accounts for the fact that support/resistance is a zone, not a precise price level.
2. Zone Strength Scoring System
Zone strength is calculated using three weighted components:
calcZoneStrength(int touches, float volAtZone, int age, float volWeight, float touchWeight, float ageWeight) =>
// Volume score (0-1)
float avgVolume = ta.sma(volume, 50)
float volScore = avgVolume > 0 ? math.min(volAtZone / avgVolume, 3.0) / 3.0 : 0.5
// Touch score (0-1)
float touchScore = math.min(touches / 5.0, 1.0)
// Age score (0-1) - newer zones score higher
float ageScore = math.max(1.0 - (age / 500.0), 0.0)
// Weighted combination
float strength = (volScore * volWeight) + (touchScore * touchWeight) + (ageScore * ageWeight)
Default weights:
Volume Weight: 40% - Higher volume at zone formation indicates institutional interest
Touch Weight: 30% - More touches indicate stronger zone
Age Weight: 30% - Newer zones are more relevant than old zones
Strength interpretation:
> 70%: Strong zone - high probability of holding
50-70%: Moderate zone - decent probability of holding
< 50%: Weak zone - lower probability of holding
The indicator tracks touches in real-time:
for zone in resistanceZones
if inZone(high, zone.price, thickness)
zone.touches += 1
zone.volumeAtZone := math.max(zone.volumeAtZone, volume)
Each touch increases zone strength, and high-volume touches increase it further.
3. Fibonacci Level Analysis
Fibonacci levels are calculated based on recent swing range:
calcFibLevels(float high, float low) =>
float priceRange = high - low
float fib236 = low + (priceRange * 0.236)
float fib382 = low + (priceRange * 0.382)
float fib500 = low + (priceRange * 0.500)
float fib618 = low + (priceRange * 0.618)
float fib786 = low + (priceRange * 0.786)
The indicator focuses on key levels:
50% (0.5): Equilibrium level - often acts as support/resistance
61.8% (0.618): Golden ratio - strongest Fibonacci level
Golden Zone is calculated as the area between 50% and 61.8%:
calcGoldenZone(float high, float low) =>
float priceRange = high - low
float goldenTop = low + (priceRange * 0.618)
float goldenBottom = low + (priceRange * 0.5)
The golden zone represents optimal entry area with best risk:reward ratio. Entries in the golden zone allow tight stops below 50% with targets at swing high.
4. Institutional Level Tracking
The indicator monitors key institutional reference levels:
Weekly High/Low:
float lastWeekHigh = request.security(syminfo.tickerid, "W", high ,
barmerge.gaps_off, barmerge.lookahead_off)
float lastWeekLow = request.security(syminfo.tickerid, "W", low ,
barmerge.gaps_off, barmerge.lookahead_off)
Daily High/Low:
float yesterdayHigh = request.security(syminfo.tickerid, "D", high ,
barmerge.gaps_off, barmerge.lookahead_off)
float yesterdayLow = request.security(syminfo.tickerid, "D", low ,
barmerge.gaps_off, barmerge.lookahead_off)
These levels act as magnets for price because:
Institutional algorithms reference these levels for order placement
Retail traders watch these levels for breakouts/breakdowns
Options and futures contracts often reference these levels
Previous day/week ranges provide context for current price action
5. Premium/Discount Zone System
Based on weekly range, the indicator calculates institutional bias zones:
float weekRange = lastWeekHigh - lastWeekLow
// Premium Zone (70-100% of range) - Institutional selling zone
float premiumTop = lastWeekHigh
float premiumBot = lastWeekLow + (weekRange * 0.7)
// Discount Zone (0-30% of range) - Institutional buying zone
float discountTop = lastWeekLow + (weekRange * 0.3)
float discountBot = lastWeekLow
// Golden Zone (50-61.8% of range) - Optimal entry zone
float goldenTop = lastWeekLow + (weekRange * 0.618)
float goldenBot = lastWeekLow + (weekRange * 0.5)
Trading logic:
In Discount Zone: Look for long entries - institutions are likely buying
In Premium Zone: Look for short entries - institutions are likely selling
In Golden Zone: Optimal risk:reward for entries in direction of trend
Between Zones: Neutral area - wait for price to reach discount or premium
This concept is based on institutional order flow: institutions buy in discount zones (value area) and sell in premium zones (overvalued area).
6. Multi-Timeframe Level Analysis
The indicator tracks higher timeframe levels for additional confluence:
float htfHigh = request.security(syminfo.tickerid, htfTimeframe, high ,
barmerge.gaps_off, barmerge.lookahead_off)
float htfLow = request.security(syminfo.tickerid, htfTimeframe, low ,
barmerge.gaps_off, barmerge.lookahead_off)
HTF timeframe is customizable (default: Daily). When current timeframe zones align with HTF levels, confluence increases zone strength.
7. Real-Time Position Assessment
The indicator continuously assesses price position:
// Check if in golden zone
bool inGoldenZone = close >= goldenBottom and close <= goldenTop
// Check if near resistance
bool nearResistance = false
for zone in resistanceZones
if inZone(close, zone.price, thickness * 2)
nearResistance := true
// Check if near support
bool nearSupport = false
for zone in supportZones
if inZone(close, zone.price, thickness * 2)
nearSupport := true
Position status:
AT RESISTANCE: Price near strong resistance zone - consider shorts or exits
AT SUPPORT: Price near strong support zone - consider longs or exits
GOLDEN ZONE: Price in optimal entry area - look for entries in trend direction
NEUTRAL: Price not near any significant zones - wait for better positioning
Visual Elements
Pressure Zone Lines: Horizontal lines showing resistance (red) and support (green) zones
Zone Strength Boxes: Filled boxes showing only strongest zones (strength > 60%) with strength percentage
Fibonacci Lines: Key Fibonacci levels (50% and 61.8%) with distinct colors
Golden Zone Fill: Shaded area between 50% and 61.8% Fibonacci levels
Institutional Lines: Weekly high/low (purple, thick) and Daily high/low (yellow, medium)
HTF Lines: Higher timeframe high/low (cyan) for additional confluence
Premium/Discount Fills: Shaded zones showing premium (red), discount (green), and golden (orange) areas
Position Markers: Visual alerts when price enters golden zone or approaches strong zones
Comprehensive Table: Dashboard showing top 2 resistance zones, top 2 support zones, institutional levels, Fibonacci levels, and current position status
Input Parameters
Pressure Zone Settings:
Zone Detection Length: Period for swing range calculation (default: 50, range: 20-200)
Pivot Length: Period for pivot detection (default: 10, range: 5-50)
Max Zones: Maximum zones to display (default: 8, range: 4-20)
Zone Thickness Percent: Zone width as percentage of price (default: 0.5%, range: 0.1-2.0%)
Fibonacci Settings:
Show Fibonacci Levels: Toggle Fib lines (default: enabled)
Show Golden Zone: Toggle golden zone fill (default: enabled)
Institutional Levels:
Show Last Week High/Low: Toggle weekly levels (default: enabled)
Show Yesterday High/Low: Toggle daily levels (default: enabled)
Strength Scoring:
Show Zone Strength: Toggle strength boxes (default: enabled)
Volume Weight: Weight for volume component (default: 0.4, range: 0.0-1.0)
Touch Weight: Weight for touch component (default: 0.3, range: 0.0-1.0)
Age Weight: Weight for age component (default: 0.3, range: 0.0-1.0)
Multi-Timeframe:
HTF Timeframe: Higher timeframe for level tracking (default: Daily)
Show HTF Levels: Toggle HTF lines (default: enabled)
Colors:
All colors are fully customizable including resistance, support, Fibonacci, golden zone, HTF levels, and institutional levels.
How to Use This Indicator
Step 1: Identify Strongest Zones
Look at the table to see top 2 resistance and support zones with strength percentages. Focus on zones with strength > 70%.
Step 2: Check Institutional Levels
Monitor weekly and daily highs/lows. These act as magnets for price and often provide strong support/resistance.
Step 3: Assess Premium/Discount Position
Determine if price is in premium zone (look for shorts), discount zone (look for longs), or golden zone (optimal entries).
Step 4: Look for Fibonacci Confluence
When pressure zones align with Fibonacci levels (especially 50% and 61.8%), zone strength increases significantly.
Step 5: Monitor Position Status
Check the table's position row. "AT RESISTANCE" or "AT SUPPORT" signals potential reversal or bounce areas.
Step 6: Wait for Zone Tests
Don't chase price. Wait for price to return to strong zones before entering. The best entries occur when price tests a zone and shows rejection.
Step 7: Use HTF Confluence
When current timeframe zones align with HTF levels, probability of zone holding increases. Look for these high-confluence areas.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal zone clarity
Focus on zones with strength > 70% - these have highest probability of holding
Multiple touches increase zone strength - zones that held before are likely to hold again
Golden zone entries offer best risk:reward - tight stops with large targets
Premium/discount zones work best in trending markets
Weekly levels are stronger than daily levels - prioritize weekly when they conflict
Wait for price to reach zones - don't anticipate, react
Look for volume confirmation when zones are tested - high volume rejections are strongest
Combine with price action - zones show where, price action shows when
HTF confluence significantly increases zone strength - prioritize these areas
Indicator Limitations
Zones don't always hold - even strong zones can break during major news or trend changes
Zone strength is relative to recent history - not absolute
Pivot-based detection requires sufficient price history - may not work on newly listed instruments
Maximum zone limits (8 default) mean some valid zones may not be displayed
Zone thickness is a percentage - may be too wide or narrow for some instruments
Premium/discount zones are relative to weekly range - not absolute value areas
Fibonacci levels are based on recent swing - may not align with longer-term structure
The indicator shows zones, not direction - requires trader interpretation
Works best on liquid instruments with clear support/resistance behavior
Zone strength scoring is a guide, not a guarantee - strong zones can still fail
Technical Implementation
Built with Pine Script v6 using:
Custom type definition for PressureZone with strength tracking
Array-based storage for resistance and support zones
Pivot-based zone detection with confirmation
Multi-component zone strength scoring
Touch and volume tracking for each zone
Fibonacci level calculations
Golden zone identification
Multi-timeframe security requests for institutional levels
Premium/discount zone calculations based on weekly range
Real-time position assessment
Dynamic table with 13 rows showing all metrics
Overlap prevention for visual clarity
Automatic zone cleanup when maximum count is reached
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 pressure zone analysis. While individual components (pivot-based S/R, Fibonacci, institutional levels) are established concepts, this indicator is justified because:
It synthesizes five distinct zone analysis methodologies into a unified system
Zone strength scoring combines volume, touches, and age with customizable weights
Automatic zone management prevents clutter while highlighting strongest zones
Integration of Fibonacci golden zone with pivot-based zones
Premium/discount zone system based on institutional order flow concepts
Multi-timeframe level tracking for confluence analysis
Real-time position assessment provides actionable trading context
Comprehensive table shows all metrics simultaneously for holistic analysis
Overlap prevention ensures clean charts without sacrificing information
Each component contributes unique zone intelligence: pivot zones show where price reversed, strength scoring shows zone quality, Fibonacci shows mathematical levels, institutional levels show reference points, premium/discount shows institutional bias, HTF levels show confluence, and position assessment shows current context. The indicator's value lies in presenting these complementary perspectives simultaneously with quantitative strength scoring and intelligent display management.
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.
Pressure zone analysis is a tool for identifying potential support and resistance areas, not a crystal ball for predicting future price movement. Strong zones, high strength scores, and institutional levels do not guarantee profitable trades. Past zone behavior does not guarantee future zone behavior. Market conditions change, and strategies that worked historically may not work in the future.
The zones and levels displayed are mathematical calculations based on current market data, not predictions of future price movement. High-strength zones can break, golden zone entries can fail, and institutional levels can be violated. 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

Regime Classification System [JOAT]Regime Classification System
Introduction
The Regime Classification System is an advanced open-source market regime detection indicator that combines smooth range filtering, multi-timeframe trend analysis (10 timeframes), impulse detection, Chandelier Exit integration, and regime strength scoring into a comprehensive market state classification system. This indicator helps traders identify whether the market is trending, ranging, volatile, or transitioning between states, enabling them to adapt their trading strategies to current market conditions.
Unlike basic trend indicators that simply show up or down, this system classifies markets into distinct regimes (Trend Bull, Trend Bear, Volatile Bull, Volatile Bear, High Vol Range, Low Vol Range, Flat) and provides confidence metrics, regime strength scores, multi-timeframe alignment analysis, and transition warnings. The indicator is designed for traders who understand that different market conditions require different trading approaches and that regime identification is critical for consistent profitability.
Why This Indicator Exists
This indicator addresses a fundamental challenge in trading: adapting strategy to market conditions. A trend-following strategy that works in trending markets fails in ranging markets. A mean-reversion strategy that works in ranging markets fails in trending markets. By systematically classifying market regimes, this indicator enables traders to:
Identify Current Regime: Classify market as trending, ranging, volatile, or flat with quantitative metrics
Measure Regime Strength: Score regime quality (0-100%) based on trend clarity, volatility consistency, impulse confirmation, and duration
Detect Regime Transitions: Warn when market is likely changing character before it becomes obvious
Analyze Multi-Timeframe Alignment: Confirm regime across 10 timeframes (1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, Daily, Weekly)
Calculate Regime Confidence: Provide confidence score combining regime strength, MTF alignment, and transition probability
Integrate Dynamic Stops: Use Chandelier Exit for adaptive stop-loss placement based on volatility
Each component provides different regime intelligence. Range filtering shows directional movement, trend strength shows conviction, volatility ratio shows market character, impulse detection shows momentum, MTF alignment shows multi-timeframe conviction, and Chandelier Exit provides dynamic risk management. Together, they create a comprehensive regime classification system.
Core Components Explained
1. Smooth Range Filter (from RealGains Algorithm)
The range filter uses a sophisticated smoothing algorithm to identify directional movement:
// Smooth range calculation
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
smoothrng = ta.ema(avrng, wper) * m
// Range filter
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt ) ? x - r < nz(rngfilt ) ? nz(rngfilt ) : x - r :
x + r > nz(rngfilt ) ? nz(rngfilt ) : x + r
The filter creates upper and lower bands based on smoothed range. When price breaks above the filter, it signals upward movement. When price breaks below, it signals downward movement. The filter adapts to volatility, widening in volatile conditions and tightening in calm conditions.
Filter direction is tracked using consecutive bar counts:
upward = filt > filt ? nz(upward ) + 1 : 0
downward = filt < filt ? nz(downward ) + 1 : 0
Longer consecutive counts indicate stronger directional conviction.
2. Impulse Detection (SMMA and ZLEMA)
The indicator uses Smoothed Moving Average (SMMA) and Zero-Lag EMA (ZLEMA) to detect impulse moves:
// SMMA calculation
calc_smma(src, len) =>
var float smma = na
smma := na(smma) ? ta.sma(src, len) : (smma * (len - 1) + src) / len
// ZLEMA calculation
calc_zlema(src, len) =>
ema1 = ta.ema(src, len)
ema2 = ta.ema(ema1, len)
d = ema1 - ema2
ema1 + d
// Impulse detection
hi = calc_smma(high, 34)
lo = calc_smma(low, 34)
mi = calc_zlema(hlc3, 34)
md = mi > hi ? mi - hi : mi < lo ? mi - lo : 0
is_impulse = md != 0
When impulse is detected, the market has momentum. When impulse is absent (flat), the market lacks directional conviction. This helps filter out choppy, directionless periods.
3. Trend Strength Calculation (ADX-based)
The indicator calculates trend strength using Directional Movement Index (DMI) and Average Directional Index (ADX):
calcTrendStrength(int length) =>
float plusDM = high - high > low - low ? math.max(high - high , 0) : 0
float minusDM = low - low > high - high ? math.max(low - low, 0) : 0
float plusDI = atr > 0 ? ta.sma(plusDM, length) / atr * 100 : 0
float minusDI = atr > 0 ? ta.sma(minusDM, length) / atr * 100 : 0
float dx = math.abs(plusDI - minusDI) / (plusDI + minusDI) * 100
float adx = ta.sma(dx, length)
float trendStrength = adx / 100
bool bullish = plusDI > minusDI
Trend strength ranges from 0 (no trend) to 1 (strong trend). The threshold (default: 0.6) determines when a market is classified as trending vs ranging.
4. Volatility Regime Classification
Volatility regime is determined by comparing current ATR to average ATR:
calcVolatilityRegime(int length) =>
float atr = ta.atr(length)
float atrMA = ta.sma(atr, length)
float volRatio = atrMA > 0 ? atr / atrMA : 1.0
Volatility ratio interpretation:
volRatio > 1.5: High volatility (default threshold)
volRatio 0.67-1.5: Normal volatility
volRatio < 0.67: Low volatility
High volatility regimes require wider stops and larger profit targets. Low volatility regimes allow tighter stops and smaller targets.
5. Regime Classification Logic
The indicator combines trend strength, volatility ratio, and impulse detection to classify regimes:
classifyRegime(float trendStr, bool isBullish, float volRatio, float threshold, float volThresh, bool impulse) =>
if not impulse and catchFlat
regime := "Flat"
else if trendStr >= threshold
if volRatio > volThresh
regime := isBullish ? "Volatile Bull" : "Volatile Bear"
else
regime := isBullish ? "Trend Bull" : "Trend Bear"
else
if volRatio > volThresh
regime := "High Vol Range"
else
regime := "Low Vol Range"
Regime classifications:
Trend Bull: Strong uptrend with normal volatility - trend-following strategies
Trend Bear: Strong downtrend with normal volatility - trend-following strategies
Volatile Bull: Uptrend with high volatility - wider stops, larger targets
Volatile Bear: Downtrend with high volatility - wider stops, larger targets
High Vol Range: No clear trend with high volatility - avoid or use wide ranges
Low Vol Range: No clear trend with low volatility - mean-reversion strategies
Flat: No impulse detected - avoid trading
6. Regime Strength Scoring (0-100%)
Regime strength is calculated using four components:
calcRegimeStrength(float trendStr, float volRatio, bool impulse, int barsInRegime) =>
// Component 1: Trend clarity (40 points)
float trendScore = trendStr * 40
// Component 2: Volatility consistency (20 points)
float volScore = volRatio < volThreshold ? 20 : math.max(0, 20 - (volRatio - volThreshold) * 10)
// Component 3: Impulse confirmation (20 points)
float impulseScore = impulse ? 20 : 0
// Component 4: Regime duration (20 points)
float durationScore = math.min(barsInRegime / 50.0, 1.0) * 20
float totalScore = trendScore + volScore + impulseScore + durationScore
Regime strength interpretation:
> 70%: Excellent regime - high confidence trades
40-70%: Good regime - moderate confidence trades
< 40%: Weak regime - low confidence or avoid
7. Regime Transition Detection
The indicator warns when regime is likely changing:
detectRegimeTransition(float trendStr, float volRatio, bool impulse) =>
bool weakTrend = trendStr < trendThreshold * 0.8
bool volSpike = volRatio > volThreshold * 1.5
bool lostImpulse = not impulse and catchFlat
float transitionProb = 0.0
if weakTrend
transitionProb += 40
if volSpike
transitionProb += 30
if lostImpulse
transitionProb += 30
bool inTransition = transitionProb >= 50
Transition warnings help traders exit positions before regime changes become obvious in price.
8. Multi-Timeframe Alignment (10 Timeframes)
The indicator analyzes regime across 10 timeframes:
= request.security(syminfo.tickerid, '1', get_trend_status())
= request.security(syminfo.tickerid, '3', get_trend_status())
= request.security(syminfo.tickerid, '5', get_trend_status())
= request.security(syminfo.tickerid, '15', get_trend_status())
= request.security(syminfo.tickerid, '30', get_trend_status())
= request.security(syminfo.tickerid, '60', get_trend_status())
= request.security(syminfo.tickerid, '120', get_trend_status())
= request.security(syminfo.tickerid, '240', get_trend_status())
= request.security(syminfo.tickerid, 'D', get_trend_status())
= request.security(syminfo.tickerid, 'W', get_trend_status())
MTF alignment score is calculated with weighted timeframes (higher timeframes have more weight):
calcMTFAlignment(string t1m, string t5m, string t15m, string t1h, string t4h, string tD) =>
int bullCount = 0
int bearCount = 0
// Count each timeframe with weights
// 1m, 5m, 15m: weight 1
// 1h: weight 2
// 4h: weight 3
// Daily: weight 4
float alignmentScore = (bullCount - bearCount) / totalCount * 100
Alignment interpretation:
> 60: Strong Bull alignment
30-60: Moderate Bull alignment
-30 to 30: Mixed alignment
-60 to -30: Moderate Bear alignment
< -60: Strong Bear alignment
9. Regime Confidence Calculation
Overall confidence combines regime strength, MTF alignment, and transition status:
calcRegimeConfidence(float regimeStrength, float alignmentScore, bool inTransition) =>
float confidence = regimeStrength
// Adjust for alignment
float alignmentBonus = math.abs(alignmentScore) / 100 * 20
confidence += alignmentBonus
// Penalize if in transition
if inTransition
confidence *= 0.5
confidence := math.min(confidence, 100)
Confidence > 70% indicates high-quality regime suitable for aggressive trading. Confidence < 40% suggests caution or avoiding trades.
10. Chandelier Exit Integration
The indicator includes Chandelier Exit for dynamic stop-loss placement:
atrCE = ceMult * ta.atr(ceLength)
longStop = (ceUseClose ? ta.highest(close, ceLength) : ta.highest(ceLength)) - atrCE
shortStop = (ceUseClose ? ta.lowest(close, ceLength) : ta.lowest(ceLength)) + atrCE
Chandelier Exit adapts to volatility, providing wider stops in volatile regimes and tighter stops in calm regimes. The stops trail price, locking in profits as trends develop.
Visual Elements
Range Filter Line: Main line showing directional filter with color-coded regime (green = bull, red = bear, cyan = neutral)
Target Bands: Upper and lower bands showing filter range with gradient fills
Regime Strength Zones: Gradient fills showing regime strength intensity
Volatility Expansion Zones: Circles marking high volatility periods
Chandelier Exit Lines: Dynamic stop-loss lines (green for long stops, red for short stops)
Regime Value Histogram: Histogram showing regime direction and strength (-3 to +3)
Regime Background: Subtle background coloring based on current regime
Regime Change Markers: Circles marking regime transitions
Transition Warnings: X-crosses marking potential regime changes
Regime Signals: Triangle markers for strong bull/bear regime confirmations
MTF Table: Comprehensive table showing all 10 timeframes with trend status
Statistics Panel: Additional metrics including regime strength, duration, alignment, confidence, and transition status
Input Parameters
Range Filter Settings:
Sampling Period: Period for range calculation (default: 100, range: 1+)
Range Multiplier: Multiplier for range width (default: 3.0, range: 0.1+)
Regime Detection:
Trend Threshold: Minimum trend strength for trending classification (default: 0.6, range: 0.3-0.9)
Volatility Threshold: Multiplier for high volatility classification (default: 1.5, range: 1.0-3.0)
Regime Strength Period: Period for strength calculations (default: 20, range: 5-100)
Show Regime Signals: Toggle regime confirmation markers (default: enabled)
Chandelier Exit:
Chandelier ATR Period: Period for ATR calculation (default: 22, range: 1+)
Chandelier ATR Multiplier: Multiplier for stop distance (default: 3.0, range: 0.1+)
Use Close for Extremums: Use close vs high/low for calculations (default: enabled)
Impulse Detection:
Try to Catch Flat: Enable flat regime detection (default: enabled)
Multi-Timeframe Table:
Show MTF Table: Toggle timeframe table (default: enabled)
Table Position: Dashboard location (Top Right/Top Left/Bottom Right/Bottom Left/Middle Right)
Show Regime Statistics: Toggle additional statistics panel (default: enabled)
Colors:
All colors are fully customizable including trend bull/bear, mid trend, range, high volatility, text, transition, and excellent regime colors.
How to Use This Indicator
Step 1: Identify Current Regime
Check the regime classification (Trend Bull, Trend Bear, Volatile Bull, Volatile Bear, High Vol Range, Low Vol Range, Flat). This determines your trading approach.
Step 2: Check Regime Strength
Look at regime strength percentage. > 70% indicates high-quality regime suitable for aggressive trading. < 40% suggests caution.
Step 3: Verify MTF Alignment
Check the MTF table. Strong alignment (> 60) across multiple timeframes confirms regime conviction. Mixed alignment suggests caution.
Step 4: Monitor Regime Confidence
Overall confidence score combines strength, alignment, and transition status. > 70% confidence indicates high-quality trading conditions.
Step 5: Watch for Transition Warnings
X-cross markers warn of potential regime changes. Consider tightening stops or exiting positions when transition probability is high.
Step 6: Use Chandelier Exit for Stops
The Chandelier Exit lines provide dynamic stop-loss levels that adapt to volatility. Trail stops as trends develop.
Step 7: Adapt Strategy to Regime
Trend Bull/Bear: Use trend-following strategies, ride trends, trail stops
Volatile Bull/Bear: Use wider stops, larger targets, reduce position size
High Vol Range: Avoid or use very wide ranges
Low Vol Range: Use mean-reversion strategies, fade extremes
Flat: Avoid trading, wait for impulse to return
Best Practices
Use on 15-minute to 4-hour timeframes for optimal regime clarity
Trade with the regime, not against it - trend-following in trending regimes, mean-reversion in ranging regimes
Higher regime strength = higher confidence = larger position sizes
MTF alignment is critical - don't trade against higher timeframe regimes
Transition warnings are early signals - tighten stops or exit before regime change becomes obvious
Chandelier Exit provides objective stop-loss levels - use them
Regime duration matters - longer regimes are more reliable
Confidence > 70% = aggressive trading, confidence < 40% = defensive or avoid
Flat regimes lack directional conviction - patience is key
Volatile regimes require wider stops and larger targets - adjust risk accordingly
Indicator Limitations
Regime classification is based on recent data - sudden news events can invalidate regimes instantly
Transition warnings are probabilistic, not guaranteed - regimes can persist longer than expected
MTF alignment requires sufficient data on all timeframes - may not work on newly listed instruments
Range filter is adaptive but can lag during rapid regime changes
Impulse detection can produce false flat signals during consolidation within trends
Regime strength scoring is relative to recent history - not absolute
Chandelier Exit can be stopped out during volatile whipsaws
The indicator identifies regimes but doesn't predict when they will end
Works best on liquid instruments with clear trending and ranging periods
Regime confidence is a guide, not a guarantee - high confidence regimes can still fail
Technical Implementation
Built with Pine Script v6 using:
Smooth range filter with adaptive volatility adjustment
SMMA and ZLEMA calculations for impulse detection
ADX-based trend strength calculations
ATR-based volatility regime classification
Multi-component regime strength scoring
Transition probability calculations
Multi-timeframe security requests (10 timeframes)
Weighted MTF alignment scoring
Regime confidence calculations
Chandelier Exit with trailing stops
Dynamic table with 17 rows showing all timeframes and statistics
Gradient fills and color-coded visualizations
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 regime classification approach. While individual components (range filter, ADX, Chandelier Exit) are established concepts, this indicator is justified because:
It synthesizes six distinct regime analysis methodologies into a unified classification system
Regime strength scoring combines trend clarity, volatility consistency, impulse confirmation, and duration
Transition detection provides early warnings before regime changes become obvious
MTF alignment analysis across 10 timeframes with weighted scoring
Regime confidence calculation integrates strength, alignment, and transition probability
Integration of Chandelier Exit provides regime-adaptive risk management
Comprehensive statistics panel shows regime quality metrics in real-time
Visual regime signals help traders identify high-quality trading conditions
Each component contributes unique regime intelligence: range filter shows direction, trend strength shows conviction, volatility ratio shows character, impulse shows momentum, MTF alignment shows multi-timeframe conviction, transition detection shows regime changes, and Chandelier Exit provides adaptive stops. The indicator's value lies in presenting these complementary perspectives simultaneously with quantitative regime classification and confidence scoring.
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.
Regime classification is a tool for understanding market conditions, not a crystal ball for predicting future price movement. High regime strength, strong MTF alignment, and high confidence scores do not guarantee profitable trades. Past regime patterns do not guarantee future regime patterns. Market conditions change, and strategies that worked historically may not work in the future.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. Transition warnings are probabilistic, not guaranteed. Chandelier Exit stops can be hit during volatile whipsaws. 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

Institutional Structure Intelligence Engine [JOAT]Institutional Structure Intelligence Engine
Introduction
The Institutional Structure Intelligence Engine is an advanced open-source market structure indicator that combines swing detection, order block analysis, fair value gap (FVG) identification, institutional level tracking, and velocity analysis into a comprehensive structural intelligence system. This indicator helps traders identify where institutional orders are positioned, where price inefficiencies exist, and how market structure is evolving in real-time.
Unlike basic support/resistance indicators that draw static lines, this engine dynamically tracks institutional footprints through order blocks (zones where institutions accumulated or distributed), fair value gaps (price inefficiencies that often get filled), breaker blocks (failed order blocks signaling reversals), and multi-timeframe institutional levels. The indicator is designed for traders who understand that market structure reveals institutional intent and that price gravitates toward areas of institutional interest.
Why This Indicator Exists
This indicator addresses the challenge of identifying institutional positioning in real-time. Institutional traders leave structural footprints that can be detected through systematic analysis. By combining multiple structural methodologies, this indicator reveals:
Order Block Detection: Identifies zones where institutions accumulated or distributed positions before major moves
Fair Value Gaps: Detects price inefficiencies where rapid institutional movement left unfilled gaps
Breaker Blocks: Tracks failed order blocks that signal potential trend reversals
Institutional Levels: Monitors Weekly/Daily highs and lows, Premium/Discount zones, and Golden Zone (0.618-0.5 Fibonacci)
Structure Velocity: Measures how quickly market structure is forming to identify momentum shifts
Compression Zones: Detects periods of range compression that often precede explosive moves
Each component provides a different structural perspective. Order blocks show where institutions positioned, FVGs show where price moved inefficiently, breaker blocks show where structure failed, institutional levels show key reference points, velocity shows momentum, and compression zones show coiling energy. Together, they create a comprehensive structural intelligence system.
Below showing the Main Features and how it works:
Core Components Explained
1. Advanced Order Block Detection
Order blocks are identified using strict volume and price action criteria:
Bullish Order Block:
// Two consecutive down candles followed by strong up move
if close < open and close < open and close > open and
volume > avgVolume * obVolumeThreshold and
close > high and
(high - low ) <= atr * maxATRMult and
(close - open) > atr * 0.5
Bearish Order Block:
// Two consecutive up candles followed by strong down move
if close > open and close > open and close < open and
volume > avgVolume * obVolumeThreshold and
close < low and
(high - low ) <= atr * maxATRMult and
(open - close) > atr * 0.5
Order blocks represent the last opposite-direction move before a strong impulse. The logic: institutions accumulate/distribute in the opposite direction before pushing price in their intended direction. The indicator tracks:
Order block volume (total volume during formation)
Number of touches (how many times price returned to the zone)
Zone strength (calculated from volume, touches, and age)
Breaker status (whether the order block was invalidated)
Overlapping Order Block Combination:
When multiple order blocks overlap, the indicator combines them into a single stronger zone:
if doOBsOverlap(ob1, ob2)
ob1.top := math.max(ob1.top, ob2.top)
ob1.bottom := math.min(ob1.bottom, ob2.bottom)
ob1.obVolume += ob2.obVolume
ob1.touches += ob2.touches
ob1.strength := math.max(ob1.strength, ob2.strength)
This prevents chart clutter and highlights the most significant institutional zones.
2. Breaker Block Detection
Breaker blocks are order blocks that failed - price broke through them instead of bouncing. This signals potential trend reversal:
// Bullish OB becomes breaker if price breaks below
if low < ob.bottom
ob.breaker := true
ob.breakTime := time
// Bearish OB becomes breaker if price breaks above
if high > ob.top
ob.breaker := true
ob.breakTime := time
Breaker blocks are displayed with distinct colors (cyan for bullish breakers, orange for bearish breakers) to differentiate them from active order blocks. When an order block becomes a breaker, it often signals that institutional positioning has changed and the previous structure is no longer valid.
3. Fair Value Gap (FVG) Detection
FVGs are identified using strict gap and volume criteria:
Bullish FVG:
// Gap between 2 bars ago high and current low
bool bullishFVGDetected = low > high and
(low - high ) > atr * 0.3 and // Minimum gap size
volume > avgVolume * 0.8 // Volume confirmation
Bearish FVG:
// Gap between 2 bars ago low and current high
bool bearishFVGDetected = high < low and
(low - high) > atr * 0.3 and // Minimum gap size
volume > avgVolume * 0.8 // Volume confirmation
FVGs represent price inefficiencies where institutional orders moved price so quickly that normal auction process was bypassed. These gaps often get "filled" as price returns to establish fair value. The indicator tracks:
FVG top and bottom prices
Mitigation status (whether the gap has been filled)
Mitigation bar (when the gap was filled)
Only non-mitigated FVGs are displayed to keep charts clean. Maximum FVG count is customizable (default: 3) to prevent clutter.
Showing Order Block, Breaker Block, and All Combined OB's that occured:
4. Institutional Level Tracking
The indicator monitors key institutional reference levels:
Weekly High/Low:
float lastWeekHigh = request.security(syminfo.tickerid, "W", high )
float lastWeekLow = request.security(syminfo.tickerid, "W", low )
Daily High/Low:
float yesterdayHigh = request.security(syminfo.tickerid, "D", high )
float yesterdayLow = request.security(syminfo.tickerid, "D", low )
Premium/Discount Zones:
Based on weekly range:
Premium Zone: 70%-100% of weekly range (institutional selling zone)
Discount Zone: 0%-30% of weekly range (institutional buying zone)
Golden Zone: 50%-61.8% of weekly range (optimal entry zone)
float weekRange = lastWeekHigh - lastWeekLow
float premiumTop = lastWeekHigh
float premiumBot = lastWeekLow + (weekRange * 0.7)
float discountTop = lastWeekLow + (weekRange * 0.3)
float discountBot = lastWeekLow
float goldenTop = lastWeekLow + (weekRange * 0.618)
float goldenBot = lastWeekLow + (weekRange * 0.5)
These zones help traders identify where institutions are likely to buy (discount) or sell (premium), with the golden zone representing optimal risk:reward entries.
Breaker Block with VOL, Discount zone touched for signal, Market Phase + Quality of chart score:
5. Structure Velocity Analysis
The indicator measures how quickly market structure is forming:
// Price velocity
priceVelocity = ta.change(close, velocityLength) / velocityLength
velocityMA = ta.sma(math.abs(priceVelocity), velocityLength)
velocityScore = velocityMA > 0 ? math.abs(priceVelocity) / velocityMA : 0
// Volume momentum
volumeMomentum = volume / avgVolume
volumeAcceleration = ta.change(volumeMomentum, 5)
// Structure velocity (how fast structure is forming)
structureVelocity = (bar_index - lastSwingHighBar) + (bar_index - lastSwingLowBar)
High velocity indicates rapid structure formation (trending market), low velocity indicates slow structure formation (ranging market). Velocity analysis helps traders identify momentum shifts before they become obvious in price.
6. Compression to Expansion Detection
The indicator detects periods of range compression using strict criteria:
float rangeMA = ta.sma(high - low, 50)
float currentRange = high - low
bool compressed = currentRange < rangeMA * 0.3 and volume < avgVolume * 0.8
bool expanding = currentRange > rangeMA * 2.0 and volume > avgVolume * 1.3
Compression zones are only displayed if:
Compression lasted at least 10 bars
Range is less than 1.5x ATR (truly tight)
This prevents false compression signals and highlights only significant coiling periods that often precede explosive moves.
7. Swing Point Detection
The indicator uses pivot-based swing detection:
pivotHigh = ta.pivothigh(high, swingLength, swingLength)
pivotLow = ta.pivotlow(low, swingLength, swingLength)
Swing points are stored in arrays and used for:
Structure line drawing
Break of Structure (BOS) detection
Change of Character (CHOCH) detection
Trend determination
Swing length is customizable (default: 10) to adjust sensitivity.
Visual Elements
Order Block Boxes: Filled boxes showing bullish (green) and bearish (red) order blocks with volume and touch count
Breaker Block Boxes: Distinct colored boxes (cyan/orange) showing failed order blocks
FVG Boxes: Transparent boxes showing bullish (green) and bearish (red) fair value gaps
Institutional Lines: Weekly high/low (purple), Daily high/low (yellow)
Premium/Discount Fills: Shaded zones showing premium (red), discount (green), and golden (orange) zones
Compression Boxes: Purple boxes showing range compression periods
Swing Points: Triangle markers showing swing highs (red) and swing lows (green)
All visual elements use "locked" boxes that don't extend indefinitely, preventing chart clutter. Overlap prevention logic ensures boxes don't stack on top of each other.
Input Parameters
Structure Detection:
Swing Length: Period for pivot detection (default: 10, range: 3-50)
Show Swing Points: Toggle swing markers (default: enabled)
Show Structure Lines: Toggle structure lines (default: enabled)
Show Compression Zones: Toggle compression boxes (default: disabled to reduce clutter)
Order Blocks:
Show Order Blocks: Toggle order block boxes (default: enabled)
Combine Overlapping OBs: Merge overlapping order blocks (default: enabled)
Show Breaker Blocks: Toggle breaker block display (default: enabled)
Volume Threshold: Minimum volume multiplier for OB detection (default: 1.5)
Max Order Blocks: Maximum OBs to display (default: 3, range: 1-10)
Max ATR Multiplier: Maximum OB size relative to ATR (default: 2.5)
Market Structure:
Show Break of Structure: Toggle BOS markers (default: disabled to reduce clutter)
Show Change of Character: Toggle CHOCH markers (default: enabled)
Show Fair Value Gaps: Toggle FVG boxes (default: enabled)
Show FVG Mitigation: Track when FVGs are filled (default: enabled)
Max FVGs to Display: Maximum FVGs to show (default: 3, range: 1-10)
Institutional Levels:
Show Weekly High/Low: Toggle weekly levels (default: enabled)
Show Daily High/Low: Toggle daily levels (default: enabled)
Show Golden Zone: Toggle 0.618-0.5 Fib zone (default: enabled)
Show Premium/Discount Zones: Toggle institutional zones (default: enabled)
Velocity Analysis:
Show Structure Velocity: Toggle velocity calculations (default: enabled)
Velocity Period: Period for velocity analysis (default: 20, range: 5-50)
Display:
Table Position: Dashboard location (Top Right/Top Left/Bottom Right/Bottom Left)
Show Structure Quality Score: Toggle quality metrics (default: enabled)
Colors:
All colors are fully customizable including bullish/bearish structure, order blocks, breaker blocks, FVGs, weekly/daily levels, golden zone, premium/discount zones, and compression zones.
4HR TF BTCUSDT showing the zones being used in action and price movement:
How to Use This Indicator
Step 1: Identify Key Institutional Zones
Look for order blocks with high touch counts and strong volume. These represent areas where institutions are likely to defend their positions.
Step 2: Monitor Fair Value Gaps
FVGs often get filled as price returns to establish fair value. Look for entries when price approaches unfilled FVGs, especially if they align with order blocks.
Step 3: Watch for Breaker Blocks
When an order block becomes a breaker, it signals that institutional positioning has changed. This often marks trend reversals or significant structure shifts.
Step 4: Use Premium/Discount Zones
Look for long entries in discount zones (0-30% of range) and short entries in premium zones (70-100% of range). The golden zone (50-61.8%) offers optimal risk:reward.
Step 5: Check Institutional Levels
Weekly and daily highs/lows act as magnets for price. Breaks above/below these levels often lead to significant moves.
Step 6: Monitor Structure Velocity
High velocity indicates trending conditions (follow the trend), low velocity indicates ranging conditions (fade extremes).
Step 7: Wait for Compression Breakouts
Compression zones mark periods of coiling energy. Breakouts from compression often lead to explosive moves with strong follow-through.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal structure clarity
Combine order blocks with FVGs for high-probability entries
Wait for price to return to order blocks before entering - don't chase
Breaker blocks often become new support/resistance in opposite direction
Premium/discount zones work best in trending markets
Golden zone entries offer best risk:reward when combined with order blocks
Compression zones require patience - wait for confirmed breakout
Structure velocity helps determine whether to trade with trend or fade extremes
Multiple touches on an order block increase its significance
FVG fills often provide excellent entry opportunities with tight stops
Indicator Limitations
Order blocks don't always hold - institutions can change positioning
FVGs don't always get filled - some gaps persist indefinitely
Breaker blocks can fail - price can return above/below breaker zones
Premium/discount zones are relative to recent range - not absolute levels
Compression detection requires sufficient bars - may not work on new instruments
Structure velocity is a lagging indicator - confirms moves after they start
Maximum box/line limits (500 each) can be reached on lower timeframes with long history
Overlap prevention may hide some valid order blocks to prevent clutter
The indicator shows structure, not direction - requires trader interpretation
Works best on liquid instruments with clear institutional participation
Technical Implementation
Built with Pine Script v6 using:
Custom type definitions for OrderBlockInfo and FVGInfo
Array-based storage for order blocks, FVGs, and swing points
Strict volume and ATR-based filtering for accuracy
Overlap detection and combination logic for order blocks
Breaker block tracking with time-based invalidation
FVG mitigation detection
Multi-timeframe security requests for institutional levels
Fibonacci-based premium/discount zone calculations
Velocity and momentum analysis
Compression detection with strict criteria
Dynamic box and label management with anti-overlap logic
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. While individual components (order blocks, FVGs, institutional levels) are established concepts, this indicator is justified because:
It combines seven distinct structural methodologies into a unified intelligence system
Order block detection uses strict multi-criteria filtering (volume, ATR, price action) for accuracy
Automatic order block combination prevents clutter while highlighting strongest zones
Breaker block tracking provides reversal signals not available in basic order block indicators
FVG detection includes mitigation tracking and strict size/volume filtering
Premium/discount zones integrate Fibonacci analysis with institutional levels
Structure velocity analysis provides momentum context for structural zones
Compression detection uses strict criteria to identify only significant coiling periods
Anti-overlap logic ensures clean charts without sacrificing information
Each component contributes unique structural intelligence: order blocks show institutional positioning, FVGs show inefficiencies, breaker blocks show failures, institutional levels show reference points, velocity shows momentum, and compression shows coiling energy. The indicator's value lies in presenting these complementary structural perspectives simultaneously with intelligent filtering and display management.
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 institutional positioning, not a crystal ball for predicting future price movement. Order blocks, FVGs, and institutional levels do not guarantee profitable trades. Past structural patterns do not guarantee future structural patterns. Market conditions change, and strategies that worked historically may not work in the future.
The zones and levels displayed are mathematical calculations based on current market data, not predictions of future price movement. High-quality order blocks, unfilled FVGs, and premium/discount zones do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Institutional Liquidity Flow Engine [JOAT]Institutional Liquidity Flow Engine
Introduction
The Institutional Liquidity Flow Engine is an advanced open-source volume analysis indicator that combines relative volume monitoring, buyer/seller strength analysis, multi-timeframe alignment detection, and comprehensive flow metrics into a unified institutional-grade tool. This indicator helps traders identify when institutional money is entering or exiting positions by analyzing volume patterns, pressure dynamics, and liquidity conditions across multiple timeframes.
Unlike basic volume indicators that simply show volume bars, this engine dissects volume into actionable intelligence: relative volume (RVOL) to identify unusual activity, buyer/seller strength ratios to determine who controls the market, accumulation/distribution trends to track smart money positioning, and multi-timeframe alignment to confirm directional conviction. The indicator is designed for traders who understand that volume precedes price and that institutional footprints can be detected through systematic volume analysis.
Why This Indicator Exists
This indicator addresses a critical gap in retail trading: the ability to detect institutional activity in real-time. Institutional traders move large positions that create detectable volume signatures. By combining multiple volume analysis methodologies, this indicator reveals:
Relative Volume Analysis: Identifies when volume is significantly above or below average, signaling potential institutional activity
Buyer/Seller Strength: Quantifies the balance of power between buyers and sellers using volume-weighted calculations
Multi-Timeframe Alignment: Confirms whether volume patterns align across 1m, 5m, 15m, 30m, 1h, 2h, 4h, Daily, and Weekly timeframes
Flow Metrics: Tracks Money Flow Index (MFI), On-Balance Volume (OBV), Accumulation/Distribution (A/D), and VWAP deviation
Liquidity Classification: Categorizes market conditions as Strong Buying, Strong Selling, Balanced, or Thin liquidity
Each component provides a different lens on volume behavior. RVOL shows intensity, buyer/seller strength shows direction, MTF alignment shows conviction, flow metrics show institutional positioning, and liquidity classification shows market conditions. Together, they create a comprehensive view of institutional activity.
Core Components Explained
1. Relative Volume (RVOL) Analysis
RVOL is calculated as current volume divided by the average volume over a specified period (default 20 bars):
avgVolume = ta.sma(volume, volumeLength)
relativeVolume = avgVolume > 0 ? volume / avgVolume : 1.0
The indicator classifies RVOL into five categories:
Extreme (RVOL >= 3.0): Institutional-level activity, potential climax moves
High (RVOL >= 1.5): Above-average activity, significant interest
Normal (RVOL >= 1.0): Average activity, typical market conditions
Low (RVOL >= 0.5): Below-average activity, reduced interest
Very Low (RVOL < 0.5): Minimal activity, thin liquidity
RVOL thresholds are customizable. Higher RVOL often precedes significant price moves as institutions accumulate or distribute positions.
2. Buyer/Seller Strength Analysis
The indicator calculates buyer and seller strength using volume-weighted analysis:
buyerVolume = close > open ? volume : 0
sellerVolume = close < open ? volume : 0
buyerStrength = ta.sma(buyerVolume, volumeLength)
sellerStrength = ta.sma(sellerVolume, volumeLength)
Strength ratios are calculated as percentages:
Buyer Ratio: (buyerStrength / totalStrength) * 100
Seller Ratio: (sellerStrength / totalStrength) * 100
When buyer ratio exceeds 70%, bullish pressure dominates. When seller ratio exceeds 70%, bearish pressure dominates. The indicator also integrates ATR-based strength calculations to filter for significant moves and RSI-based strength classification (Strong/Moderate/Weak) for additional context.
3. Multi-Timeframe Alignment
The indicator requests RVOL data from three customizable timeframes (default: 5m, 15m, 60m) and calculates alignment:
mtf1_bullish = rvol_mtf1 > 1.0 and vol_mtf1 > ta.sma(vol_mtf1, 20)
mtfAlignment = (mtf1_bullish ? 1 : 0) + (mtf2_bullish ? 1 : 0) + (mtf3_bullish ? 1 : 0)
Alignment status:
Strong Aligned (3/3): All timeframes show elevated volume - high conviction
Aligned (2/3): Majority timeframes show elevated volume - moderate conviction
Weak (1/3): Only one timeframe shows elevated volume - low conviction
No Alignment (0/3): No timeframes show elevated volume - no conviction
Strong alignment across multiple timeframes indicates institutional participation at scale, as large orders are often split across timeframes to minimize market impact.
4. Flow Metrics Suite
Money Flow Index (MFI):
Volume-weighted RSI that measures buying and selling pressure:
mfi = ta.mfi(close, volumeLength)
MFI > 80 indicates overbought conditions with high volume, MFI < 20 indicates oversold conditions with high volume.
On-Balance Volume (OBV):
Cumulative volume indicator that adds volume on up days and subtracts on down days:
obv = ta.cum(math.sign(ta.change(close)) * volume)
obvTrend = obv > obvMA ? "Bullish" : obv < obvMA ? "Bearish" : "Neutral"
OBV divergences from price often signal reversals.
Accumulation/Distribution (A/D):
Measures the cumulative flow of money into and out of a security:
ad = ta.cum(close == high and close == low or high == low ? 0 : ((2 * close - low - high) / (high - low)) * volume)
Rising A/D with rising price confirms uptrend, falling A/D with rising price signals distribution.
VWAP Deviation:
Measures how far price is from volume-weighted average price:
vwap = ta.vwap(close)
vwapDeviationPercent = vwap != 0 ? ((close - vwap) / vwap) * 100 : 0
Large deviations often mean-revert as institutions take advantage of inefficient pricing.
5. Volume Speed & Acceleration
The indicator calculates volume momentum and acceleration:
Volume ROC: Rate of change in volume over 5 periods
Volume Acceleration: Change in volume ROC (second derivative)
Volume Momentum: Current volume minus 10-period SMA
Volume Trend: Increasing or Decreasing based on EMA crossover
Accelerating volume often precedes breakouts or breakdowns as institutional orders hit the market.
6. Liquidity Classification System
The indicator classifies current liquidity conditions:
Strong Buying: High RVOL + positive net pressure (buyer strength > seller strength)
Strong Selling: High RVOL + negative net pressure (seller strength > buyer strength)
Balanced: Normal RVOL with relatively equal buyer/seller strength
Thin: Low RVOL indicating reduced liquidity and potential for slippage
Pressure intensity is calculated as:
pressureLevel = math.abs(netPressure) / avgVolume
pressureIntensity = pressureLevel >= 2.0 ? "Extreme" : pressureLevel >= 1.0 ? "High" : pressureLevel >= 0.5 ? "Moderate" : "Low"
Visual Elements
RVOL Histogram: Main plot showing relative volume with color-coded intensity (extreme = magenta, high = yellow, normal = green, low = gray)
Reference Lines: Horizontal lines at 1.0 (average), 1.5 (high threshold), and 3.0 (extreme threshold)
Buyer Pressure Fill: Background fill showing buyer pressure ratio (0-100%)
Volume Oscillator: Histogram overlay showing short-term vs long-term volume momentum
MFI Line: Thick line overlay showing Money Flow Index with gradient colors
Information Table: Comprehensive dashboard displaying all metrics in real-time
The table displays 15 metrics:
1. RVOL (current relative volume)
2. Status (Extreme/High/Normal/Low/Very Low)
3. Volume Trend (Increasing/Decreasing)
4. Pressure (Bullish/Bearish/Neutral)
5. Buyer Strength (percentage)
6. Seller Strength (percentage)
7. RSI (current value)
8. Liquidity (Strong Buying/Strong Selling/Balanced/Thin)
9. MTF Alignment (Strong Aligned/Aligned/Weak/No Alignment)
10. A/D Trend (Accumulation/Distribution/Neutral)
11. OBV Trend (Bullish/Bearish/Neutral)
12. MFI (current value)
13. VWAP Deviation (percentage)
14. Volume Momentum (percentage)
Input Parameters
Volume Analysis:
Volume MA Length: Period for volume moving average (default: 20)
High RVOL Threshold: Multiplier for high volume detection (default: 1.5)
Extreme RVOL Threshold: Multiplier for extreme volume detection (default: 3.0)
Multi-Timeframe Settings:
Show Multi-Timeframe Analysis: Toggle MTF calculations (default: enabled)
Timeframe 1/2/3: Customizable timeframes for alignment analysis (default: 5m, 15m, 60m)
Buyer/Seller Strength:
ATR Length: Period for ATR calculation (default: 14)
RSI Length: Period for RSI calculation (default: 14)
RSI Overbought/Oversold: Thresholds for RSI classification (default: 70/30)
Display Options:
Show Info Table: Toggle information dashboard (default: enabled)
Show Volume Histogram: Toggle RVOL histogram (default: enabled)
Show VWAP Deviation: Toggle VWAP calculations (default: enabled)
Table Position: Choose dashboard location (Top Right/Top Left/Bottom Right/Bottom Left)
Colors:
All colors are customizable including bullish, bearish, neutral, extreme volume, and high volume colors.
How to Use This Indicator
Step 1: Monitor RVOL for Unusual Activity
Watch for RVOL spikes above 1.5 (high) or 3.0 (extreme). These indicate institutional activity. Extreme RVOL often marks climax moves or major reversals.
Step 2: Check Buyer/Seller Strength
Identify who controls the market. Buyer ratio > 70% suggests bullish control, seller ratio > 70% suggests bearish control. Look for divergences where price moves one direction but strength moves another.
Step 3: Confirm with MTF Alignment
Strong alignment across multiple timeframes confirms institutional conviction. Weak or no alignment suggests retail-driven moves that may lack follow-through.
Step 4: Analyze Flow Metrics
Check MFI, OBV, and A/D for confirmation. Rising OBV with rising price confirms uptrend. Falling A/D with rising price warns of distribution.
Step 5: Assess Liquidity Conditions
Strong Buying or Strong Selling conditions with high RVOL often precede significant moves. Thin liquidity conditions increase risk of slippage and false moves.
Step 6: Look for Volume Acceleration
Accelerating volume momentum often precedes breakouts. Decelerating volume momentum often precedes consolidation or reversal.
Best Practices
Use on liquid instruments (major forex pairs, large-cap stocks, major crypto) for most reliable signals
Combine with price action analysis - volume shows intent, price shows result
Pay attention to RVOL spikes at key support/resistance levels
Look for volume divergences: price making new highs/lows without volume confirmation often fails
MTF alignment is most reliable on trending markets, less reliable in choppy conditions
Extreme RVOL can signal exhaustion - be cautious of chasing moves with RVOL > 5.0
Use VWAP deviation for mean reversion opportunities when price extends far from VWAP
Monitor A/D and OBV for early warning signs of trend changes
Indicator Limitations
Volume analysis works best on liquid instruments with consistent volume patterns
Low-volume instruments or off-market hours can produce unreliable RVOL readings
MTF alignment requires sufficient data on all timeframes - may not work on newly listed instruments
Volume precedes price but doesn't guarantee direction - high volume can occur on both breakouts and fakeouts
Buyer/seller strength calculations assume close > open = buying and close < open = selling, which is a simplification
RVOL thresholds may need adjustment for different instruments and market conditions
The indicator shows what is happening, not why - fundamental catalysts can override technical volume patterns
Extreme RVOL can persist longer than expected during major news events or market dislocations
Technical Implementation
Built with Pine Script v6 using:
Custom RVOL calculations with dynamic thresholds
Volume-weighted buyer/seller strength analysis
Multi-timeframe security requests with proper lookahead settings
Comprehensive flow metrics (MFI, OBV, A/D, VWAP)
Volume momentum and acceleration calculations
Real-time liquidity classification system
Dynamic table with 15 metrics and color-coded cells
Thick histogram and line plots for enhanced visibility
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 integration approach. While individual components (RVOL, MFI, OBV, A/D, buyer/seller strength) are established concepts, this indicator is justified because:
It synthesizes six distinct volume analysis methodologies into a unified system
The multi-timeframe alignment detection provides institutional conviction measurement not available in standard volume indicators
Buyer/seller strength calculations combine volume, ATR, and RSI for multi-dimensional pressure analysis
The liquidity classification system categorizes market conditions in real-time
Volume speed and acceleration metrics provide early warning of momentum shifts
The comprehensive dashboard presents 15 metrics simultaneously for holistic volume analysis
Integration of flow metrics (MFI, OBV, A/D, VWAP) with RVOL and strength analysis creates layered confirmation
Each component contributes unique information: RVOL shows intensity, buyer/seller strength shows direction, MTF alignment shows conviction, flow metrics show positioning, liquidity classification shows conditions, and volume acceleration shows momentum. The indicator's value lies in presenting these complementary perspectives simultaneously with a unified classification system.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Volume analysis is a tool for understanding market dynamics, not a crystal ball for predicting future price movement. High volume does not guarantee profitable trades. Past volume patterns do not guarantee future volume patterns. Market conditions change, and strategies that worked historically may not work in the future.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. High RVOL, strong buyer/seller ratios, and MTF alignment do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Thermal Momentum Gauge [JOAT]Thermal Momentum Gauge
Introduction
The Thermal Momentum Gauge is an open-source institutional-grade pressure and volatility monitoring system that combines market pressure measurement, volatility temperature analysis, volume steam detection, and multi-factor explosion identification into a unified oscillator. This sophisticated system integrates multiple proven momentum methodologies to identify high-probability explosive move conditions where pressure, temperature, and steam factors converge.
The indicator is designed for traders who understand that explosive market moves occur when multiple pressure systems align simultaneously. By synthesizing RSI pressure, WaveTrend momentum, Money Flow Index analysis, Stochastic pressure, ATR temperature, Bollinger Band width, volume steam detection, and confluence scoring, this tool helps identify structural market explosion points with thermal precision.
Why This Integration Exists
This indicator combines seven distinct pressure and volatility measurement frameworks that complement each other:
Multi-Component Pressure System: Combines RSI, WaveTrend, MFI, and Stochastic RSI for comprehensive pressure measurement
Thermal Temperature Analysis: Uses ATR and Bollinger Band width to measure market volatility temperature
Volume Steam Detection: Analyzes volume spikes and directional volume pressure for steam identification
Explosion Detection Engine: Multi-factor confluence system that identifies when all pressure systems align
Momentum Confirmation System: Ensures signals occur at genuine turning points through momentum analysis
Pressure Zone Classification: Defines thermal zones from extreme oversold to extreme overbought
Signal Filtering System: Prevents overlapping signals while maintaining precision timing
Each component addresses different aspects of market thermal dynamics. Pressure measurement reveals directional bias, temperature analysis shows volatility energy, steam detection indicates volume explosions, and confluence scoring quantifies setup quality. Together, they create a comprehensive thermal view that traditional single-dimension momentum indicators cannot provide.
Core Components Explained
1. Multi-Component Pressure System (0-100 Scale)
The system combines four pressure measurements for comprehensive analysis:
RSI Pressure:
RSI Pressure = RSI(close, rsi_length) // Standard 0-100 scale
WaveTrend Pressure:
ESA = ema(hlc3, wt_channel_length)
D = ema(abs(hlc3 - ESA), wt_channel_length)
CI = (hlc3 - ESA) / (0.015 * D)
WT1 = ema(CI, wt_average_length)
WT Pressure = (WT1 + 100) / 2 // Normalize -100 to 100 → 0 to 100
MFI Pressure:
MFI Pressure = MFI(hlc3, mfi_length) // Money Flow Index 0-100
Stochastic RSI Pressure (Optional):
Stochastic RSI = Stochastic(RSI(close, rsi_length), stoch_length)
Stoch Pressure = sma(Stochastic RSI, 3)
Combined Pressure:
Total Pressure = (RSI + WT + MFI + Stoch) / 4 // With Stochastic
Total Pressure = (RSI + WT + MFI) / 3 // Without Stochastic
2. Thermal Temperature System (0-100 Scale)
Measures market volatility energy through dual methods:
ATR-Based Temperature:
ATR Percentage = (ATR(atr_length) / close) * 100
ATR Temperature = ATR Percentage * temperature_multiplier
Bollinger Band Width Temperature (Optional):
BB Basis = sma(close, bb_length)
BB Deviation = bb_multiplier * stdev(close, bb_length)
BB Width = ((BB Upper - BB Lower) / BB Basis) * 100
BB Temperature = BB Width * 5 // Scale to 0-100
Combined Temperature:
Temperature = min((ATR Temperature + BB Temperature) / 2, 100) // With BB
Temperature = min(ATR Temperature, 100) // Without BB
3. Volume Steam Detection (0-100 Scale)
Analyzes volume explosions and directional pressure:
Volume Steam Base:
Volume Ratio = volume / sma(volume, volume_length)
Steam Base = Volume Ratio * 50
Volume Delta (Optional):
Buy Volume = close > open ? volume : 0
Sell Volume = close < open ? volume : 0
Volume Delta = (Buy Volume - Sell Volume) / volume * 50
Combined Steam:
Steam = min(Steam Base + abs(Volume Delta), 100)
Steam Classifications:
- Steam Burst: Steam > steam_threshold (default 80)
- Extreme Steam: Steam > 90
- Volume Spike Direction: Bullish (close > open) or Bearish (close < open)
4. Explosion Detection Engine
Multi-factor confluence system with momentum confirmation:
Momentum Confirmation:
Pressure Momentum = change(Total Pressure)
Pressure Acceleration = change(Pressure Momentum)
Momentum Shift = (momentum > 0 AND momentum <= 0) OR (momentum < 0 AND momentum >= 0)
Confluence Score (0-5):
Confluence Components:
- Pressure Factor: Total Pressure > pressure_threshold ? 1 : 0
- Temperature Factor: Temperature > temperature_threshold ? 1 : 0
- Steam Factor: Steam > steam_threshold ? 1 : 0
- WaveTrend Extreme: WT Pressure > 80 OR WT Pressure < 20 ? 1 : 0
- Extreme Steam: Steam > 90 ? 1 : 0
Confluence Score = Sum of all factors (0-5)
Explosion Conditions:
Explosion = Confluence Score >= minimum_confluence AND (Momentum Shift OR abs(Pressure Acceleration) > 2)
Bull Explosion = Explosion AND Total Pressure > 50 AND Pressure Momentum > 0
Bear Explosion = Explosion AND Total Pressure < 50 AND Pressure Momentum < 0
Perfect Explosion (Rare):
Perfect Explosion = Confluence Score == 5 AND abs(Pressure Momentum) > 3
Perfect Bull = Perfect Explosion AND Total Pressure > 50 AND Pressure Momentum > 0
Perfect Bear = Perfect Explosion AND Total Pressure < 50 AND Pressure Momentum < 0
5. Thermal Zone Classification
The system defines seven thermal pressure zones:
Extreme Overbought: Pressure > 80 (Critical thermal level)
Overbought: Pressure 70-80 (High thermal level)
Neutral High: Pressure 55-70 (Warm thermal level)
Equilibrium: Pressure 45-55 (Neutral thermal zone)
Neutral Low: Pressure 30-45 (Cool thermal level)
Oversold: Pressure 20-30 (Low thermal level)
Extreme Oversold: Pressure < 20 (Critical thermal level)
6. Signal Filtering System
Prevents overlapping signals while maintaining precision:
Minimum Bars Between Signals = 8
Signal Filtering Logic:
- Perfect signals take priority over regular explosions
- Regular explosions are filtered if perfect signal occurred recently
- Warning signals are filtered if explosion signals are active
- Steam bursts are filtered to minimum 3 bars apart
Visual Elements
Thermal Pressure Wave: Main oscillator with thermal gradient coloring and glow effects
Component Pressures: Individual RSI, WT, MFI, and Stochastic lines (hidden by default)
Temperature Background: Heat map style background coloring based on volatility temperature
Steam Burst Histograms: Volume spike visualization with directional coloring
Thermal Zone References: Critical levels at 20, 30, 50, 70, 80 with neutral zone highlighting
Explosion Markers: Diamond shapes for perfect explosions, triangles for regular explosions
Warning Signals: Circle markers for approaching explosion conditions
Pressure Meter: Visual gauge showing current pressure level with thermal gradient
Dashboard: Comprehensive real-time display of all thermal components and status
How Components Work Together
The integration creates a thermal momentum analysis approach:
Layer 1 - Pressure Measurement: Multi-component system reveals directional pressure across four dimensions
Layer 2 - Temperature Analysis: Volatility measurement shows market energy and expansion potential
Layer 3 - Steam Detection: Volume analysis identifies explosive energy release conditions
Layer 4 - Momentum Confirmation: Ensures signals occur at genuine turning points, not random noise
Layer 5 - Confluence Scoring: Quantifies setup quality by counting aligned factors
Layer 6 - Explosion Detection: Identifies rare moments when all thermal systems align
Layer 7 - Signal Filtering: Prevents overlap while maintaining precision timing
Example scenario: Pressure reaches extreme oversold (Layer 1) with high temperature (Layer 2), volume steam burst (Layer 3), momentum shift confirmation (Layer 4), confluence score of 5 (Layer 5), triggering perfect bull explosion (Layer 6) with proper signal filtering (Layer 7). This represents maximum thermal alignment for explosive upward move.
Input Parameters
Pressure Settings:
RSI Length: Period for RSI calculation (default: 14)
WT Channel Length: WaveTrend channel period (default: 10)
WT Average Length: WaveTrend smoothing period (default: 21)
MFI Length: Money Flow Index period (default: 14)
Stochastic Length: Stochastic RSI period (default: 14)
Use Stochastic Pressure: Toggle fourth pressure component
Temperature Settings:
ATR Length: Average True Range period (default: 14)
Temperature Multiplier: Sensitivity adjustment (default: 10.0)
Use Bollinger Band Width: Toggle BB width temperature component
BB Length: Bollinger Band period (default: 20)
BB Multiplier: Bollinger Band deviation (default: 2.0)
Volume Settings:
Volume MA Length: Volume average period (default: 20)
Steam Threshold: Volume spike multiplier (default: 2.0)
Use Volume Delta: Toggle directional volume analysis
Show Volume Spikes: Toggle volume spike visualization
Explosion Settings:
Pressure Threshold: Minimum pressure for explosion (default: 80)
Temperature Threshold: Minimum temperature for explosion (default: 70)
Steam Threshold: Minimum steam for explosion (default: 80)
Minimum Confluence Score: Required factors for explosion (default: 3)
Show Explosion Warnings: Toggle warning markers
How to Use This Indicator
Step 1: Assess Thermal Pressure
Check the main pressure gauge and current thermal zone classification in the dashboard.
Step 2: Monitor Temperature Levels
High temperature (>70) indicates market energy building for potential explosive moves.
Step 3: Watch for Steam Bursts
Volume steam bursts (>80) show explosive energy release with directional bias.
Step 4: Check Confluence Score
Scores ≥3 indicate multiple thermal factors aligning for explosion potential.
Step 5: Wait for Momentum Confirmation
Explosions require momentum shifts or acceleration to confirm genuine turning points.
Step 6: Identify Explosion Signals
Perfect explosions (diamond markers) offer highest probability, regular explosions (triangles) offer good probability.
Step 7: Monitor Warning Signals
Warning markers indicate approaching explosion conditions - prepare for potential signals.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal thermal detection
Focus on extreme thermal zones (<20 or >80) for highest explosion probability
Perfect explosions are rare but offer exceptional risk:reward opportunities
Temperature confirmation adds conviction to pressure-based signals
Steam direction (bullish/bearish) should align with expected explosion direction
Confluence scores ≥4 significantly increase explosion probability
Warning signals help prepare for upcoming explosion opportunities
Thermal zone transitions often precede significant price movements
Indicator Limitations
Thermal pressure can remain extreme longer than expected during strong trends
Perfect explosions are rare - patience required for highest probability setups
Temperature spikes during news events may create false explosion signals
Steam bursts don't guarantee immediate price movement - timing varies
Confluence scoring is mathematical, not predictive of future performance
Component pressures may conflict, requiring interpretation skills
Signal filtering may delay signals in rapidly changing market conditions
Requires understanding of multi-factor thermal analysis concepts
Technical Implementation
Built with Pine Script v6 using:
Multi-component pressure calculation with optional Stochastic RSI integration
Dual-method temperature analysis using ATR and Bollinger Band width
Advanced volume steam detection with directional bias measurement
Multi-factor confluence scoring system with momentum confirmation
Thermal gradient coloring system with glow effects and heat map backgrounds
Anti-overlap signal filtering with priority-based signal management
Real-time pressure meter visualization with thermal zone classification
Comprehensive dashboard with component breakdown and explosion status
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 thermal momentum integration approach. While individual components (RSI, WaveTrend, MFI, ATR, volume analysis) are established concepts, this integration is justified because:
It synthesizes seven distinct thermal and momentum methodologies into a unified system
The multi-component pressure system provides comprehensive momentum analysis beyond single indicators
Thermal temperature analysis combines volatility measurements for energy assessment
Volume steam detection adds explosive energy context to momentum signals
Multi-factor confluence scoring quantifies setup quality across all thermal dimensions
Perfect explosion detection identifies rare, high-probability explosive move conditions
Each component contributes unique thermal information: pressure measurement reveals directional momentum, temperature analysis shows volatility energy, steam detection indicates volume explosions, confluence scoring quantifies alignment, and momentum confirmation ensures signal quality. The integration's value lies in identifying moments when all thermal systems align simultaneously for explosive market moves.
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.
Thermal momentum analysis and explosion detection are analytical concepts that do not guarantee future price movement. Past performance and backtested results do not guarantee future results. Market conditions change, and thermal patterns that worked historically may not work in the future.
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

Prism Orderflow Detector [JOAT]Prism Orderflow Detector
Introduction
The Prism Orderflow Detector is an open-source institutional liquidity and order flow system that combines Smart Money Concepts (SMC), liquidity pool detection, Fair Value Gap analysis, Order Block identification, and advanced orderflow strength measurement into a unified overlay indicator. This comprehensive system integrates multiple proven institutional trading methodologies to identify high-probability zones where smart money positioning and retail liquidity intersect.
The indicator is designed for traders who understand that institutional players move markets by targeting liquidity pools, creating imbalances, and establishing positions through Order Blocks. By synthesizing liquidity detection, Fair Value Gaps, Order Blocks, Breaker Blocks, market structure analysis, and real-time orderflow strength measurement, this tool helps identify structural market inflection points with institutional-grade precision.
Why This Integration Exists
This indicator combines eight distinct institutional analysis frameworks that complement each other:
Liquidity Pool Detection: Identifies equal highs/lows and swing points where retail stops cluster
Order Block Analysis: Tracks institutional accumulation and distribution zones
Fair Value Gap Identification: Detects price inefficiencies created by rapid institutional moves
Breaker Block Recognition: Identifies failed Order Blocks that become new support/resistance
Market Structure Mapping: Tracks Break of Structure (BOS) and Change of Character (CHoCH)
Liquidity Heatmap Analysis: Visualizes liquidity concentration across price levels
Volume Delta Tracking: Measures real-time buying versus selling pressure
Orderflow Strength Measurement: Quantifies institutional pressure across multiple factors
Each component addresses different aspects of institutional order flow. Liquidity detection reveals where stops are hunted, Order Blocks show where institutions positioned, Fair Value Gaps indicate rapid institutional moves, market structure provides trend context, and orderflow strength quantifies current institutional pressure. Together, they create a comprehensive view of smart money activity and retail liquidity targeting.
Core Components Explained
1. Advanced Liquidity Detection System
The system identifies multiple types of liquidity pools:
Equal Highs (Buy-Side Liquidity):
Equal High Threshold = high * (threshold_percentage / 100)
Equal High Condition = (high == high ) OR (abs(high - high ) <= threshold AND high > high )
Valid Equal High = Equal High Condition AND high == highest(high, lookback_period)
Equal Lows (Sell-Side Liquidity):
Equal Low Threshold = low * (threshold_percentage / 100)
Equal Low Condition = (low == low ) OR (abs(low - low ) <= threshold AND low < low )
Valid Equal Low = Equal Low Condition AND low == lowest(low, lookback_period)
Liquidity Sweeps:
- Bullish Sweep: Price breaks below recent lows but closes back above
- Bearish Sweep: Price breaks above recent highs but closes back below
These sweeps often precede significant moves as institutions trigger retail stops before establishing positions.
2. Order Block Detection Engine
Order Blocks represent the last opposite-direction move before a strong impulse:
Bullish Order Block:
Bullish OB = close < open AND close > open AND
close > high AND (high - low ) > (ATR * strength_multiplier)
Bearish Order Block:
Bearish OB = close > open AND close < open AND
close < low AND (high - low ) > (ATR * strength_multiplier)
Order Blocks are displayed as gradient boxes with diagonal lines and extend forward to show ongoing relevance.
3. Fair Value Gap Analysis
Fair Value Gaps represent price inefficiencies where institutions moved price rapidly:
Bullish FVG:
Bullish FVG = low > high AND close > open
FVG Size = ((low - high ) / close) * 100
Valid Bullish FVG = Bullish FVG AND FVG Size >= minimum_size_percentage
Bearish FVG:
Bearish FVG = high < low AND close < open
FVG Size = ((low - high ) / close) * 100
Valid Bearish FVG = Bearish FVG AND FVG Size >= minimum_size_percentage
FVGs are displayed as horizontal lines with gradient fills and often get filled (retested) later.
4. Breaker Block System
Breaker Blocks are failed Order Blocks that become new support/resistance:
Bullish Breaker: Failed bearish Order Block that price breaks above
Bearish Breaker: Failed bullish Order Block that price breaks below
These represent significant shifts in market structure and often provide strong reversal zones.
5. Market Structure Analysis
Tracks institutional trend changes through structure breaks:
Break of Structure (BOS):
- Bullish BOS: New higher high with strong momentum
- Bearish BOS: New lower low with strong momentum
Change of Character (CHoCH):
- Bullish CHoCH: Lower low followed by higher high (trend change)
- Bearish CHoCH: Higher high followed by lower low (trend change)
6. Advanced Orderflow Features
Liquidity Heatmap:
Tracks liquidity concentration by counting touches at key levels over specified periods. High-intensity areas (>80% touch count) are highlighted as significant liquidity zones.
Volume Delta Analysis:
Buy Volume = close > open ? volume : 0
Sell Volume = close < open ? volume : 0
Volume Delta = sma(Buy Volume - Sell Volume, 14)
Volume Delta Normalized = (Volume Delta / sma(volume, 14)) * 100
Strong delta (>50) indicates institutional accumulation or distribution.
Imbalance Zone Detection:
Enhanced Fair Value Gap detection for larger inefficiencies:
Bullish Imbalance = low > high AND (low - high ) > (ATR * 0.5)
Bearish Imbalance = high < low AND (low - high) > (ATR * 0.5)
Premium/Discount Zones:
Price Range = highest(high, 50) - lowest(low, 50)
Equilibrium = lowest(low, 50) + (Price Range / 2)
Premium Zone = close > equilibrium + (Price Range * 0.25)
Discount Zone = close < equilibrium - (Price Range * 0.25)
7. Orderflow Strength Meter
Real-time quantification of institutional pressure:
Orderflow Strength = Order Block Factor + FVG Factor + Sweep Factor +
Volume Delta Factor + Structure Factor
Components:
- Order Block: ±20 points for new OBs
- FVG: ±15 points for valid FVGs
- Sweeps: ±25 points for liquidity sweeps
- Volume Delta: ±30 points (normalized)
- Structure: ±20 points for BOS/CHoCH
Strength classifications:
- Extreme Bull/Bear Pressure: >±60
- Strong Bull/Bear Pressure: >±30
Visual Elements
Liquidity Arrows: Directional arrows for equal highs/lows with clean labels
Liquidity Sweeps: Arrow lines showing sweep direction with "SWEEP" labels
Order Block Boxes: Gradient boxes with diagonal lines and "OB" labels
Fair Value Gap Lines: Horizontal lines with gradient fills and "FVG" labels
Breaker Diamonds: Diamond markers for failed Order Blocks with "BRK" labels
Structure Arrows: CHoCH arrows with directional labels
Imbalance Zones: Boxes with crossing diagonal lines and "IMB" labels
Liquidity Heatmap: Significant liquidity levels with "LIQ" labels
Volume Delta Markers: "Δ+" and "Δ-" labels for extreme volume pressure
Orderflow Background: Subtle background coloring for extreme pressure states
Dashboard: Comprehensive real-time status of all orderflow components
How Components Work Together
The integration creates a layered institutional analysis approach:
Layer 1 - Liquidity Mapping: Equal highs/lows and swing points reveal where retail stops cluster
Layer 2 - Institutional Positioning: Order Blocks show where smart money accumulated/distributed
Layer 3 - Price Inefficiencies: Fair Value Gaps indicate rapid institutional moves
Layer 4 - Structure Context: BOS/CHoCH provide trend and reversal context
Layer 5 - Failed Levels: Breaker Blocks show where previous levels failed
Layer 6 - Flow Analysis: Volume delta and heatmaps reveal current institutional pressure
Layer 7 - Strength Synthesis: Orderflow strength meter quantifies overall institutional activity
Example scenario: Price approaches equal lows (Layer 1) where a bullish Order Block exists (Layer 2), creating a Fair Value Gap on the move up (Layer 3), with bullish CHoCH confirming trend change (Layer 4), strong positive volume delta (Layer 6), and extreme bullish orderflow strength (Layer 7). This confluence suggests high-probability long opportunity.
Input Parameters
Liquidity Settings:
Show Equal Highs/Lows: Toggle liquidity pool display
Equal Price Threshold: Percentage tolerance for equal levels (default: 0.1%)
Liquidity Lookback: Period for liquidity level detection (default: 50)
Order Block Settings:
Show Order Blocks: Toggle Order Block display
Order Block Strength: ATR multiplier for OB validation (default: 3)
Extend Order Blocks: Forward extension bars (default: 20)
Fair Value Gap Settings:
Show Fair Value Gaps: Toggle FVG display
Min FVG Size: Minimum gap size percentage (default: 0.1%)
Breaker Block Settings:
Show Breaker Blocks: Toggle Breaker display
Breaker Lookback: Period for Breaker detection (default: 20)
Advanced Features:
Show Liquidity Heatmap: Toggle heatmap visualization
Show Volume Delta: Toggle volume pressure display
Show Imbalance Zones: Toggle imbalance detection
Show Premium/Discount Zones: Toggle equilibrium analysis
Show Orderflow Strength: Toggle strength background
Heatmap Period: Lookback for liquidity concentration (default: 100)
How to Use This Indicator
Step 1: Identify Market Structure
Check for recent BOS or CHoCH to understand current trend context and potential reversal zones.
Step 2: Map Liquidity Pools
Locate equal highs/lows and swing points where retail stops are likely clustered.
Step 3: Find Order Blocks
Identify recent Order Blocks where institutions likely positioned for the next move.
Step 4: Check for Fair Value Gaps
Look for unfilled FVGs that price may return to test, especially near Order Blocks.
Step 5: Monitor Liquidity Sweeps
Watch for sweep arrows indicating stop hunting - these often precede strong moves in the opposite direction.
Step 6: Analyze Volume Delta
Confirm institutional flow direction through volume delta analysis - strong delta supports directional bias.
Step 7: Review Orderflow Strength
Check dashboard for current orderflow strength - extreme readings indicate high institutional activity.
Step 8: Wait for Confluence
Best setups occur when multiple factors align: liquidity pools + Order Blocks + structure + volume confirmation.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal institutional detection
Focus on confluence zones where multiple SMC concepts align
Liquidity sweeps provide excellent risk:reward when they fail to sustain
Order Block retests often provide precise entry levels with tight stops
Fair Value Gaps act as magnets - price often returns to fill them
CHoCH signals are more significant than BOS for trend changes
Volume delta confirmation adds conviction to SMC setups
Premium/discount zones help time entries - buy discount, sell premium
Indicator Limitations
Not all liquidity pools get targeted - institutional timing varies
Order Blocks can fail if market structure changes significantly
Fair Value Gaps may never get filled during strong trending moves
Breaker Blocks don't always provide reliable support/resistance
Volume delta can be misleading in low-liquidity conditions
Orderflow strength is reactive, not predictive of future moves
SMC concepts require understanding of institutional behavior
Visual elements can clutter chart - adjust display settings as needed
Technical Implementation
Built with Pine Script v6 using:
Advanced liquidity detection with percentage-based thresholds
Real-time Order Block calculation with ATR-based validation
Dynamic Fair Value Gap identification with size filtering
Breaker Block tracking with lookback period management
Market structure analysis with BOS/CHoCH detection
Volume delta calculation with institutional bias measurement
Orderflow strength meter with multi-factor scoring
Anti-overlap filtering to prevent visual clutter
Comprehensive dashboard with real-time status updates
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 SMC integration approach. While individual components (Order Blocks, Fair Value Gaps, liquidity detection, volume analysis) are established Smart Money Concepts, this integration is justified because:
It synthesizes eight distinct SMC methodologies into a unified system
The orderflow strength meter quantifies institutional pressure across multiple factors
Advanced liquidity heatmap visualization shows concentration levels not available elsewhere
Integrated volume delta analysis provides real-time institutional flow confirmation
Premium/discount zone analysis adds equilibrium context to SMC setups
Anti-overlap filtering and clean visual design reduce chart clutter while maintaining functionality
Each component contributes unique institutional information: liquidity detection reveals stop hunting targets, Order Blocks show positioning zones, Fair Value Gaps indicate rapid moves, market structure provides context, and volume analysis confirms flow. The integration's value lies in presenting these complementary SMC perspectives simultaneously with quantified orderflow strength measurement.
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 and institutional analysis are educational frameworks that do not guarantee future price movement. Past performance and backtested results do not guarantee future results. Market conditions change, and SMC patterns that worked historically may not work in the future.
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

Polarity Divergence Scanner [JOAT]Polarity Divergence Scanner
Introduction
The Polarity Divergence Scanner is an open-source advanced market polarity detection system that measures bullish and bearish pressure across four distinct market dimensions: price action, volume flow, momentum dynamics, and volatility expansion. This sophisticated oscillator integrates multiple pressure measurement techniques to detect polarity shifts, divergences, and pressure extremes with visual heatmap representation.
The indicator is designed for traders who understand that market movements are driven by the constant battle between bullish and bearish forces across multiple dimensions. By synthesizing price polarity, volume polarity, momentum polarity, and volatility polarity into a composite index, this tool helps identify structural market turning points where pressure imbalances create high-probability reversal opportunities.
Why This Integration Exists
This indicator combines four distinct polarity measurement frameworks that complement each other:
Price Polarity Analysis: Measures directional pressure from pure price action using range-normalized calculations
Volume Polarity Tracking: Analyzes buying versus selling pressure through volume flow dynamics
Momentum Polarity Detection: Combines RSI and MACD analysis to measure acceleration-based pressure
Volatility Polarity Assessment: Tracks expansion versus contraction pressure through ATR analysis
Each component addresses different aspects of market pressure dynamics. Price polarity reveals directional bias, volume polarity shows institutional flow, momentum polarity indicates acceleration changes, and volatility polarity measures market energy. Together, they create a comprehensive view of market pressure that traditional single-dimension indicators cannot provide.
Core Components Explained
1. Price Polarity Engine
Measures directional pressure from price movement:
Price Change = close - close
Price Range = highest(high, polarity_period) - lowest(low, polarity_period)
Price Polarity = (Price Change / Price Range) * 100
Smoothed Price Polarity = ema(Price Polarity, smoothing)
This calculation normalizes price movement against the recent range, providing a -100 to +100 scale where positive values indicate bullish pressure and negative values indicate bearish pressure.
2. Volume Polarity System
Analyzes buying versus selling pressure through volume flow:
Bull Volume = close > open ? volume : 0
Bear Volume = close < open ? volume : 0
Volume Polarity = ((sma(Bull Volume, period) - sma(Bear Volume, period)) / sma(Total Volume, period)) * 100
This reveals institutional flow direction by comparing accumulation (buying) volume against distribution (selling) volume over the specified period.
3. Momentum Polarity Calculator
Combines RSI and MACD for comprehensive momentum analysis:
RSI Polarity = (RSI - 50) * 2 // Scale to -100 to +100
MACD Histogram Normalized = (MACD Histogram / stdev(MACD Histogram, period)) * 30
Momentum Polarity = (RSI Polarity + MACD Normalized) / 2
This dual-momentum approach captures both relative strength (RSI) and trend acceleration (MACD) components.
4. Volatility Polarity Tracker
Measures expansion versus contraction pressure:
ATR Change = current ATR - ATR
ATR Average = sma(ATR, polarity_period)
Volatility Polarity = (ATR Change / ATR Average) * 100
Positive values indicate expanding volatility (energy building), while negative values show contracting volatility (energy dissipating).
5. Composite Polarity Index
Weighted combination of all polarity dimensions:
Composite Polarity = (Price Polarity * 0.35) + (Volume Polarity * 0.25) + (Momentum Polarity * 0.30) + (Volatility Polarity * 0.10)
Final Polarity = ema(Composite Polarity, smoothing) * sensitivity
The weighting emphasizes price and momentum while incorporating volume flow and volatility context.
6. Pressure Zone Classification
The system defines seven distinct pressure zones:
Extreme Bull Zone: Polarity ≥ 70 (Intense bullish pressure)
Strong Bull Zone: Polarity 40-69 (Solid bullish pressure)
Weak Bull Zone: Polarity 1-39 (Mild bullish pressure)
Neutral Zone: Polarity = 0 (Equilibrium state)
Weak Bear Zone: Polarity -1 to -39 (Mild bearish pressure)
Strong Bear Zone: Polarity -40 to -69 (Solid bearish pressure)
Extreme Bear Zone: Polarity ≤ -70 (Intense bearish pressure)
7. Polarity Shift Detection
The system identifies four types of polarity shifts:
Polarity Flips: Crosses zero line with sufficient strength (>30)
Polarity Acceleration: Increasing momentum in extreme zones (>50 or <-50)
Polarity Exhaustion: Weakening momentum in extreme zones (>80 or <-80)
Pressure Temperature: Volatility-adjusted intensity measurement
8. Advanced Divergence Detection
Uses pivot-based analysis to identify polarity divergences:
Bullish Polarity Divergence: Price makes lower low while polarity makes higher low
Bearish Polarity Divergence: Price makes higher high while polarity makes lower high
Divergences are filtered by minimum polarity strength to ensure significance.
Visual Elements
Composite Polarity Wave: Main oscillator with advanced gradient coloring and triple-layer glow effect
Individual Polarity Lines: Price, volume, and momentum polarity components
Polarity Strength Histogram: Background columns showing absolute polarity strength
Pressure Zone Backgrounds: Dynamic gradient backgrounds based on polarity intensity
Reference Lines: Critical levels at ±40, ±70, and ±100 with neutral zone highlighting
Polarity Shift Markers: Circles for flips, triangles for acceleration, X-crosses for exhaustion
Divergence Diamonds: Large diamond markers for confirmed polarity divergences
Dashboard: Comprehensive real-time display of all polarity components and signal status
How Components Work Together
The integration creates a multi-dimensional pressure analysis:
Layer 1 - Price Pressure: Directional bias from pure price movement
Layer 2 - Volume Pressure: Institutional flow through buying/selling volume
Layer 3 - Momentum Pressure: Acceleration and relative strength dynamics
Layer 4 - Volatility Pressure: Energy expansion/contraction context
Layer 5 - Composite Analysis: Weighted combination revealing overall market polarity
Layer 6 - Shift Detection: Identification of polarity transitions and extremes
Layer 7 - Divergence Analysis: Price-polarity disconnects signaling potential reversals
Example scenario: Price makes a new high (Layer 1) but volume polarity weakens (Layer 2), momentum polarity diverges (Layer 3), and volatility contracts (Layer 4). The composite polarity (Layer 5) shows bearish divergence (Layer 7) with exhaustion signals (Layer 6), indicating high reversal probability.
Input Parameters
Polarity Core:
Polarity Period: Base period for polarity calculations (default: 14)
Smoothing: Smoothing factor for polarity waves (default: 3)
Sensitivity: Signal sensitivity multiplier (default: 1.5)
Divergence Detection:
Pivot Lookback: Bars for pivot detection (default: 5)
Min Divergence Strength: Minimum polarity strength for signals (default: 60)
Visual Settings:
Show Polarity Waves: Toggle main polarity display
Show Pressure Zones: Toggle background zone coloring
Show Divergence Markers: Toggle divergence signals
Show Polarity Shifts: Toggle shift detection markers
How to Use This Indicator
Step 1: Assess Overall Polarity
Check the composite polarity level and current pressure zone classification in the dashboard.
Step 2: Identify Pressure Extremes
Look for extreme bull (>70) or extreme bear (<-70) zones where reversals are more likely.
Step 3: Monitor Polarity Shifts
Watch for polarity flips (zero line crosses), acceleration in extreme zones, or exhaustion signals.
Step 4: Analyze Component Divergences
Check if individual polarity components (price, volume, momentum) are aligned or diverging.
Step 5: Detect Polarity Divergences
Look for diamond markers indicating price-polarity divergences - these often precede major reversals.
Step 6: Confirm with Pressure Temperature
High pressure temperature (volatility-adjusted intensity) adds conviction to polarity signals.
Step 7: Wait for Confluence
Best setups occur when multiple factors align: extreme zones + polarity shifts + divergences + high temperature.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal polarity detection
Focus on extreme zones (>70 or <-70) for highest probability reversals
Polarity flips provide early trend change signals with good risk:reward
Divergences in extreme zones offer exceptional reversal opportunities
Acceleration signals in extreme zones often precede explosive moves
Exhaustion signals warn of potential polarity reversals before they occur
High pressure temperature adds conviction to all polarity signals
Component analysis helps understand the source of polarity changes
Indicator Limitations
Polarity can remain extreme longer than expected during strong trends
Divergences may take time to resolve - patience is required
Extreme zones don't guarantee immediate reversals - timing is crucial
Component polarity may conflict, requiring interpretation skills
Pressure temperature can spike during news events, creating false signals
Polarity shifts may be brief and require quick decision-making
Performance varies across different market conditions and volatility regimes
Requires understanding of multi-dimensional pressure analysis concepts
Technical Implementation
Built with Pine Script v6 using:
Multi-dimensional polarity calculation across four market aspects
Advanced gradient coloring system with triple-layer glow effects
Pivot-based divergence detection with strength filtering
Dynamic pressure zone classification with background visualization
Real-time polarity shift detection with multiple signal types
Comprehensive dashboard with component breakdown and signal status
Anti-overlap filtering to prevent signal clustering
Pressure temperature calculation for volatility-adjusted intensity
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 multi-dimensional polarity approach. While individual components (RSI, MACD, volume analysis, ATR) are established concepts, this integration is justified because:
It synthesizes four distinct polarity dimensions that address different market pressure aspects
The composite polarity index provides a unified view of market pressure across multiple dimensions
Advanced polarity shift detection identifies transitions before they become obvious in price
Polarity divergence analysis reveals price-pressure disconnects that traditional indicators miss
Pressure zone classification provides quantitative framework for market state assessment
Pressure temperature adds volatility context to polarity intensity measurements
Each component contributes unique polarity information: price polarity shows directional bias, volume polarity reveals institutional flow, momentum polarity indicates acceleration, and volatility polarity measures energy. The integration's value lies in identifying moments when these pressure dimensions align or diverge, creating high-probability trading opportunities.
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.
Polarity analysis and divergence detection are analytical concepts that do not guarantee future price movement. Past performance and backtested results do not guarantee future results. Market conditions change, and polarity patterns that worked historically may not work in the future.
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

Harmonic Pulse Tracker [JOAT]Harmonic Pulse Tracker
Introduction
The Harmonic Pulse Tracker is an open-source institutional-grade wave and rhythm analysis system that combines Elliott Wave principles, Fibonacci harmonic analysis, WaveTrend oscillator mechanics, and cycle detection into a unified oscillator. This sophisticated system integrates multiple proven methodologies to identify high-probability reversal zones where harmonic patterns, wave cycles, and momentum indicators converge.
The indicator is designed for traders who understand that market movements follow natural harmonic patterns and cyclical rhythms. By synthesizing detrended price oscillation, Fibonacci retracement levels, WaveTrend momentum analysis, money flow dynamics, and volume confirmation, this tool helps identify structural market turning points with mathematical precision.
Why This Integration Exists
This indicator combines six distinct analytical frameworks that complement each other:
Harmonic Wave Analysis: Uses detrended price oscillation combined with Ehlers cycle detection to identify natural market rhythms
Fibonacci Harmonic Levels: Calculates dynamic Fibonacci retracements and extensions based on wave swing points
WaveTrend Oscillator: Implements LazyBear's WaveTrend algorithm for momentum and overbought/oversold detection
Money Flow Integration: Tracks institutional buying and selling pressure through Money Flow Index analysis
Volume Analysis: Confirms wave movements with volume spikes and directional volume pressure
Elliott Wave Counting: Simplified wave counting system to identify impulse and corrective wave phases
Each component addresses different aspects of market rhythm and harmony. The harmonic wave engine identifies natural price cycles, Fibonacci levels provide mathematical support/resistance, WaveTrend shows momentum extremes, money flow reveals institutional activity, volume confirms genuine moves, and Elliott Wave counting provides structural context. Together, they create a multi-dimensional view of market harmony and discord.
Core Components Explained
1. Harmonic Wave Engine
The core wave calculation combines two advanced techniques:
DPO (Detrended Price Oscillator) = close - sma(close, length/2 + 1)
Ehlers Cycle Component = High-pass filtered price with cycle smoothing
Harmonic Wave = Smoothed DPO + (Cycle Component * 0.5)
This creates a wave that removes trend bias while preserving cyclical components, revealing the natural harmonic rhythm of price movement.
Wave Derivatives:
- Wave Momentum: Rate of change in harmonic wave
- Wave Acceleration: Rate of change in momentum
- Wave Velocity: Percentage rate of change over 5 periods
These derivatives help identify wave phase transitions and momentum shifts before they become obvious in price.
2. Fibonacci Harmonic Level System
The indicator calculates dynamic Fibonacci levels based on harmonic wave swing points:
Standard Retracements:
- 23.6%, 38.2%, 50.0%, 61.8%, 78.6% of wave range
Extensions:
- 127.2%, 161.8%, 261.8% beyond wave high
Golden Pocket Zone:
The critical 61.8% to 78.6% retracement zone where most harmonic reversals occur. This zone represents the mathematical sweet spot where Fibonacci ratios converge with natural market rhythm.
Harmonic Resonance Detection:
The system identifies when price is within 5% of key Fibonacci levels and calculates confluence scores when multiple levels align.
3. WaveTrend Oscillator Integration
Implements the proven WaveTrend algorithm:
ESA = ema(hlc3, channel_length)
D = ema(abs(hlc3 - ESA), channel_length)
CI = (hlc3 - ESA) / (0.015 * D)
WT1 = ema(CI, average_length)
WT2 = sma(WT1, 4)
WaveTrend Signals:
- Crossovers in oversold zone (< -50): Bullish reversal signals
- Crossunders in overbought zone (> 50): Bearish reversal signals
- Regular crossovers: Momentum shift confirmation
4. Money Flow Analysis
Tracks institutional buying and selling pressure:
MFI = Money Flow Index over specified period
MFI Centered = (MFI - 50) * multiplier
- Positive MFI: Institutional buying pressure
- Negative MFI: Institutional selling pressure
- Strong MFI: Absolute value > 25 indicates significant institutional activity
5. Volume Analysis Engine
Comprehensive volume analysis including:
Volume Spikes: Volume > Average Volume * Threshold
Volume Ratio: Current volume / Average volume
Volume Strength: Normalized volume intensity (0-100)
Directional Volume:
- Bullish Volume Spike: High volume + green candle
- Bearish Volume Spike: High volume + red candle
6. Elliott Wave Phase Detection
Simplified wave analysis to identify market structure:
Impulse Waves:
- Impulse Up: Positive momentum + acceleration + velocity
- Impulse Down: Negative momentum + acceleration + velocity
Corrective Waves:
- Mixed momentum and acceleration signals indicating consolidation
Wave Counting:
Basic 5-wave count system that resets after wave 5 completion, helping identify potential reversal zones.
Multi-Factor Confluence Scoring System
The indicator calculates a real-time confluence score (0-100) by weighting each component:
Confluence Score Components:
- Fibonacci Zone: Up to 20 points (Golden Pocket = 20, other Fib levels = 4 each)
- Wave Strength: Up to 20 points (based on wave momentum intensity)
- WaveTrend: Up to 20 points (extreme zone crossovers = 20, regular = 15)
- Money Flow: Up to 20 points (strong institutional activity = 20)
- Volume: Up to 20 points (volume spikes = 20, elevated = 15)
Scores above 80 indicate exceptional confluence for potential trades. The dashboard displays individual component scores for transparency.
Perfect Harmonic Alignment Detection
The system identifies rare "Perfect Harmonic" setups when:
- Price is in Golden Pocket zone
- Impulse wave phase is active
- Wave strength > 70
- WaveTrend crossover in extreme zone
- Positive money flow (for bullish) or negative (for bearish)
- Volume spike confirmation
These setups represent the highest probability reversal opportunities.
Visual Elements
Harmonic Wave: Main oscillator with gradient coloring based on wave position
Wave Momentum: Histogram showing rate of change in wave movement
Fibonacci Levels: Key retracement and extension levels (38.2%, 50%, 61.8%, 78.6%, 161.8%)
Golden Pocket Zone: Highlighted area between 61.8% and 78.6% levels
WaveTrend Lines: WT1 and WT2 with overbought/oversold zones
Money Flow Columns: Institutional buying/selling pressure visualization
Volume Strength: Volume intensity histogram
Signal Markers: Perfect Harmonic signals and strong confluence alerts
Background Zones: Golden Pocket and Perfect Signal highlighting
Dashboard: Real-time display of all component values and confluence score
How Components Work Together
The integration creates a harmonic analysis approach:
Layer 1 - Wave Rhythm: Harmonic wave identifies natural market cycles and turning points
Layer 2 - Mathematical Levels: Fibonacci ratios provide precise support/resistance zones
Layer 3 - Momentum Context: WaveTrend shows overbought/oversold extremes
Layer 4 - Institutional Flow: Money flow reveals smart money positioning
Layer 5 - Volume Confirmation: Volume analysis validates genuine moves vs noise
Layer 6 - Wave Structure: Elliott Wave context provides structural framework
Example scenario: Harmonic wave reaches Golden Pocket zone (Layer 1 + 2) during WaveTrend oversold crossover (Layer 3) with positive money flow (Layer 4) and volume spike (Layer 5) in corrective wave phase (Layer 6). This confluence suggests exceptional reversal probability.
Input Parameters
Wave Settings:
Wave Length: Period for harmonic wave calculation (default: 34)
Smoothing Period: Wave smoothing factor (default: 5)
WaveTrend Settings:
Show WaveTrend: Toggle WaveTrend display
WT Channel Length: Channel calculation period (default: 9)
WT Average Length: Smoothing period (default: 12)
WT Overbought: Overbought threshold (default: 50)
WT Oversold: Oversold threshold (default: -50)
Money Flow Settings:
Show Money Flow: Toggle money flow display
MFI Length: Money Flow Index period (default: 14)
MFI Multiplier: Sensitivity adjustment (default: 1.5)
Volume Settings:
Show Volume Analysis: Toggle volume indicators
Volume Spike Threshold: Multiplier for spike detection (default: 1.5)
Fibonacci Settings:
Show Fibonacci Levels: Toggle Fibonacci level display
Fibonacci Lookback: Period for swing point calculation (default: 100)
Cycle Settings:
Cycle Period: Ehlers cycle detection period (default: 20)
Cycle Smoothing: Cycle component smoothing (default: 3)
How to Use This Indicator
Step 1: Identify Wave Phase
Check the dashboard for current wave phase (Impulse Up/Down, Corrective, Neutral) and Elliott Wave count.
Step 2: Locate Fibonacci Zones
Look for price approaching key Fibonacci levels, especially the Golden Pocket zone (61.8%-78.6%).
Step 3: Check WaveTrend Position
Identify if WaveTrend is in extreme zones and watch for crossovers in oversold/overbought areas.
Step 4: Analyze Money Flow
Confirm institutional positioning through Money Flow Index - positive for bullish setups, negative for bearish.
Step 5: Verify Volume Confirmation
Ensure volume supports the move - look for volume spikes in the direction of the expected reversal.
Step 6: Review Confluence Score
Check the dashboard confluence score. Scores above 80 indicate high-probability setups.
Step 7: Wait for Perfect Harmonic Signals
The highest probability trades occur when "PERFECT" signals appear, indicating all factors are aligned.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal harmonic detection
Focus on Golden Pocket zone entries - this is where most harmonic reversals occur
Wait for WaveTrend crossovers in extreme zones for best risk:reward
Confirm with money flow direction - institutional flow should support the trade direction
Volume spikes add significant confirmation to harmonic setups
Perfect Harmonic signals are rare but offer exceptional probability
Wave 5 completions often coincide with major reversal opportunities
Use confluence scores above 80 as primary filter for trade selection
Indicator Limitations
Harmonic patterns can extend beyond expected Fibonacci levels
Perfect Harmonic signals are rare - patience is required for best setups
Wave counting is simplified and may not match complex Elliott Wave analysis
Fibonacci levels are dynamic and may adjust as new swing points form
Money flow can remain extreme longer than expected during strong trends
Volume confirmation may be less reliable in low-liquidity markets
Confluence scoring is mathematical, not predictive of future performance
Requires understanding of harmonic analysis principles for effective use
Technical Implementation
Built with Pine Script v6 using:
Advanced detrended price oscillation with Ehlers cycle detection
Dynamic Fibonacci calculation based on swing point analysis
LazyBear WaveTrend algorithm implementation
Real-time Money Flow Index with institutional bias detection
Volume analysis with spike detection and directional confirmation
Simplified Elliott Wave counting with phase detection
Multi-factor confluence scoring system with component weighting
Anti-overlap signal filtering to prevent signal clustering
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 harmonic integration approach. While individual components (DPO, Fibonacci, WaveTrend, MFI, volume analysis, Elliott Wave) are established concepts, this integration is justified because:
It synthesizes six distinct methodologies that address different aspects of market harmony
The harmonic wave engine combines detrended oscillation with cycle detection for superior rhythm analysis
Dynamic Fibonacci levels adjust to current wave structure rather than using static retracements
Golden Pocket zone identification provides mathematical precision for reversal timing
Multi-factor confluence scoring quantifies setup quality across all components
Perfect Harmonic detection identifies rare, high-probability reversal opportunities
Each component contributes unique harmonic information: wave analysis reveals natural cycles, Fibonacci provides mathematical levels, WaveTrend shows momentum extremes, money flow indicates institutional positioning, volume confirms genuine moves, and Elliott Wave provides structural context. The integration's value lies in identifying moments when all these harmonic factors align simultaneously.
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.
Harmonic analysis and Fibonacci levels are mathematical concepts that do not guarantee future price movement. Past performance and backtested results do not guarantee future results. Market conditions change, and harmonic patterns that worked historically may not work in the future.
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

Cascade Trend Navigator [JOAT]Cascade Trend Navigator
Introduction
The Cascade Trend Navigator is an open-source institutional-grade multi-timeframe trend and flow system that combines dynamic support/resistance zones, volume profile analysis, and liquidity detection into a unified overlay indicator. This comprehensive system integrates multiple proven methodologies to identify high-probability trend continuation and reversal zones where institutional and retail liquidity converge.
The indicator is designed for traders who understand that successful trend following requires more than simple moving average crossovers. By synthesizing adaptive moving averages, dynamic support/resistance zones, volume profile analysis, and liquidity pool detection, this tool helps identify structural market inflection points with institutional-grade precision.
Why This Integration Exists
This indicator combines four distinct analytical frameworks that complement each other:
Adaptive Moving Average System: Uses Hull, TEMA, DEMA, ZEMA, and VWMA calculations for superior trend identification with reduced lag
Dynamic Support/Resistance Zones: Calculates real-time zones using Hull Moving Averages and ATR-based deviation bands
Volume Profile Analysis: Identifies Point of Control (POC) and high-volume price levels where institutional activity concentrates
Liquidity Pool Detection: Tracks equal highs/lows, swing points, and liquidity zones where stop hunts typically occur
Each component addresses different aspects of market structure. The adaptive MA system provides trend direction with minimal lag, dynamic zones reveal real-time support/resistance levels, volume profile shows where institutions are most active, and liquidity detection identifies areas where price reversals are likely. Together, they create a multi-dimensional view of market flow and structure.
Core Components Explained
1. Advanced Moving Average Engine
The indicator offers seven different moving average types, each optimized for specific market conditions:
Hull MA (HMA): wma(2 * wma(src, length/2) - wma(src, length), sqrt(length))
TEMA: 3 * ema1 - 3 * ema2 + ema3 (Triple smoothed)
DEMA: 2 * ema1 - ema2 (Double smoothed)
ZEMA: Zero-lag EMA with lag compensation
VWMA: Volume-weighted for institutional flow tracking
The system uses three MA periods: Fast (default 20), Slow (default 50), and Trend (default 200). Trend direction is determined when Fast MA > Slow MA and price > Trend MA for bullish conditions, with the inverse for bearish conditions.
2. Dynamic Support/Resistance Zone System
Unlike static pivot levels, these zones adapt to current market volatility:
Resistance Zone: HMA(high, length) + (ATR * deviation) to HMA(high, length)
Support Zone: HMA(low, length) to HMA(low, length) - (ATR * deviation)
The zones automatically adjust width based on ATR, making them more relevant during high volatility periods and tighter during consolidation. This adaptive nature provides more accurate entry and exit levels compared to fixed percentage-based zones.
3. Volume Profile Integration
The indicator calculates a real-time volume profile over a specified lookback period:
- Divides the price range into configurable bins (default 20)
- Accumulates volume for each price level
- Identifies Point of Control (POC) - the price level with highest volume
- Displays POC as a dynamic level where institutional activity is concentrated
This helps traders understand where the majority of trading activity occurred and where price is likely to find support or resistance based on volume acceptance.
4. Liquidity Pool Detection System
The system identifies multiple types of liquidity pools:
Equal Highs/Lows: Price levels where multiple highs or lows form at similar levels, creating liquidity pools for institutional players to target
Swing Points: Pivot highs and lows that represent areas where retail stops are likely clustered
Liquidity Sweeps: Instances where price briefly moves beyond recent highs/lows but fails to sustain, indicating stop hunting activity
These areas often precede significant price moves as institutions clear retail positions before establishing their own.
5. Trend Strength Calculation
The indicator calculates trend strength as:
Trend Strength = abs((Fast MA - Slow MA) / Slow MA) * 100
This provides a quantitative measure of trend momentum, helping traders distinguish between strong trending moves and weak corrective phases.
Visual Elements
Moving Average Cloud: Fill between Fast and Slow MAs with gradient coloring based on trend direction
Dynamic Zones: Support zones in green, resistance zones in red with glowing borders
POC Line: Golden cross marking the highest volume price level
Liquidity Markers: Triangles for equal highs/lows, diamonds for swing points
Signal Arrows: BUY/SELL labels for trend changes and zone touches
Trend Background: Subtle background coloring indicating overall market bias
Dashboard: Real-time display of trend status, strength, and distances to key levels
How Components Work Together
The integration creates a layered analysis approach:
Layer 1 - Trend Identification: Adaptive MAs determine primary trend direction with minimal lag
Layer 2 - Dynamic Levels: Support/resistance zones provide entry and exit levels that adapt to volatility
Layer 3 - Volume Confirmation: POC shows where institutions are most active
Layer 4 - Liquidity Mapping: Equal highs/lows and swing points reveal where reversals are likely
Layer 5 - Signal Synthesis: All components combine to generate high-probability trade signals
Example scenario: Price approaches a dynamic support zone (Layer 2) in an uptrend (Layer 1), near the POC level (Layer 3), with equal lows nearby (Layer 4). This confluence suggests a high-probability bounce location.
Input Parameters
Trend Settings:
Fast MA Length: Period for fast moving average (default: 20)
Slow MA Length: Period for slow moving average (default: 50)
Trend MA Length: Period for trend filter (default: 200)
MA Type: Choose from SMA, EMA, HMA, TEMA, DEMA, ZEMA, VWMA
Show MA Cloud: Toggle cloud fill between fast and slow MAs
Zone Settings:
Zone Calculation Length: Period for HMA zone calculation (default: 50)
Zone Deviation: ATR multiplier for zone width (default: 1.5)
Show Support/Resistance Zones: Toggle zone display
Volume Profile Settings:
Volume Profile Length: Lookback period for volume calculation (default: 100)
Number of Price Bins: Granularity of volume profile (default: 20)
Show Volume Profile: Toggle POC display
Liquidity Settings:
Show Liquidity Zones: Toggle liquidity markers
Liquidity Lookback: Period for swing point detection (default: 50)
How to Use This Indicator
Step 1: Identify Trend Direction
Check the MA cloud color and trend background. Green indicates bullish trend, red indicates bearish trend.
Step 2: Locate Dynamic Zones
Identify current support and resistance zones. These adapt to volatility and provide better levels than static pivots.
Step 3: Check Volume Profile
Note the POC level - this shows where most institutional activity occurred and often acts as magnetic price level.
Step 4: Map Liquidity Pools
Look for equal highs/lows and swing points. These areas often see stop hunting before major moves.
Step 5: Wait for Confluence
Best setups occur when multiple elements align: trend direction + zone touch + POC proximity + liquidity pool.
Step 6: Monitor Dashboard
Use the dashboard to track trend strength, distances to key levels, and current signal status.
Best Practices
Use on 15-minute to daily timeframes for optimal signal quality
Combine with proper risk management - zones provide levels, not exact entries
Pay attention to trend strength - stronger trends have higher continuation probability
Watch for zone touches in trending markets as continuation signals
Liquidity sweeps often provide excellent risk:reward entries when they fail
POC acts as magnetic level - price often returns to test these areas
Volume confirmation is critical - avoid signals during low volume periods
Indicator Limitations
Does not provide exact entry/exit signals - requires trader interpretation
Can generate false signals in choppy, sideways markets
Dynamic zones may adjust too quickly in highly volatile conditions
Volume profile requires sufficient lookback data to be meaningful
Liquidity pools don't always get tested - not every level provides opportunity
Trend strength can remain elevated longer than expected during strong moves
Performance varies across different markets and timeframes
Requires understanding of institutional order flow concepts for effective use
Technical Implementation
Built with Pine Script v6 using:
Advanced moving average calculations with zero-lag techniques
Real-time volume profile computation with dynamic binning
Adaptive support/resistance zone calculation using HMA and ATR
Pivot-based liquidity pool detection with swing analysis
Dynamic color gradients based on trend strength and direction
Comprehensive dashboard with real-time statistics
Anti-overlap signal filtering to prevent signal clustering
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its integration approach. While individual components (moving averages, support/resistance, volume profile, liquidity detection) are established concepts, this integration is justified because:
It synthesizes four distinct methodologies that address different market aspects
The adaptive zone calculation provides dynamic levels that adjust to current volatility
Volume profile integration shows institutional activity concentration in real-time
Liquidity pool detection reveals areas where institutional stop hunting typically occurs
The combination helps identify confluence zones where multiple factors align
Anti-overlap filtering and trend strength calculation provide quantitative edge
Each component contributes unique information: adaptive MAs provide trend direction with minimal lag, dynamic zones offer volatility-adjusted levels, volume profile reveals institutional activity, and liquidity detection identifies reversal zones. The integration's value lies in presenting these complementary perspectives simultaneously with unified signal generation.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Technical indicators are tools for analysis, not guarantees of future performance. Past performance and backtested results do not guarantee future results. Market conditions change, and strategies that worked historically may not work in the future.
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

Precision Confluence Trading Strategy [JOAT]Precision Confluence Trading Strategy
Introduction
The Precision Confluence Trading Strategy is an open-source algorithmic trading system that combines Central Pivot Range (CPR) analysis, Hull Moving Average (HMA) ribbon alignment, WaveTrend oscillator signals, multi-oscillator divergence detection, ADX trend strength, volume confirmation, Smart Money Concepts (FVG, Order Blocks, Liquidity Sweeps), and multi-timeframe analysis into a comprehensive confluence-based strategy. This mashup creates an institutional-grade trading system designed to identify high-probability setups where multiple independent analytical frameworks simultaneously signal the same direction.
The strategy addresses a fundamental challenge in algorithmic trading: single-factor systems produce too many false signals and lack robustness across different market conditions. By requiring confluence across 9 different analytical components before entering trades, this system significantly reduces false signals and focuses capital on only the highest-quality setups where technical, momentum, volume, and institutional factors all align.
Chart showing strategy entries with confluence dashboard on 4H timeframe
Why This Mashup Exists
This strategy combines nine analytical frameworks that address different aspects of market analysis:
CPR Analysis: Identifies key pivot levels where institutional algorithms make decisions
HMA Ribbon: Measures trend quality through 5-layer moving average alignment
WaveTrend Oscillator: Detects momentum cycles and overbought/oversold conditions
Multi-Oscillator Divergence: Identifies momentum exhaustion across RSI, MACD, Stochastic RSI
ADX Trend Strength: Quantifies trend strength to avoid weak, choppy markets
Volume Confirmation: Validates moves with volume analysis and delta calculations
Smart Money Concepts: Tracks institutional footprints (FVG, Order Blocks, Liquidity Sweeps)
Multi-Timeframe Analysis: Ensures directional alignment across 15M, 1H, and 4H timeframes
Key Moving Averages: Confirms position relative to SMA 50/200 institutional levels
Each component addresses a different market dimension: CPR provides static structure, HMA shows trend quality, WaveTrend captures momentum cycles, Divergences warn of exhaustion, ADX measures trend strength, Volume confirms genuine moves, SMC reveals institutional behavior, MTF ensures alignment, and Key MAs provide institutional context. Together, they create a multi-dimensional analysis system that no single indicator can provide.
The mashup is justified because these components use fundamentally different data and methodologies (pivot calculations, weighted moving averages, wave oscillators, directional movement, volume analysis, price inefficiencies, multi-timeframe data, simple moving averages) that respond to different market conditions. When they align, it indicates genuine high-probability setup rather than noise from a single analytical method.
Core Strategy Logic
1. CPR Analysis Component (0-15 points)
Central Pivot Range provides structural reference levels:
// Daily and Weekly CPR calculation
= calcCPR(dHigh, dLow, dClose)
= calcCPR(wHigh, wLow, wClose)
// CPR scoring
cprBullScore = 0
cprBullScore += close > dPivot and close > wPivot ? 10 : 0
cprBullScore += close > dTC ? 3 : 0
cprBullScore += cprNarrow ? 2 : 0 // Narrow CPR = breakout potential
cprBearScore = 0
cprBearScore += close < dPivot and close < wPivot ? 10 : 0
cprBearScore += close < dBC ? 3 : 0
cprBearScore += cprNarrow ? 2 : 0
CPR contribution: Up to 15 points for strong position relative to pivots with narrow CPR indicating breakout potential.
2. HMA Ribbon Alignment Component (0-15 points)
5-layer Hull Moving Average ribbon measures trend quality:
// Calculate 5 HMAs
hma8 = hullMA(close, 8)
hma13 = hullMA(close, 13)
hma21 = hullMA(close, 21)
hma34 = hullMA(close, 34)
hma55 = hullMA(close, 55)
// Full alignment check
hmaFullBullish = hma8 > hma13 and hma13 > hma21 and hma21 > hma34 and hma34 > hma55
hmaFullBearish = hma8 < hma13 and hma13 < hma21 and hma21 < hma34 and hma34 < hma55
// EMA cloud
emaCloudBullish = emaFast > emaSlow
// HMA scoring
hmaRibbonBullScore = 0
hmaRibbonBullScore += hmaBullish ? 5 : 0
hmaRibbonBullScore += hmaFullBullish ? 7 : 0 // Full alignment = strong trend
hmaRibbonBullScore += emaCloudBullish ? 3 : 0
HMA contribution: Up to 15 points for full ribbon alignment with EMA cloud confirmation.
3. WaveTrend Oscillator Component (0-15 points)
WaveTrend detects momentum cycles and extreme conditions:
= calcWaveTrend(hlc3, wtChannelLen, wtAverageLen)
// WaveTrend signals
wtCrossUp = ta.crossover(wt1, wt2)
wtCrossDown = ta.crossunder(wt1, wt2)
wtOversold = wt1 < -60
wtOverbought = wt1 > 60
// WaveTrend scoring
wtBullScore = 0
wtBullScore += wtCrossUp and wtOversold ? 8 : wtCrossUp ? 5 : 0
wtBullScore += wtBullDiv ? 5 : 0 // Divergence adds weight
wtBullScore += wtMomentumBullish ? 2 : 0
WaveTrend contribution: Up to 15 points for crossover in extreme zone with divergence and momentum confirmation.
4. Multi-Oscillator Divergence Component (0-10 points)
Tracks divergences across RSI, MACD, and Stochastic RSI:
// Divergence detection
rsiBullDiv = price LL and rsi HL
wtBullDiv = price LL and wt1 HL
strongBullDiv = rsiBullDiv and wtBullDiv
// Divergence scoring
divBullScore = 0
divBullScore += rsiBullDiv ? 5 : 0
divBullScore += strongBullDiv ? 5 : 0 // Multiple oscillators = stronger signal
Divergence contribution: Up to 10 points for multi-oscillator divergence indicating momentum exhaustion.
5. ADX Trend Strength Component (0-10 points)
ADX quantifies trend strength to avoid choppy markets:
= ta.dmi(adxLength, adxLength)
strongTrend = adx > adxThreshold // Default: 20
trendBullish = plus > minus
// ADX scoring
adxBullScore = strongTrend and trendBullish ? 10 : trendBullish ? 5 : 0
ADX contribution: Up to 10 points for strong trend (ADX > 20) in correct direction.
6. Volume Confirmation Component (0-10 points)
Volume analysis validates genuine institutional participation:
volMA = ta.sma(volume, volMaLength)
highVolume = volume > volMA * 1.5
climaxVolume = volume > volMA * 3.0
// Volume delta
volumeDelta = ta.cum(buyVolume) - ta.cum(sellVolume)
deltaRising = volumeDelta > volumeDeltaMA
// Volume scoring
volBullScore = 0
volBullScore += volConfirmedBull ? 7 : bullishVolume ? 5 : 0
volBullScore += climaxVolume and close > open ? 3 : 0
Volume contribution: Up to 10 points for high volume with rising delta confirming institutional buying.
7. Smart Money Concepts Component (0-10 points)
SMC tracks institutional order flow patterns:
// Fair Value Gaps
significantBullFVG = bullishFVG and fvgSize > 0.3%
// Order Blocks
bullishOB = bearish candles + strong bullish candle + high volume
// Liquidity Sweeps
volConfirmedSweepLow = sweep below recent low + high volume
// Displacement
bullishDisplacement = large candle (> 2x ATR) + climax volume
// SMC scoring
smcBullScore = 0
smcBullScore += significantBullFVG ? 2 : 0
smcBullScore += bullishOB ? 2 : 0
smcBullScore += volConfirmedSweepLow ? 2 : 0
smcBullScore += bullishDisplacement ? 3 : 0
SMC contribution: Up to 10 points for multiple institutional footprints (FVG + OB + Sweep + Displacement).
8. Multi-Timeframe Analysis Component (0-15 points)
Ensures directional alignment across higher timeframes:
// Request higher timeframe data
= request.security(syminfo.tickerid, "15", htfTrend())
= request.security(syminfo.tickerid, "60", htfTrend())
= request.security(syminfo.tickerid, "240", htfTrend())
// Alignment check
mtfBullish = htf15mDir == 1 and htf1hDir == 1 and htf4hDir == 1
mtfStrongBullish = mtfBullish and htf15mStrong and htf1hStrong and htf4hStrong
// MTF scoring
mtfBullScore = 0
mtfBullScore += mtfStrongBullish ? 15 : mtfBullish ? 10 : htf1hDir == 1 ? 5 : 0
MTF contribution: Up to 15 points for all three higher timeframes aligned with strong trends.
9. Key Moving Average Component (0-10 points)
Position relative to institutional moving averages:
sma50 = ta.sma(close, 50)
sma200 = ta.sma(close, 200)
goldenCross = sma50 > sma200
// MA scoring
maBullScore = 0
maBullScore += close > sma50 ? 3 : 0
maBullScore += close > sma200 ? 4 : 0
maBullScore += goldenCross ? 3 : 0
MA contribution: Up to 10 points for price above key MAs with Golden Cross.
Dashboard showing confluence score breakdown by component
Total Confluence Scoring System
The strategy calculates total confluence score (0-100) by summing all components:
bullConfluenceScore = cprBullScore + // 0-15
hmaRibbonBullScore + // 0-15
wtBullScore + // 0-15
divBullScore + // 0-10
adxBullScore + // 0-10
volBullScore + // 0-10
smcBullScore + // 0-10
mtfBullScore + // 0-15
maBullScore // 0-10
// Total: 0-100
Entry signals require:
Bullish confluence score >= minConfluenceScore (default: 70)
Bearish confluence score < 30 (avoid conflicting signals)
Optional session filter (London/NY sessions only)
Signal tiers:
LONG: Confluence score >= 70
STRONG LONG: Confluence score >= 80
ULTRA LONG: Confluence score >= 90 (rare, highest probability)
Risk Management System
The strategy implements comprehensive risk controls:
1. ATR-Based Position Sizing
atr = ta.atr(14)
stopLossDistance = atr * 2
// Calculate position size based on risk
accountSize = strategy.equity
riskAmount = accountSize * (riskPercent / 100) // Default: 2%
positionSize = riskAmount / stopLossDistance
2. Dynamic Stop Loss and Take Profit
// Dynamic stop based on market structure
dynamicStopBull = math.min(close - stopLossDistance, ta.lowest(low, 10))
// Take profit based on risk:reward ratio
takeProfit = close + (stopLossDistance * rewardRatio) // Default: 2:1
3. Breakeven Management
// Move stop to breakeven when profit reaches threshold
if close >= entryPrice + (stopLossDistance * breakevenTrigger) // Default: 1.0 R:R
strategy.exit("Long Exit", "Long", stop=entryPrice, limit=takeProfit)
4. Trailing Stop (Optional)
if useTrailingStop
trailDistance = close * (trailOffset / 100) // Default: 1.5%
strategy.exit("Long Exit", "Long", trail_offset=trailDistance)
Strategy Execution Logic
// Long Entry
if longSignal and strategy.position_size == 0
stopLoss = dynamicStopBull
takeProfit = close + (stopLossDistance * rewardRatio)
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", "Long", stop=stopLoss, limit=takeProfit)
// Label with confluence score
label.new(bar_index, low,
"LONG Score: " + str.tostring(bullConfluenceScore),
style=label.style_label_up,
color=entryColor)
// Short Entry (mirror logic)
if shortSignal and strategy.position_size == 0
// Similar logic for short trades
Performance Dashboard
The strategy displays a comprehensive 12-row dashboard:
Row 1: Component header
Row 2: Current position (LONG/SHORT/FLAT)
Row 3: Total confluence score (bull/bear)
Row 4: CPR component score
Row 5: HMA Ribbon component score
Row 6: WaveTrend component score
Row 7: Divergence component score
Row 8: ADX component score
Row 9: Volume component score
Row 10: SMC component score
Row 11: MTF component score
Row 12: Equity and P&L percentage
Strategy Parameters
Strategy Settings:
Use Multi-Timeframe Confirmation: Enable MTF analysis (default: enabled)
Use Divergence Signals: Enable divergence component (default: enabled)
Use Smart Money Concepts: Enable SMC component (default: enabled)
Use Volume Confirmation: Enable volume component (default: enabled)
Use CPR Levels: Enable CPR component (default: enabled)
Use WaveTrend Signals: Enable WaveTrend component (default: enabled)
Use HMA Alignment: Enable HMA component (default: enabled)
Use Session Filter: Trade only during London/NY sessions (default: enabled)
Minimum Confluence Score: Threshold for entry (default: 70, range: 50-100)
Risk Management:
Risk Per Trade %: Percentage of equity to risk (default: 2.0%, range: 0.1-10%)
Reward:Risk Ratio: Take profit multiplier (default: 2.0, range: 1.0-5.0)
Use Trailing Stop: Enable trailing stop (default: enabled)
Trailing Stop %: Trail distance (default: 1.5%, range: 0.1-5.0%)
Use Breakeven: Move stop to breakeven (default: enabled)
Breakeven Trigger: R:R threshold to move stop (default: 1.0, range: 0.5-3.0)
Indicator Parameters:
RSI Length: Period for RSI (default: 14)
ADX Length: Period for ADX (default: 14)
ADX Threshold: Minimum ADX for strong trend (default: 20)
Volume MA Length: Period for volume average (default: 20)
HMA Length: Period for HMA (default: 21)
WaveTrend Channel Length: (default: 10)
WaveTrend Average Length: (default: 21)
Backtesting Configuration
Default strategy properties:
Initial Capital: $10,000
Default Qty Type: Percent of Equity
Default Qty Value: 10%
Commission Type: Percent
Commission Value: 0.1% (10 basis points)
Slippage: 2 ticks
Max Bars Back: 5000
These settings represent realistic trading conditions for the average trader. Commission and slippage account for typical broker fees and execution costs.
How to Use This Strategy
Step 1: Configure Components
Enable/disable components based on your trading style. All components enabled provides maximum filtering but fewer trades.
Step 2: Set Confluence Threshold
Adjust minimum confluence score. Higher threshold (80-90) = fewer, higher-quality trades. Lower threshold (60-70) = more frequent trades.
Step 3: Configure Risk Parameters
Set risk per trade (1-2% recommended) and reward:risk ratio (2:1 minimum recommended). Enable breakeven and trailing stop for protection.
Step 4: Backtest Thoroughly
Run backtests on multiple timeframes and market conditions. Aim for 100+ trades for statistical significance. Review win rate, profit factor, and drawdown.
Step 5: Analyze Component Contribution
Use dashboard to see which components contribute most to winning trades. Consider adjusting weights or disabling low-value components.
Step 6: Forward Test
Paper trade the strategy before risking real capital. Verify that live results align with backtest expectations.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal signal quality
Confluence score above 80 produces highest win rate but fewer trades
Enable all components for maximum filtering in volatile markets
Disable some components for more frequent trades in trending markets
Session filter (London/NY only) significantly improves results
Risk 1-2% per trade maximum for sustainable trading
Aim for minimum 2:1 reward:risk ratio
Review dashboard component scores to understand trade quality
Backtest on minimum 6-12 months of data
Verify 100+ trades in backtest for statistical validity
Strategy Limitations
Confluence-based systems produce fewer trades - may not suit active traders
Requires all components to align - perfect setups are rare
Backtesting results may not reflect live trading with slippage and latency
Multi-timeframe analysis can cause repainting on lower timeframes
High confluence threshold (90+) may produce too few trades for some markets
Commission and slippage significantly impact profitability
Strategy optimized for trending markets - may underperform in ranges
Past performance does not guarantee future results
Requires understanding of all components for effective parameter tuning
Complex system with many parameters - over-optimization risk
Backtesting Considerations
When evaluating backtest results:
Sample Size: Minimum 100 trades for statistical significance
Win Rate: 40-60% is realistic for 2:1 R:R strategy
Profit Factor: Above 1.5 is good, above 2.0 is excellent
Max Drawdown: Should be less than 20% of initial capital
Sharpe Ratio: Above 1.0 indicates good risk-adjusted returns
Trade Frequency: Should match your trading availability
Equity Curve: Should show steady growth, not erratic spikes
Consecutive Losses: Prepare for 5-10 consecutive losses
Adjust parameters if:
Win rate < 35% with 2:1 R:R (increase confluence threshold)
Too few trades (< 50 in 6 months) (decrease confluence threshold or disable some components)
Max drawdown > 25% (reduce risk per trade or increase confluence threshold)
Profit factor < 1.2 (strategy may not be viable)
Technical Implementation
Built with Pine Script v6 using:
9-component confluence scoring system
CPR calculations with width analysis
5-layer HMA ribbon with full alignment detection
WaveTrend oscillator with divergence tracking
Multi-oscillator divergence detection (RSI, MACD, Stoch RSI)
ADX trend strength measurement
Volume analysis with delta calculations
Smart Money Concepts (FVG, OB, Liquidity Sweeps, Displacement)
Multi-timeframe analysis (15M, 1H, 4H)
ATR-based dynamic position sizing
Breakeven and trailing stop management
Comprehensive 12-row dashboard
Session filtering (London/NY)
The code is fully open-source and can be modified to adjust component weights, confluence thresholds, and risk parameters.
Originality Statement
This strategy is original in its comprehensive multi-component confluence approach. While individual components (CPR, HMA, WaveTrend, Divergences, ADX, Volume, SMC, MTF, Key MAs) are established analytical tools, this mashup is justified because:
It integrates 9 independent analytical frameworks using fundamentally different data and methodologies
The confluence scoring system quantifies setup quality across all components (0-100 scale)
Each component addresses a different market dimension (structure, trend, momentum, strength, volume, institutional flow, timeframe alignment)
Tiered signal system (LONG/STRONG/ULTRA) provides graduated confidence levels
Comprehensive risk management with ATR-based sizing, breakeven, and trailing stops
Component-level dashboard allows traders to understand what drives each trade
Session filtering aligns with institutional trading hours
Integration reveals complete market picture that no single indicator provides
Each component contributes unique information: CPR provides structure, HMA shows trend quality, WaveTrend captures momentum cycles, Divergences warn of exhaustion, ADX measures strength, Volume confirms moves, SMC reveals institutional behavior, MTF ensures alignment, and Key MAs provide institutional context. The strategy's value lies in requiring confluence across these independent frameworks, significantly reducing false signals and focusing capital on only the highest-probability setups where all factors align.
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.
Backtesting results do not guarantee future performance. Past results, whether real or indicated by historical tests, are not indicative of future results. There are frequently sharp differences between backtested results and actual results subsequently achieved by any trading strategy.
The confluence score is a mathematical calculation based on current market data, not a prediction of future price movement. High confluence scores do not ensure profitable trades. Market conditions change, and strategies that worked historically may not work in the future.
Commission and slippage settings in backtests may not accurately reflect live trading conditions. Real trading results will vary based on execution quality, market liquidity, broker fees, and other factors not captured in backtesting.
No representation is being made that any account will or is likely to achieve profits or losses similar to those shown in backtests. Users should thoroughly test any strategy in a paper trading environment before risking real capital.
Always use proper risk management. Never risk more than you can afford to lose. The default 2% risk per trade is a guideline - adjust based on your personal risk tolerance and account size. 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.
-Made with passion by officialjackofalltrades Strategy

Adaptive Hull Momentum Ribbon [JOAT]Adaptive Hull Momentum Ribbon
Introduction
The Adaptive Hull Momentum Ribbon is an open-source trend-following indicator that combines a 5-layer Hull Moving Average (HMA) ribbon with EMA cloud analysis, key moving averages (SMA 50/200, EMA 200), crossover detection, and comprehensive trend strength analytics. This mashup creates a multi-layered trend identification system designed to show not just trend direction, but trend quality, alignment across multiple timeframes, and confluence between different moving average methodologies.
The indicator addresses a fundamental challenge in trend trading: single moving averages provide limited information about trend strength and quality. By layering five HMAs with different periods, adding an EMA cloud for short-term momentum, and tracking alignment with key institutional moving averages, this tool provides a complete picture of trend health that helps traders distinguish between strong trends worth following and weak trends likely to fail.
Chart showing 5-layer HMA ribbon, EMA cloud, and key MAs with trend dashboard on D timeframe
Why This Mashup Exists
This indicator combines four moving average frameworks that complement each other:
Hull Moving Average Ribbon: 5 HMAs (8, 13, 21, 34, 55) providing smooth, responsive trend indication
EMA Cloud: Fast (9) and Slow (21) EMAs showing short-term momentum
Key Institutional MAs: SMA 50, SMA 200, EMA 200 tracked by institutions globally
Crossover Detection: Golden Cross, Death Cross, and HMA crossovers
Each component serves a specific purpose: HMA Ribbon shows trend with minimal lag, EMA Cloud captures short-term momentum shifts, Key MAs provide institutional reference levels, and Crossovers signal major trend changes. Together, they create a comprehensive trend analysis system that shows both micro (HMA/EMA) and macro (SMA 50/200) trend structure.
The mashup is justified because these moving average types use fundamentally different calculations (weighted moving average with square root period for HMA, exponential weighting for EMA, simple average for SMA) that respond to price changes differently. When they align, it indicates genuine trend strength across multiple calculation methods and timeframes.
Core Components Explained
1. Hull Moving Average Ribbon System
HMA calculation provides smooth, responsive moving averages with reduced lag:
// Hull Moving Average formula
hullMA(src, length) =>
wma1 = ta.wma(src, length / 2)
wma2 = ta.wma(src, length)
ta.wma(2 * wma1 - wma2, int(math.sqrt(length)))
// 5-layer ribbon
hma8 = hullMA(close, 8) // Fastest, most responsive
hma13 = hullMA(close, 13)
hma21 = hullMA(close, 21) // Medium-term trend
hma34 = hullMA(close, 34)
hma55 = hullMA(close, 55) // Slowest, smoothest
HMA advantages over traditional MAs:
Significantly reduced lag compared to SMA/EMA
Smooth line without excessive whipsaws
Responsive to price changes while filtering noise
Square root period weighting provides optimal balance
Ribbon interpretation:
Full Bullish Alignment: HMA8 > HMA13 > HMA21 > HMA34 > HMA55 = strong uptrend
Full Bearish Alignment: HMA8 < HMA13 < HMA21 < HMA34 < HMA55 = strong downtrend
Mixed Alignment: HMAs crossing or intertwined = weak trend or consolidation
Ribbon Width: Wide ribbon = strong trend, narrow ribbon = weak trend
The indicator plots all 5 HMAs with gradient coloring (green to red) and fills between them to create visual ribbon effect.
2. EMA Cloud System
Fast and slow EMAs create a cloud showing short-term momentum:
emaFast = ta.ema(close, 9) // Short-term momentum
emaSlow = ta.ema(close, 21) // Medium-term trend
// Cloud color
emaCloudBullish = emaFast > emaSlow
emaCloudBearish = emaFast < emaSlow
EMA Cloud significance:
Fast EMA above Slow EMA = bullish momentum
Fast EMA below Slow EMA = bearish momentum
Cloud acts as dynamic support/resistance
Cloud thickness indicates momentum strength
Price above cloud = bullish, below cloud = bearish
The indicator fills the area between fast and slow EMAs with color based on direction (green for bullish, red for bearish).
3. Key Institutional Moving Averages
Three widely-watched institutional moving averages:
sma50 = ta.sma(close, 50) // Short-term institutional trend
sma200 = ta.sma(close, 200) // Long-term institutional trend
ema200 = ta.ema(close, 200) // Alternative long-term trend
// Golden Cross / Death Cross
goldenCross = sma50 > sma200 // Bullish long-term
deathCross = sma50 < sma200 // Bearish long-term
Key MA significance:
SMA 50: Short-term institutional trend, strong support/resistance
SMA 200: Most watched long-term trend indicator globally
EMA 200: More responsive alternative to SMA 200
Golden Cross: SMA 50 crosses above SMA 200 = major bullish signal
Death Cross: SMA 50 crosses below SMA 200 = major bearish signal
These MAs are plotted with distinct colors and act as major support/resistance levels.
4. Comprehensive Crossover Detection
The indicator detects multiple types of crossovers:
// Golden Cross / Death Cross (major signals)
goldenCross = ta.crossover(sma50, sma200)
deathCross = ta.crossunder(sma50, sma200)
// EMA Cloud crossovers (momentum shifts)
emaBullCross = ta.crossover(emaFast, emaSlow)
emaBearCross = ta.crossunder(emaFast, emaSlow)
// HMA fast crossovers (early trend changes)
hmaFastBullCross = ta.crossover(hma8, hma13)
hmaFastBearCross = ta.crossunder(hma8, hma13)
Crossover hierarchy:
Golden/Death Cross: Major long-term trend changes (rare, very significant)
EMA Crossovers: Medium-term momentum shifts (moderate frequency)
HMA Crossovers: Short-term trend changes (frequent, early signals)
The indicator marks crossovers with shapes: circles for Golden/Death Cross, triangles for EMA crossovers, diamonds for HMA crossovers.
5. Trend Strength Analytics
Comprehensive trend strength calculation:
// Calculate alignment score
alignmentScore = 0
alignmentScore := (close > hma8 ? 1 : -1) +
(close > hma13 ? 1 : -1) +
(close > hma21 ? 1 : -1) +
(close > hma34 ? 1 : -1) +
(close > hma55 ? 1 : -1) +
(close > emaFast ? 1 : -1) +
(close > emaSlow ? 1 : -1) +
(close > sma50 ? 1 : -1) +
(close > sma200 ? 1 : -1)
// Normalize to 0-100 scale
trendStrength = (alignmentScore + 9) / 18 * 100
Trend Strength interpretation:
75-100: STRONG BULL - price above all MAs, high-quality uptrend
55-74: BULL - price above most MAs, moderate uptrend
45-54: NEUTRAL - mixed signals, no clear trend
26-44: BEAR - price below most MAs, moderate downtrend
0-25: STRONG BEAR - price below all MAs, high-quality downtrend
Example showing full HMA alignment with 55% trend strength score
Confluence Scoring System
The indicator calculates a confluence score showing agreement between different MA systems:
Confluence Score Components:
- HMA Trend: +3 if full alignment, 0 if mixed, -3 if opposite
- EMA Cloud: +2 if bullish, -2 if bearish
- Price vs SMA 50: +1 if above, -1 if below
- Price vs SMA 200: +2 if above, -2 if below
- SMA 50 vs 200: +2 if golden cross, -2 if death cross
Total Range: -10 to +10
Confluence interpretation:
+8 to +10: STRONG confluence - all systems aligned bullish
+5 to +7: MODERATE confluence - most systems bullish
-4 to +4: WEAK confluence - mixed or conflicting signals
-7 to -5: MODERATE confluence - most systems bearish
-10 to -8: STRONG confluence - all systems aligned bearish
Enhanced Dashboard System
The dashboard (top-right position) displays 9 rows:
Row 1: MA System header
Row 2: Trend classification (STRONG BULL/BULL/NEUTRAL/BEAR/STRONG BEAR)
Row 3: Trend Strength percentage (0-100%)
Row 4: HMA Alignment status (Bullish/Bearish/Mixed)
Row 5: EMA Cloud status (Bullish/Bearish)
Row 6: Price vs 200 MA (Above/Below)
Row 7: 50 vs 200 MA (Golden/Death)
Row 8: Confluence score (-10 to +10)
Row 9: Confluence strength (STRONG/MODERATE/WEAK)
Dashboard showing trend metrics with color-coded confluence score
Visual Elements
HMA Ribbon: 5 HMA lines with gradient coloring (green to red) and fills between lines
EMA Cloud: Filled area between fast and slow EMAs with transparency
SMA 50: Blue line (short-term institutional trend)
SMA 200: Orange line (long-term institutional trend)
EMA 200: Purple line (alternative long-term trend)
Golden/Death Cross Markers: Large circles at major crossovers
EMA Cross Markers: Small triangles at EMA crossovers
HMA Cross Markers: Tiny diamonds at HMA crossovers
Dashboard: Comprehensive table with all trend metrics
How Components Work Together
The mashup creates layered trend analysis:
Layer 1 - Micro Trend: HMA 8/13 crossovers show earliest trend changes
Layer 2 - Short-Term Momentum: EMA cloud shows momentum direction
Layer 3 - Medium-Term Trend: HMA 21/34/55 ribbon shows established trend
Layer 4 - Institutional Trend: SMA 50/200 show long-term institutional bias
Layer 5 - Synthesis: Trend strength and confluence scores combine all layers
Example scenario: HMA 8 crosses above HMA 13 (Layer 1), EMA cloud turns bullish (Layer 2), all 5 HMAs align bullish (Layer 3), price is above SMA 50 and SMA 200 in golden cross (Layer 4). Trend strength reaches 92% and confluence score is +9 (Layer 5), signaling extremely strong uptrend with all systems aligned.
Input Parameters
HMA Ribbon Settings:
Show HMA Ribbon: Toggle ribbon display (default: enabled)
HMA 1 Length: Fastest HMA (default: 8)
HMA 2 Length: (default: 13)
HMA 3 Length: (default: 21)
HMA 4 Length: (default: 34)
HMA 5 Length: Slowest HMA (default: 55)
EMA Cloud Settings:
Show EMA Cloud: Toggle cloud display (default: enabled)
Fast EMA: Short-term EMA (default: 9)
Slow EMA: Medium-term EMA (default: 21)
Cloud Transparency: Adjust fill transparency (default: 85)
Key MA Settings:
Show SMA 50: Toggle SMA 50 (default: enabled)
Show SMA 200: Toggle SMA 200 (default: enabled)
Show EMA 200: Toggle EMA 200 (default: enabled)
Crossover Settings:
Show Crossovers: Toggle crossover markers (default: enabled)
Show Golden/Death Cross: Major crossovers (default: enabled)
Show EMA Crossovers: EMA cloud crossovers (default: enabled)
Show HMA Crossovers: HMA fast crossovers (default: enabled)
Display Options:
Show Trend Strength: Toggle dashboard (default: enabled)
Ribbon Transparency: Adjust HMA fill transparency (default: 70)
Dashboard Position: Top-right, top-left, etc.
Color Theme: Choose color scheme
How to Use This Indicator
Step 1: Check HMA Ribbon Alignment
Look for full alignment (all 5 HMAs in order). Full alignment indicates strong, high-quality trend worth following.
Step 2: Verify EMA Cloud Direction
Ensure EMA cloud supports HMA direction. Bullish HMA + bullish EMA cloud = strong confirmation.
Step 3: Check Key MA Position
Verify price is above SMA 50 and SMA 200 for long trades, below for short trades. Golden Cross adds significant bullish weight.
Step 4: Review Trend Strength
Check dashboard trend strength percentage. Above 70% indicates strong trend, below 40% suggests caution.
Step 5: Assess Confluence Score
Review confluence score. Scores above +7 indicate strong multi-system alignment. Scores near 0 suggest mixed signals.
Step 6: Watch for Crossovers
Monitor crossover markers. Golden/Death Cross are major signals. HMA crossovers provide early trend change warnings.
Best Practices
Use on 1-hour to daily timeframes for optimal trend identification
Full HMA alignment (5/5) produces highest-quality trend-following opportunities
EMA cloud acts as dynamic support/resistance - use for entry refinement
Golden Cross with full HMA alignment = extremely strong bullish setup
Trend strength above 80% suggests strong trend continuation potential
Confluence score above +8 indicates rare, high-probability trend alignment
HMA crossovers provide early warnings but confirm with other layers
Wide ribbon spacing indicates strong momentum, narrow spacing suggests consolidation
Combine with price action and key levels for precise entries
Indicator Limitations
Moving averages are lagging indicators - trends confirmed after they've started
HMA crossovers can produce false signals in choppy markets
Full alignment is rare - waiting only for perfect setups may miss opportunities
Trend strength can remain high even as trend is ending
Golden/Death Cross signals are very lagging (occur well after trend change)
Multiple MAs can clutter chart - adjust display settings as needed
Confluence score is mathematical calculation, not prediction
Strong trends can reverse suddenly despite high trend strength scores
Requires understanding of moving average concepts for effective use
Technical Implementation
Built with Pine Script v6 using:
Custom Hull Moving Average calculation with WMA and square root period
5-layer HMA ribbon with gradient fills
EMA cloud with dynamic coloring
Key institutional MA tracking (SMA 50/200, EMA 200)
Multiple crossover detection systems
Comprehensive trend strength algorithm
Confluence scoring with weighted components
9-row dashboard with real-time metrics
Alert conditions for all major crossovers
The code is fully open-source and can be modified to adjust MA periods, colors, and dashboard layout.
Originality Statement
This indicator is original in its multi-layer moving average integration approach. While individual components (HMA, EMA cloud, SMA 50/200, crossovers) are established tools, this mashup is justified because:
It combines three different MA calculation methods (HMA, EMA, SMA) that respond differently to price
5-layer HMA ribbon provides granular trend quality assessment
Trend strength algorithm quantifies alignment across all 9 moving averages
Confluence scoring shows agreement between different MA systems
Integration of micro (HMA/EMA) and macro (SMA 50/200) trend perspectives
Comprehensive dashboard presents complex multi-MA data clearly
Each MA type contributes unique information: HMAs provide responsive trend indication with minimal lag, EMAs show short-term momentum, and SMAs provide institutional reference levels. The mashup's value lies in showing when these different calculation methods align, indicating genuine trend strength across multiple mathematical approaches and timeframes.
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.
Moving averages are lagging indicators that confirm trends after they've begun. They do not predict future price movement. Strong trends can reverse suddenly, and high trend strength scores do not guarantee trend continuation. Golden Cross and Death Cross signals are very lagging and trends may be well-established before these signals occur.
The trend strength and confluence scores are mathematical calculations based on current MA positions, not predictions of future price movement. Past trend strength does not guarantee future performance. Market conditions change, and trends that appear strong can reverse without warning.
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
