Quantum Candle Scanner [JOAT]
Quantum Candle Scanner - Advanced Multi-Pattern Recognition System
Introduction and Purpose
Quantum Candle Scanner is an open-source overlay indicator that detects multiple candlestick patterns including engulfing patterns, kicker patterns, inside bar setups, momentum candles, and higher-high/lower-low sequences. The core problem this indicator solves is that traders often miss patterns because they're looking for only one type. Different patterns work better in different market conditions.
This indicator addresses that by scanning for five distinct pattern types simultaneously, giving traders a comprehensive view of price action signals.
Why These Five Pattern Types Work Together
Each pattern type identifies different market behavior:
1. Engulfing Patterns - Classic reversal signals where current candle completely engulfs the previous candle. Best for identifying potential turning points.
2. Kicker Patterns - Strong reversal signals with gap confirmation. The current candle opens beyond the previous candle's open with opposite direction. Best for identifying high-momentum reversals.
3. Inside Bar Patterns - Consolidation breakout signals where a candle's range is contained within the previous candle, followed by a breakout. Best for identifying compression before expansion.
4. Momentum Candles - Identifies the largest body candle over a lookback period. Best for spotting institutional activity.
5. HH/HL and LH/LL Sequences - Three-bar structure patterns showing trend continuation. Best for confirming trend direction.
How the Detection Works
Engulfing Pattern:
bool engulfBullBase = open <= math.min(close , open ) and
close >= math.max(close , open ) and
isBullish(0) and
getBodyPct(0) > bodyMinPct
Kicker Pattern:
bool kickerBull = isBearish(1) and isBullish(0) and
open > open and low > low and
getBodyPct(0) > 40 and getBodyPct(1) > 40
Inside Bar:
bool insideBarSetup = low < low and high > high
bool insideBarBull = insideBarSetup and isBullish(0)
HH/HL Sequence:
bool hhhlSeq = high > high and low > low and
high > high and low > low and
close > close
Optional Filters
ATR Filter - Only shows patterns where candle body exceeds ATR (strong candles only)
Body Minimum % - Requires minimum body percentage for engulfing patterns
Close Beyond Prior H/L - Requires engulfing candle to close beyond prior high/low
Dashboard Information
Engulfing - Total engulfing patterns detected
Kicker - Kicker pattern count
Inside Bar - Inside bar breakout count
HH/LL Seq - Structure sequence count
Total - Combined pattern count
How to Use This Indicator
For Reversal Trading:
1. Look for engulfing or kicker patterns at key support/resistance
2. Confirm with HH/HL or LH/LL sequence breaking
3. Enter with stop beyond the pattern
For Breakout Trading:
1. Identify inside bar setups (consolidation)
2. Enter on breakout candle in direction of break
3. Use the inside bar range for stop placement
For Trend Confirmation:
1. Use HH/HL sequences to confirm uptrend structure
2. Use LH/LL sequences to confirm downtrend structure
3. Momentum candles indicate institutional participation
Input Parameters
Detect Engulfing/Kicker/Inside Bar/Momentum/HHLL (all true) - Toggle each pattern type
Min Body % for Engulfing (0) - Minimum body percentage
ATR Filter (false) - Only show strong candles
Engulf Must Close Beyond Prior H/L (true) - Stricter engulfing definition
Compact Mode (false) - Shorter labels for cleaner charts
Timeframe Recommendations
1H-Daily: Best for reliable pattern detection
15m-30m: More patterns but higher noise
Use Compact Mode on lower timeframes
Limitations
Pattern detection is mechanical and does not consider context
Not all patterns lead to successful trades
Kicker patterns are rare but powerful
Inside bar breakouts can fail (false breakouts)
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes.
This indicator does not constitute financial advice. Pattern detection does not guarantee trade outcomes. Always use proper risk management.
- Made with passion by officialjackofalltrades
Tradingviewindicator
Zenith MACD Evolution [JOAT]
Zenith MACD Evolution - Volatility-Normalized Momentum Oscillator
Introduction and Purpose
Zenith MACD Evolution is an open-source oscillator indicator that takes the classic MACD and normalizes it by ATR (Average True Range) to create consistent overbought/oversold levels across different market conditions. The core problem this indicator solves is that traditional MACD values are incomparable across different volatility regimes. A MACD reading of 50 might be extreme in a quiet market but normal in a volatile one.
This indicator addresses that by dividing MACD by ATR and scaling to a consistent range, allowing traders to use fixed overbought/oversold levels that work across all market conditions.
Why ATR Normalization Works
Traditional MACD problems:
- Values vary wildly based on price and volatility
- No consistent overbought/oversold levels
- Hard to compare across different instruments
- Extreme readings in one period may be normal in another
ATR-normalized MACD (Zenith) solves these:
- Values scaled to consistent range
- Fixed overbought/oversold levels work across all conditions
- Comparable across different instruments
- Extreme readings are truly extreme regardless of volatility
How the Normalization Works
// Classic MACD
= ta.macd(close, fastLength, slowLength, signalLength)
// ATR for normalization
float atrValue = ta.atr(atrNormLength)
// Volatility-Normalized MACD
float zenithMACD = atrValue != 0 ? (histLine / atrValue) * 100 : 0
float zenithSignal = ta.ema(zenithMACD, signalLength)
The result is a MACD that typically ranges from -200 to +200, with consistent levels:
- Above +150 = Overbought
- Below -150 = Oversold
- Above +200 = Extreme overbought
- Below -200 = Extreme oversold
Signal Types
Zero Cross Up/Down - Zenith crosses zero line (trend change)
Overbought/Oversold Entry - Zenith enters extreme zones
Overbought/Oversold Exit - Zenith leaves extreme zones (potential reversal)
Momentum Shift - Histogram direction changes (early warning)
Divergence - Price makes new high/low but Zenith does not
Histogram Coloring
The histogram uses four colors to show momentum state:
- Strong Bull (Teal) - Positive and rising
- Weak Bull (Light Teal) - Positive but falling
- Strong Bear (Red) - Negative and falling
- Weak Bear (Light Red) - Negative but rising
This helps identify momentum shifts before crossovers occur.
Dashboard Information
Zenith - Current normalized MACD value with signal line
Zone - Current zone (EXTREME OB/OVERBOUGHT/NORMAL/OVERSOLD/EXTREME OS)
Momentum - Direction (RISING/FALLING/FLAT)
Histogram - Current histogram value
ATR Norm - Current ATR value used for normalization
Classic - Traditional MACD value for reference
How to Use This Indicator
For Mean-Reversion:
1. Wait for Zenith to reach extreme zones (+200/-200)
2. Look for momentum shift (histogram color change)
3. Enter counter-trend when exiting extreme zone
For Trend Following:
1. Enter long on zero cross up
2. Enter short on zero cross down
3. Use histogram color to gauge momentum strength
For Divergence Trading:
1. Watch for DIV labels (price vs Zenith divergence)
2. Bullish divergence at support = potential long
3. Bearish divergence at resistance = potential short
Input Parameters
Fast/Slow/Signal Length (12/26/9) - Standard MACD parameters
ATR Normalization Period (26) - Period for ATR calculation
Overbought/Oversold Zone (150/-150) - Zone thresholds
Extreme Level (200) - Extreme threshold
Show Classic MACD Lines (false) - Toggle traditional lines
Show Divergence Detection (true) - Toggle divergence signals
Divergence Lookback (14) - Bars to scan for divergence
Timeframe Recommendations
All timeframes work due to normalization
Higher timeframes provide smoother signals
Normalization makes cross-timeframe comparison meaningful
Limitations
ATR normalization adds slight lag
Divergence detection is simplified
Extreme zones can persist in strong trends
Works best when combined with price action analysis
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes.
This indicator does not constitute financial advice. Momentum analysis does not guarantee profitable trades. Always use proper risk management.
- Made with passion by officialjackofalltrades
Vortex Trend Matrix [JOAT]Vortex Trend Matrix - Multi-Factor Trend Confluence System
Introduction and Purpose
Vortex Trend Matrix is an open-source overlay indicator that combines Ichimoku-style equilibrium analysis with the Vortex Indicator to create a comprehensive trend confluence system. The core problem this indicator solves is that single trend indicators often give conflicting signals. Price might be above a moving average but momentum might be weakening.
This indicator addresses that by combining five different trend factors into a single composite score, making it easy to identify when multiple factors align for high-probability trend trades.
Why These Components Work Together
Each component measures trend from a different perspective:
1. Cloud Position - Price above/below the equilibrium cloud indicates overall trend bias. The cloud acts as dynamic support/resistance.
2. TK Relationship - Conversion line vs Base line (like Tenkan/Kijun in Ichimoku). Conversion above Base = bullish momentum.
3. Lagging Span - Current price compared to price N bars ago. Confirms whether current move has follow-through.
4. Vortex Indicator - VI+ vs VI- measures directional movement strength. Provides momentum confirmation.
5. Base Direction - Whether the base line is rising or falling. Indicates medium-term trend direction.
How the Trend Score Works
float trendScore = 0.0
// Cloud position (+2/-2)
trendScore += aboveCloud ? 2.0 : belowCloud ? -2.0 : 0.0
// TK relationship (+1/-1)
trendScore += conversionLine > baseLine ? 1.0 : conversionLine < baseLine ? -1.0 : 0.0
// Lagging span (+1/-1)
trendScore += laggingBull ? 1.0 : laggingBear ? -1.0 : 0.0
// Vortex (+1.5/-1.5)
trendScore += vortexBull ? 1.5 : vortexBear ? -1.5 : 0.0
// Base direction (+0.5/-0.5)
trendScore += baseDirection * 0.5
Score ranges from approximately -6 to +6:
- +4 or higher = STRONG BULL
- +2 to +4 = BULL
- -2 to +2 = NEUTRAL
- -4 to -2 = BEAR
- -4 or lower = STRONG BEAR
Signal Types
TK Cross Up/Down - Conversion line crosses Base line (momentum shift)
Base Direction Change - Base line changes direction (medium-term shift)
Strong Bull/Bear Trend - Score reaches +4/-4 (high confluence)
Dashboard Information
Trend - Overall status with composite score
Cloud - Price position (ABOVE/BELOW/INSIDE)
TK Cross - Conversion vs Base relationship
Lagging - Lagging span bias
Vortex - VI+/VI- relationship
VI+/VI- - Individual vortex values
How to Use This Indicator
For Trend Following:
1. Enter long when trend score reaches +4 or higher (STRONG BULL)
2. Enter short when trend score reaches -4 or lower (STRONG BEAR)
3. Use cloud as dynamic support/resistance for entries
For Momentum Timing:
1. Watch for TK Cross signals for entry timing
2. Base direction changes indicate medium-term shifts
3. Vortex confirmation adds conviction
For Risk Management:
1. Exit when trend score drops to neutral
2. Use cloud edges as stop-loss references
3. Reduce position when score weakens
Input Parameters
Conversion Period (9) - Fast equilibrium line
Base Period (26) - Slow equilibrium line
Lead Span Period (52) - Cloud projection period
Displacement (26) - Cloud and lagging span offset
Vortex Period (14) - Period for vortex calculation
VI+ Strength (1.10) - Threshold for strong bullish vortex
VI- Strength (0.90) - Threshold for strong bearish vortex
Timeframe Recommendations
4H-Daily: Best for equilibrium-based analysis
1H: Good for intraday trend following
Lower timeframes may require adjusted periods
Limitations
Equilibrium calculations have inherent lag
Cloud displacement means signals are delayed
Works best in trending markets
May whipsaw in ranging conditions
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes.
This indicator does not constitute financial advice. Trend analysis does not guarantee profitable trades. Always use proper risk management.
- Made with passion by officialjackofalltrades
RED BULL WINGS [JOAT]RED BULL WINGS - Bullish-Only Institutional Overlay
Introduction and Purpose
RED BULL WINGS is an open-source overlay indicator that combines five distinct bullish detection methods into a single composite scoring system. The core problem this indicator solves is that individual bullish signals (patterns, volume, zones, trendlines) often disagree or fire in isolation. A bullish engulfing pattern means little if volume is weak and price is far from support. Traders need confluence across multiple dimensions to identify high-probability setups.
This indicator addresses that by scoring each bullish component separately, then combining them into a weighted WINGS score (0-100) that reflects overall bullish conviction. When multiple components align, the score rises; when they disagree, the score stays low.
Why These Five Modules Work Together
Each module measures a different aspect of bullish market structure:
1. Module A - Bullish Candlestick Engine - Detects classic reversal patterns (engulfing, marubozu, hammer, 3-bar cluster). These patterns identify WHERE buyers are stepping in.
2. Module B - PVSRA Volume Climax - Measures spread x volume to detect institutional participation. This tells you WHETHER smart money is involved.
3. Module C - Demand Zone Detection - Identifies and tracks order block zones where buyers previously overwhelmed sellers. This shows you WHERE institutional support exists.
4. Module D - Trendline Channel - Builds dynamic support/resistance from pivot points. This reveals the STRUCTURE of the current trend.
5. Module E - Ichimoku Assist - Optional filter using Tenkan/Kijun cross, cloud position, and Chikou confirmation. This provides TREND PERMISSION context.
The combination works because:
Patterns alone can fail without volume confirmation
Volume alone means nothing without price structure context
Zones alone are static without pattern/volume triggers
Trendlines alone miss the micro-level entry timing
When 3+ modules agree, the probability of a valid bullish setup increases significantly
How the Calculations Work
Module A - Pattern Detection:
Bullish Engulfing - Current bullish bar completely engulfs prior bearish bar:
bool engulfingCond = isBullish() and
isBearish() and
open <= close and
close >= open and
bodySize() > bodySize()
Marubozu - Strong body with minimal wicks (body >= 1.8x average, wick ratio < 20%):
float wickRatio = candleRange() > 0 ? (upperWick() + lowerWick()) / candleRange() : 0
bool marubozuCond = isBullish() and
bodySize() >= bodySizeAvg * i_maruMult and
wickRatio < i_wickRatioMax
Hammer - Long lower wick (>= 2.5x body), close in upper third, volume confirmation:
bool hammerWick = lowerWick() >= i_hammerWickMult * bodySize()
bool hammerClose = close >= low + (candleRange() * 0.66)
bool hammerVol = volume >= i_pvsraRisingMult * volAvg
3-Bar Cluster - Three consecutive bullish closes with increasing prices and volume spike:
bool threeBarBullish = isBullish() and isBullish() and isBullish()
bool increasingCloses = close > close and close > close
bool volSpike3Bar = volume >= i_pvsraRisingMult * volAvg or
volume >= i_pvsraRisingMult * volAvg
Module B - PVSRA Volume Analysis:
Uses spread x volume to detect climax conditions:
float spreadVol = candleRange() * volume
float maxSpreadVol = ta.highest(spreadVol, ADJ_PVSRA_LOOKBACK)
bool volClimax = volume >= i_pvsraClimaxMult * volAvg or spreadVol >= maxSpreadVol
bool volRising = volume >= i_pvsraRisingMult * volAvg and volume < i_pvsraClimaxMult * volAvg
Volume only scores when the candle is bullish, preventing false signals on bearish volume spikes.
Module C - Demand Zone Detection:
Identifies zones using a two-candle structure:
// Small bearish candle A followed by larger bullish candle B
bool candleA_bearish = isBearish()
bool candleB_bullish = isBullish()
bool newZoneCond = candleA_bearish and candleB_bullish and
candleB_size >= i_zoneSizeMult * candleA_size
Zones are drawn as rectangles and tracked for retests. Score increases when price is near or inside an active zone, with bonus points for rejection candles.
Module D - Trendline Channel:
Builds dynamic channel from confirmed pivot points:
float ph = ta.pivothigh(high, i_pivotLeft, i_pivotRight)
float pl = ta.pivotlow(low, i_pivotLeft, i_pivotRight)
Pivots are stored and connected to form upper/lower channel lines. The indicator detects breakouts when price closes beyond the channel with volume confirmation.
Module E - Ichimoku Assist:
Standard Ichimoku calculations with bullish scoring:
float tenkan = (ta.highest(high, i_tenkanLen) + ta.lowest(low, i_tenkanLen)) / 2
float kijun = (ta.highest(high, i_kijunLen) + ta.lowest(low, i_kijunLen)) / 2
bool tkCross = ta.crossover(tenkan, kijun)
bool priceAboveCloud = close > cloudTop
bool chikouAbovePrice = chikou > close
Module F - WINGS Composite Score:
All module scores are combined using adjustable weights:
float WINGS_score = 100 * (nW_pattern * S_pattern +
nW_volume * S_vol +
nW_zone * S_zone +
nW_trend * S_trend +
nW_ichi * S_ichi)
Default weights: Pattern 30%, Volume 25%, Zone 20%, Trend 15%, Ichimoku 10%.
Signal Thresholds
WATCH (30-49) - Interesting bullish context forming, not yet actionable
MOMENTUM (50-74) - Strong bullish conditions, multiple modules agreeing
LIFT-OFF (75+) - High-confidence bullish confluence across most modules
WINGS Badge (Dashboard)
The right-side panel displays:
WINGS Score - Current composite score (0-100)
Pattern - Active pattern name and strength, or neutral placeholder
Volume - Normal / Rising / CLIMAX status
Zone - ACTIVE if price is near a demand zone
Trend - Channel position or BREAK status
Ichimoku - OFF / Weak / Bullish / STRONG
Status - Overall signal level (Neutral / WATCH / MOMENTUM / LIFT-OFF)
Input Parameters
Module Toggles:
Enable Bullish Patterns (true) - Toggle pattern detection
Enable PVSRA Volume (true) - Toggle volume analysis
Enable Order Blocks (true) - Toggle demand zone detection
Enable Trendlines (true) - Toggle pivot channel
Enable Ichimoku Assist (false) - Toggle Ichimoku filter (off by default for performance)
Enable Visual Effects (false) - Toggle labels, trails, and visual elements
LIVE MODE (false) - Enable intrabar signals (WARNING: signals may repaint)
Pattern Engine:
Pattern Lookback (5) - Bars for body size averaging
Marubozu Body Multiplier (1.8) - Minimum body size vs average
Hammer Wick Multiplier (2.5) - Minimum lower wick vs body
Max Wick Ratio (0.2) - Maximum wick percentage for marubozu
Volume / PVSRA:
PVSRA Lookback (10) - Period for volume averaging
Climax Multiplier (2.0) - Volume threshold for climax detection
Rising Volume Multiplier (1.5) - Volume threshold for rising detection
Order Blocks:
Zone Size Multiplier (2.0) - Minimum bullish candle size vs bearish
Zone Extend Bars (200) - How far zones project forward
Max Zones (12) - Maximum active zones displayed
Remove Zone on Close Below (true) - Delete broken zones
Trendlines:
Pivot Left/Right Bars (3/3) - Pivot detection sensitivity
Min Slope % (0.25) - Minimum trendline angle
Max Trendlines (5) - Maximum pivot points stored
Trendline Projection Bars (60) - Forward projection distance
Ichimoku:
Tenkan Length (9) - Conversion line period
Kijun Length (26) - Base line period
Senkou B Length (52) - Leading span B period
Displacement (26) - Cloud displacement
WINGS Score:
Weight: Pattern (0.30) - Pattern contribution to score
Weight: Volume (0.25) - Volume contribution to score
Weight: Zone (0.20) - Zone contribution to score
Weight: Trend (0.15) - Trendline contribution to score
Weight: Ichimoku (0.10) - Ichimoku contribution to score
Lift-Off Threshold (75) - Score required for LIFT-OFF signal
Momentum Watch Threshold (50) - Score required for MOMENTUM signal
Visuals:
Signal Cooldown (8) - Minimum bars between labels
Show WINGS Score Badge (true) - Toggle dashboard
Show Wing Combos (true) - Show DOUBLE/MEGA WINGS streaks
Red Background Wash (true) - Tint chart background
Show Lift-Off Trails (false) - Toggle golden trail visuals
How to Use This Indicator
For Bullish Entry Identification:
1. Monitor the WINGS badge for score changes
2. Wait for MOMENTUM (50+) or LIFT-OFF (75+) signals
3. Check which modules are contributing (Pattern + Volume + Zone = stronger)
4. Use demand zones and trendlines as structural reference for entries
For Confluence Confirmation:
1. Use alongside your existing analysis
2. LIFT-OFF signals indicate multiple bullish factors aligning
3. Low scores (< 30) suggest weak bullish context even if one factor looks good
For Zone-Based Trading:
1. Watch for price approaching active demand zones
2. Look for pattern + volume confirmation at zone retests
3. Zone score increases with successful retests
For Trendline Analysis:
1. Monitor the pivot-based channel for trend structure
2. Breakouts with volume confirmation trigger TREND BREAK alerts
3. Price inside channel with bullish patterns = trend continuation setup
1M and lower timeframes:
Alerts Available
LIFT-OFF - High-confidence bullish confluence
MOMENTUM - Strong bullish conditions
Zone Retest - Bullish rejection from demand zone
Trendline Break - Breakout with volume confirmation
Individual patterns (Engulfing, Marubozu, Hammer, 3-Bar Cluster)
Volume Climax - Institutional volume spike
DOUBLE WINGS / MEGA WINGS - Consecutive lift-off signals
Repainting Behavior
By default, the indicator uses confirmed bars only (barstate.isconfirmed), meaning signals appear after the bar closes and do not repaint. However:
LIVE MODE - When enabled, signals can appear intrabar but may disappear if conditions change before bar close. A warning label displays when LIVE MODE is active.
Trendlines - Pivot detection requires lookback bars, so the most recent trendline segments may adjust as new pivots confirm. This is inherent to pivot-based analysis.
Demand Zones - Zones are created on confirmed bars and do not repaint, but they can be removed if price closes below the zone bottom (configurable).
Live Mode with 'Enable Visual Effect' turned off in settings:
Limitations
This is a bullish-only indicator. It does not detect bearish setups or provide short signals.
The WINGS score is a confluence measure, not a prediction. High scores indicate favorable conditions, not guaranteed outcomes.
Pattern detection uses simplified logic. Not all candlestick nuances are captured.
Volume analysis requires reliable volume data. Results may vary on instruments with inconsistent volume reporting.
Ichimoku calculations add processing overhead. Disable if not needed.
Demand zones are based on a specific two-candle structure. Other valid zones may not be detected.
Trendlines use linear regression between pivots. Curved or complex channels are not supported.
Timeframe Recommendations
15m-1H: More frequent signals, useful for intraday analysis. Higher noise.
4H-Daily: Best balance of signal quality and frequency for swing trading.
Weekly: Fewer but more significant signals for position trading.
Adjust lookback periods and thresholds based on your timeframe. Shorter timeframes may benefit from shorter lookbacks.
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. The source code is fully visible and can be studied to understand how each module works.
This indicator does not constitute financial advice. The WINGS score and signals do not guarantee profitable trades. Past performance does not guarantee future results. Always use proper risk management, position sizing, and stop-losses. Test thoroughly on your preferred instruments and timeframes before using in live trading.
- Made with passion by officialjackofalltrades
Quantum Reversal Detector [JOAT]
Quantum Reversal Detector - Multi-Factor Reversal Probability Analysis
Introduction and Purpose
Quantum Reversal Detector is an open-source overlay indicator that combines multiple reversal detection methods into a unified probability-based framework. The core problem this indicator addresses is the unreliability of single-factor reversal signals. A price touching support means nothing without momentum confirmation; an RSI oversold reading means nothing without price structure context.
This indicator solves that by requiring multiple independent factors to align before generating reversal signals, then expressing the result as a probability score rather than a binary signal.
Why These Components Work Together
The indicator combines five analytical approaches, each addressing a different aspect of reversal detection:
1. RSI Extremes - Identifies momentum exhaustion (overbought/oversold)
2. MACD Crossovers - Confirms momentum direction change
3. Support/Resistance Proximity - Ensures price is at a significant level
4. Multi-Depth Momentum - Analyzes momentum across multiple timeframes
5. Statistical Probability - Quantifies reversal likelihood using Bayesian updating
These components are not randomly combined. Each filter catches reversals that others miss:
RSI catches momentum exhaustion but misses structural reversals
MACD catches momentum shifts but lags price action
S/R proximity catches structural levels but ignores momentum
Multi-depth momentum catches divergences across timeframes
Probability scoring combines all factors into actionable confidence levels
How the Detection System Works
Step 1: Pattern Detection
The indicator first identifies potential reversal conditions:
// Check if price is at support/resistance
float lowestLow = ta.lowest(low, period)
float highestHigh = ta.highest(high, period)
bool atSupport = low <= lowestLow * 1.002
bool atResistance = high >= highestHigh * 0.998
// Check RSI conditions
float rsi = ta.rsi(close, 14)
bool oversold = rsi < 30
bool overbought = rsi > 70
// Check MACD crossover
float macd = ta.ema(close, 12) - ta.ema(close, 26)
float signal = ta.ema(macd, 9)
bool macdBullish = ta.crossover(macd, signal)
bool macdBearish = ta.crossunder(macd, signal)
// Combine for reversal detection
if atSupport and oversold and macdBullish
bullishReversal := true
Step 2: Multi-Depth Momentum Analysis
The indicator calculates momentum across multiple periods to detect divergences:
calculateQuantumMomentum(series float price, simple int period, simple int depth) =>
float totalMomentum = 0.0
for i = 0 to depth - 1
int currentPeriod = period * (i + 1)
float momentum = ta.roc(price, currentPeriod)
totalMomentum += momentum
totalMomentum / depth
This creates a composite momentum reading that smooths out noise while preserving genuine momentum shifts.
Step 3: Bayesian Probability Calculation
The indicator uses Bayesian updating to calculate reversal probability:
bayesianProbability(series float priorProb, series float likelihood, series float evidence) =>
float posterior = evidence > 0 ? (likelihood * priorProb) / evidence : priorProb
math.min(math.max(posterior, 0.0), 1.0)
The prior probability starts at 50% and updates based on:
RSI extreme readings increase likelihood
MACD crossovers increase likelihood
S/R proximity increases likelihood
Momentum divergence increases likelihood
Step 4: Confidence Intervals
Using Monte Carlo simulation concepts, the indicator estimates price distribution:
monteCarloSimulation(series float price, series float volatility, simple int iterations) =>
float sumPrice = 0.0
float sumSqDiff = 0.0
for i = 0 to iterations - 1
float randomFactor = (i % 10 - 5) / 10.0
float simulatedPrice = price + volatility * randomFactor
sumPrice += simulatedPrice
float avgPrice = sumPrice / iterations
// Calculate standard deviation for confidence intervals
This provides 95% and 99% confidence bands around the current price.
Signal Classification
Signals are classified by confirmation level:
Confirmed Reversal : Pattern detected for N consecutive bars (default 3)
High Probability : Confirmed + Bayesian probability > 70%
Ultra High Probability : High probability + PDF above average
Dashboard Information
The dashboard displays:
Bayesian Probability - Updated reversal probability (0-100%)
Quantum Momentum - Multi-depth momentum average
RSI - Current RSI value with overbought/oversold status
Volatility - Current ATR as percentage of price
Reversal Signal - BULLISH, BEARISH, or NONE
Divergence - Momentum divergence detection
MACD - Current MACD histogram value
S/R Zone - AT SUPPORT, AT RESISTANCE, or NEUTRAL
95% Confidence - Price range with 95% probability
Bull/Bear Targets - ATR-based reversal targets
Visual Elements
Quantum Bands - ATR-based upper and lower channels
Probability Field - Circle layers showing probability distribution
Confidence Bands - 95% and 99% confidence interval circles
Reversal Labels - REV markers at confirmed reversals
High Probability Markers - Star diamonds at high probability setups
Reversal Zones - Boxes around confirmed reversal areas
Divergence Markers - Triangles at momentum divergences
How to Use This Indicator
For Reversal Trading:
1. Wait for Bayesian Probability to exceed 70%
2. Confirm price is at S/R zone (dashboard shows AT SUPPORT or AT RESISTANCE)
3. Check that RSI is in extreme territory (oversold for longs, overbought for shorts)
4. Enter when REV label appears with high probability marker
For Risk Management:
1. Use the 95% confidence band as a stop-loss reference
2. Use Bull/Bear Targets for take-profit levels
3. Higher probability readings warrant larger position sizes
For Filtering False Signals:
1. Increase Confirmation Bars to require more consecutive signals
2. Only trade when probability exceeds 70%
3. Require divergence confirmation for highest conviction
Input Parameters
Reversal Period (21) - Lookback for S/R and momentum calculations
Quantum Depth (5) - Number of momentum layers for multi-depth analysis
Confirmation Bars (3) - Consecutive bars required for confirmation
Detection Sensitivity (1.2) - Band width and target multiplier
Bayesian Probability (true) - Enable probability calculation
Monte Carlo Simulation (true) - Enable confidence interval calculation
Normal Distribution (true) - Enable PDF calculation
Confidence Intervals (true) - Enable confidence bands
Timeframe Recommendations
1H-4H: Best for swing trading reversals
Daily: Fewer but more significant reversal signals
15m-30m: More signals, requires higher probability threshold
Limitations
Statistical concepts are simplified implementations for Pine Script
Monte Carlo uses deterministic pseudo-random factors, not true randomness
Bayesian probability uses simplified prior/likelihood model
Reversal detection does not guarantee actual reversals will occur
Confirmation bars add lag to signal generation
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. The source code is fully visible and can be studied to understand how each component works.
This indicator does not constitute financial advice. Reversal detection is probabilistic, not predictive. The probability scores represent statistical likelihood based on historical patterns, not guaranteed outcomes. Past performance does not guarantee future results. Always use proper risk management, position sizing, and stop-losses.
- Made with passion by officialjackofalltrades




