PROTECTED SOURCE SCRIPT
Pattern Detector v3

🔷 WHAT IS THIS INDICATOR?
Pattern Detector v3 is an all-in-one chart pattern recognition and signal engine. It automatically detects 16 classic chart patterns, calculates measured-move price projections for each, and generates BUY/SELL signals using a multi-source confluence system that requires multiple independent indicators to agree before firing.
This is not a single-indicator signal tool — it is a confluence framework that combines pattern recognition with 7 signal sources to filter out noise and deliver higher-probability entries.
🔷 PATTERNS DETECTED (16 Total)
Bearish:
• Head & Shoulders
• Double Top
• Triple Top
• Descending Triangle
• Rising Wedge
• Bear Flag
Bullish:
• Inverse Head & Shoulders
• Double Bottom
• Triple Bottom
• Ascending Triangle
• Falling Wedge
• Bull Flag
Neutral (both directions):
• Symmetrical Triangle
• Ascending Channel
• Descending Channel
• Broadening Formation
Each pattern is detected using pivot-high and pivot-low analysis. When a pattern is confirmed, a measured-move price projection is drawn automatically, giving you a calculated target price based on the pattern's height.
🔷 THE SIGNAL SYSTEM — 7 SOURCES
The indicator does not generate a BUY or SELL signal from a single condition. Instead, it polls 7 independent signal sources and only fires when enough of them agree. This is the confluence engine.
The 7 sources are:
Pattern Breakout — price crosses through the detected pattern's key level (neckline, support, or resistance)
EMA Crossover — fast EMA crosses slow EMA (default 9/21)
RSI Reversal — RSI exits overbought or oversold territory
MACD Cross — MACD line crosses the signal line
Volume Spike — volume exceeds its moving average by a configurable multiplier on a directional candle
VWAP Cross — price crosses above or below the session VWAP
Supertrend Flip — Supertrend indicator changes direction
Each source votes BUY (+1), SELL (-1), or NEUTRAL (0). Votes are summed into a Bull Score and Bear Score (each 0-7). A signal only prints when the score meets your minimum confluence threshold.
Every source can be individually toggled on or off.
🔷 CONFLUENCE ENGINE — HOW IT WORKS
• Min Confluence = 2: Very frequent signals. Good for scalping.
• Min Confluence = 3: Balanced (recommended default). Good for day/swing trading.
• Min Confluence = 4: Fewer, higher-conviction signals. Good for swing/position trading.
• Min Confluence = 5+: Rare but strong signals. Best for higher timeframes.
A signal cooldown (default 10 bars) prevents back-to-back signals so you can manage one trade at a time.
When a signal fires, a small label shows the score (e.g., "4/7") so you can gauge its strength at a glance. A subtle background highlight appears on bars where confluence exceeds the minimum by 1 or more, indicating an especially strong setup.
🔷 REAL-TIME DASHBOARD
A compact on-chart table (position configurable) provides two sections:
Signal Status (top):
Shows a filled or empty circle for each of the 7 signal sources in real time. At a glance you can see exactly what is active and what is driving the current market read. The CONFLUENCE row shows the current aggregate bull/bear score.
Pattern List (bottom):
Lists recently detected patterns with their bias (▲ BULL / ▼ BEAR / ◆ NEUT), calculated price target, and how many bars ago they formed.
🔷 DISPLAY MODES
Three modes to match your preference:
• Pattern + Projection — draws the pattern outline and target line. Best for learning pattern recognition.
• Projection Only — hides pattern lines, shows only target price labels. Cleanest for active trading.
• Dashboard Only — no chart drawings. All information in the dashboard table. For minimal setups.
The "Max Patterns on Chart" setting (default 3) automatically removes the oldest drawings when the cap is reached, so your chart never gets cluttered.
🔷 PRICE PROJECTIONS
Every detected pattern computes a target price using the classical measured-move rule: the expected post-breakout move equals the pattern's height.
Examples:
• Head & Shoulders: Target = Neckline − (Head − Neckline)
• Double Bottom: Target = Peak + (Peak − Average of Bottoms)
• Ascending Triangle: Target = Resistance + Triangle Height
• Bull Flag: Target = Top of Flag + Pole Height
Targets are drawn as dashed lines with price labels. They represent statistical expectations — price reaches the full target roughly 60-70% of the time on well-formed patterns.
🔷 ALERTS
Three built-in alert conditions:
• BUY Signal — fires on every confirmed BUY
• SELL Signal — fires on every confirmed SELL
• Any Signal — fires on either
Set up via right-click → Add Alert. Supports popup, email, webhook, and mobile push.
🔷 RECOMMENDED SETTINGS BY TIMEFRAME
Scalping (1m-5m): Pivot 3-5, Min Confluence 3, Cooldown 5-10
Day Trading (15m-1H): Pivot 5-8, Min Confluence 3, Cooldown 10-15
Swing (4H-Daily): Pivot 8-15, Min Confluence 3-4, Cooldown 5-10
Position (Weekly+): Pivot 10-20, Min Confluence 4-5, Cooldown 3-5
🔷 HOW TO USE
Add the indicator to your chart
Set your timeframe-appropriate settings (see table above)
Wait for a BUY or SELL arrow to appear
Check the dashboard to see which signals are active and the confluence score
Use the pattern projection as your price target
Place your stop loss beyond the pattern boundary
For higher probability: look for 4+/7 confluence, pattern breakout as one of the active signals, and volume confirmation.
🔷 IMPORTANT NOTES
• Signals only fire on confirmed (closed) bars to prevent repainting
• This is a technical analysis tool, not financial advice
• Always use proper risk management including stop losses
• No indicator can predict the future — use this as part of a broader trading plan
• Past pattern performance does not guarantee future results
────────────────────────────────────────────────────────────────
Pattern Detector v3 is an all-in-one chart pattern recognition and signal engine. It automatically detects 16 classic chart patterns, calculates measured-move price projections for each, and generates BUY/SELL signals using a multi-source confluence system that requires multiple independent indicators to agree before firing.
This is not a single-indicator signal tool — it is a confluence framework that combines pattern recognition with 7 signal sources to filter out noise and deliver higher-probability entries.
🔷 PATTERNS DETECTED (16 Total)
Bearish:
• Head & Shoulders
• Double Top
• Triple Top
• Descending Triangle
• Rising Wedge
• Bear Flag
Bullish:
• Inverse Head & Shoulders
• Double Bottom
• Triple Bottom
• Ascending Triangle
• Falling Wedge
• Bull Flag
Neutral (both directions):
• Symmetrical Triangle
• Ascending Channel
• Descending Channel
• Broadening Formation
Each pattern is detected using pivot-high and pivot-low analysis. When a pattern is confirmed, a measured-move price projection is drawn automatically, giving you a calculated target price based on the pattern's height.
🔷 THE SIGNAL SYSTEM — 7 SOURCES
The indicator does not generate a BUY or SELL signal from a single condition. Instead, it polls 7 independent signal sources and only fires when enough of them agree. This is the confluence engine.
The 7 sources are:
Pattern Breakout — price crosses through the detected pattern's key level (neckline, support, or resistance)
EMA Crossover — fast EMA crosses slow EMA (default 9/21)
RSI Reversal — RSI exits overbought or oversold territory
MACD Cross — MACD line crosses the signal line
Volume Spike — volume exceeds its moving average by a configurable multiplier on a directional candle
VWAP Cross — price crosses above or below the session VWAP
Supertrend Flip — Supertrend indicator changes direction
Each source votes BUY (+1), SELL (-1), or NEUTRAL (0). Votes are summed into a Bull Score and Bear Score (each 0-7). A signal only prints when the score meets your minimum confluence threshold.
Every source can be individually toggled on or off.
🔷 CONFLUENCE ENGINE — HOW IT WORKS
• Min Confluence = 2: Very frequent signals. Good for scalping.
• Min Confluence = 3: Balanced (recommended default). Good for day/swing trading.
• Min Confluence = 4: Fewer, higher-conviction signals. Good for swing/position trading.
• Min Confluence = 5+: Rare but strong signals. Best for higher timeframes.
A signal cooldown (default 10 bars) prevents back-to-back signals so you can manage one trade at a time.
When a signal fires, a small label shows the score (e.g., "4/7") so you can gauge its strength at a glance. A subtle background highlight appears on bars where confluence exceeds the minimum by 1 or more, indicating an especially strong setup.
🔷 REAL-TIME DASHBOARD
A compact on-chart table (position configurable) provides two sections:
Signal Status (top):
Shows a filled or empty circle for each of the 7 signal sources in real time. At a glance you can see exactly what is active and what is driving the current market read. The CONFLUENCE row shows the current aggregate bull/bear score.
Pattern List (bottom):
Lists recently detected patterns with their bias (▲ BULL / ▼ BEAR / ◆ NEUT), calculated price target, and how many bars ago they formed.
🔷 DISPLAY MODES
Three modes to match your preference:
• Pattern + Projection — draws the pattern outline and target line. Best for learning pattern recognition.
• Projection Only — hides pattern lines, shows only target price labels. Cleanest for active trading.
• Dashboard Only — no chart drawings. All information in the dashboard table. For minimal setups.
The "Max Patterns on Chart" setting (default 3) automatically removes the oldest drawings when the cap is reached, so your chart never gets cluttered.
🔷 PRICE PROJECTIONS
Every detected pattern computes a target price using the classical measured-move rule: the expected post-breakout move equals the pattern's height.
Examples:
• Head & Shoulders: Target = Neckline − (Head − Neckline)
• Double Bottom: Target = Peak + (Peak − Average of Bottoms)
• Ascending Triangle: Target = Resistance + Triangle Height
• Bull Flag: Target = Top of Flag + Pole Height
Targets are drawn as dashed lines with price labels. They represent statistical expectations — price reaches the full target roughly 60-70% of the time on well-formed patterns.
🔷 ALERTS
Three built-in alert conditions:
• BUY Signal — fires on every confirmed BUY
• SELL Signal — fires on every confirmed SELL
• Any Signal — fires on either
Set up via right-click → Add Alert. Supports popup, email, webhook, and mobile push.
🔷 RECOMMENDED SETTINGS BY TIMEFRAME
Scalping (1m-5m): Pivot 3-5, Min Confluence 3, Cooldown 5-10
Day Trading (15m-1H): Pivot 5-8, Min Confluence 3, Cooldown 10-15
Swing (4H-Daily): Pivot 8-15, Min Confluence 3-4, Cooldown 5-10
Position (Weekly+): Pivot 10-20, Min Confluence 4-5, Cooldown 3-5
🔷 HOW TO USE
Add the indicator to your chart
Set your timeframe-appropriate settings (see table above)
Wait for a BUY or SELL arrow to appear
Check the dashboard to see which signals are active and the confluence score
Use the pattern projection as your price target
Place your stop loss beyond the pattern boundary
For higher probability: look for 4+/7 confluence, pattern breakout as one of the active signals, and volume confirmation.
🔷 IMPORTANT NOTES
• Signals only fire on confirmed (closed) bars to prevent repainting
• This is a technical analysis tool, not financial advice
• Always use proper risk management including stop losses
• No indicator can predict the future — use this as part of a broader trading plan
• Past pattern performance does not guarantee future results
────────────────────────────────────────────────────────────────
Skrip terproteksi
Skrip ini diterbitkan sebagai sumber tertutup. Namun, Anda dapat menggunakannya dengan bebas dan tanpa batasan apa pun – pelajari lebih lanjut di sini.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip terproteksi
Skrip ini diterbitkan sebagai sumber tertutup. Namun, Anda dapat menggunakannya dengan bebas dan tanpa batasan apa pun – pelajari lebih lanjut di sini.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.