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
Pinescripting4traders
Prism Band Dynamics [JOAT]Prism Band Dynamics - Bollinger-Style Bands with Force Detection
Introduction and Purpose
Prism Band Dynamics is an open-source overlay indicator that creates dynamic Bollinger-style bands with an innovative "force detection" system. The core problem this indicator solves is that standard Bollinger Bands show volatility but don't indicate directional momentum. When all three band components (upper, lower, basis) move in the same direction, it indicates strong directional force that standard bands don't highlight.
This indicator addresses that by detecting when all band components align directionally, providing a clear signal of market force.
Why Force Detection Matters
Standard Bollinger Bands expand and contract based on volatility, but they don't tell you about directional momentum. Force detection adds this dimension:
1. Bullish Force - Upper band, lower band, AND basis all moving up together. This indicates strong upward momentum where even the lower support level is rising.
2. Bearish Force - Upper band, lower band, AND basis all moving down together. This indicates strong downward momentum where even the upper resistance level is falling.
3. Neutral - Mixed movement indicates consolidation or uncertainty.
How Force Detection Works
bool upperUp = upper > upper
bool lowerUp = lower > lower
bool basisUp = basis > basis
int forceFull = if upperUp and lowerUp and basisUp
1 // Bullish force
else if upperDn and lowerDn and basisDn
-1 // Bearish force
else
0 // Neutral
Additional Features
Squeeze Detection - Identifies when band width contracts below threshold, often preceding large moves
Gradient Fills - Color intensity reflects force strength
Direction Change Arrows - Visual markers when force direction shifts
Dashboard Information
Force - Current force status (BULLISH/BEARISH/NEUTRAL)
Position - Price location within bands (Upper/Mid/Lower Zone)
Band Width - Current width percentage with expansion/contraction label
Volatility - Squeeze status (SQUEEZE/NORMAL)
Force Count - Bars since last force change
How to Use This Indicator
For Trend Following:
1. Enter long when force turns BULLISH
2. Enter short when force turns BEARISH
3. Exit or reduce when force turns NEUTRAL
For Squeeze Breakouts:
1. Watch for SQUEEZE status in dashboard
2. Prepare for breakout in either direction
3. Enter when force confirms direction after squeeze
For Mean Reversion:
1. Only trade mean-reversion when force is NEUTRAL
2. Avoid fading moves when force is active
3. Use band touches as entry points during neutral force
Input Parameters
Length (20) - Period for basis and standard deviation
Multiplier (2.0) - Standard deviation multiplier for bands
MA Type (SMA) - Basis calculation method
Squeeze Threshold (0.5) - Band width percentage for squeeze detection
Timeframe Recommendations
4H-Daily: Cleanest force signals
1H: Good balance of signals and reliability
15m: More signals but more noise
Limitations
Force detection can lag during rapid reversals
Squeeze breakouts can fail (false breakouts)
Works best in markets with clear trending/ranging phases
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. Force detection does not guarantee trend continuation. Always use proper risk management.
- 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
Level 1 - Learn to code simply - PineScriptThe goal of this script is honestly to help everyone learn about trading with bots and algos.
At least, to get started.
Level 1:
10 lines of code.
learn to plot 2 moving averages on your chart.
learn to create a signal from a crossover.
learn the very basics of Pine Script algo.



