Three & Four Bar Reversal PatternThree & Four Bar Reversal Pattern identifies short-term reversal candlestick setups directly on your chart, based on a strict closing-price confirmation rather than just wick penetration — making signals more reliable for intraday and swing trading decisions.
WHAT IT DETECTS
3-Bar Reversal
A classic three-candle reversal:
Bullish: two consecutive bearish candles followed by a bullish candle that closes above the high of the first bearish candle.
Bearish: two consecutive bullish candles followed by a bearish candle that closes below the low of the first bullish candle.
Requiring the close (not just the wick) to break the reference level filters out weaker, unconfirmed reversal attempts.
4-Bar Reversal (optional)
An extended version of the pattern for setups where the reversal takes one extra candle to confirm:
Two small same-direction candles, followed by a transition candle in the opposite direction, followed by a large breakout candle whose body exceeds the combined body size of the previous three candles, and whose close breaks through the high/low of the first candle.
Built-in logic prevents a 4-bar signal from overlapping with an already-completed 3-bar signal on the same candles, so you don't get redundant markers on the chart.
FEATURES
Independent toggles for bullish and bearish signals
Customizable colors for bullish/bearish markers
Optional 4-bar pattern detection, clearly distinguished from 3-bar signals with on-chart labels ("3" / "4")
Configurable reference line (style: solid/dashed/dotted, adjustable width) marking the breakout level
Built-in alert conditions for all four signal types (bullish/bearish, 3-bar/4-bar)
HOW TO USE
Add the indicator to your chart.
Watch for triangle markers below/above candles — these mark confirmed reversal closes.
Enable "4-Bar Pattern Detection" in settings if you also want the extended 4-candle version.
Set alerts on any of the four conditions to get notified in real time.
NOTES
This tool is designed to highlight potential reversal setups, not to generate standalone buy/sell signals. Always combine it with your own risk management, trend context, and confluence factors (support/resistance, volume, higher-timeframe structure, etc.). Past patterns do not guarantee future results. Indicator

Indicator

ORACLE MATRIX RED PILL# 🔴 ORACLE MATRIX RED PILL — by K@lTony
### *"Take the Red Pill. See the Pattern. The Oracle Never Lies."*
---
## 🇮🇹 DESCRIZIONE ITALIANA
**Oracle Matrix Red Pill** è un indicatore avanzato per TradingView scritto in Pine Script v6 che fonde tre motori algoritmici in un unico strumento: il filtro di liquidità AlgoAlpha, il sistema di trailing stop UT Bot e un motore di backtest visivo multi-trade in tempo reale.
Progettato e ottimizzato per **scalping su XAUUSD a 30 minuti**, ideale nelle sessioni di Londra e New York.
---
### ⚙️ COSA FA
**1 — Liquidity Sweep Engine (AlgoAlpha)**
Identifica i livelli di liquidità istituzionale tracciando i picchi e i minimi volumetrici significativi. Quando il prezzo "sweeppa" questi livelli — esattamente come fanno i market maker prima di invertire — l'indicatore lo segnala in tempo reale con label e intensità volumetrica. Distingue sweep minori da sweep maggiori tramite una soglia configurabile.
**2 — UT Bot Trailing Stop**
Il motore UT Bot calcola uno stop trail dinamico basato sull'ATR moltiplicato per un Key Value regolabile. Genera segnali BUY e SELL solo quando il prezzo attraversa questo livello in modo netto, colorando le barre in base alla posizione rispetto allo stop.
**3 — Filtro Trend Combinato**
Il segnale finale viene emesso SOLO quando entrambi i motori sono allineati: UT Bot bullish + trend AlgoAlpha positivo per i BUY, UT Bot bearish + trend negativo per i SELL. Questo elimina la maggior parte dei falsi segnali in mercati laterali.
**4 — Filtri Opzionali Avanzati**
- RSI Filter: entra solo se RSI è sopra/sotto una soglia configurabile
- Volume Filter: segnale solo con volume superiore alla sua media mobile
- Session Filter: limita i segnali alle sessioni di Londra (07:00–12:00 UTC) e New York (13:00–18:00 UTC)
- EMA Trend Filter: opera solo nella direzione della EMA (default 200)
- ATR Volatility Filter: blocca i segnali nei mercati piatti (ATR < ATR-MA)
- Sweep Confirmation Filter: richiede uno sweep di liquidità attivo per confermare il segnale
**5 — Volume Profile Dinamico**
Visualizza un profilo di volume aggiornato in tempo reale relativo al trend corrente, con Point of Control (POC) automatico. Aiuta a identificare le zone di maggiore interesse istituzionale.
**6 — Backtest Engine Visivo Multi-Trade**
Il cuore dell'indicatore. TP e SL si esprimono in **pips** con moltiplicatore configurabile (XAUUSD default: 0.1). Ogni segnale apre un trade indipendente sulla **candela successiva** (a open della barra dopo il segnale). I trade rimangono aperti contemporaneamente e sovrapposti finché non toccano TP o SL. Sul grafico appaiono:
- 🟢 Box verde = zona TP
- 🔴 Box rosso = zona SL
- ➖ Linea tratteggiata = prezzo di entry
- Label apertura con direzione e prezzo
- Label chiusura con ✔ TP o ✘ SL e pips
- Panel in tempo reale con W / L / Total / Win Rate / R:R / Breakeven
---
### 📋 IMPOSTAZIONI CONSIGLIATE PER XAUUSD 30M
| Parametro | Valore consigliato |
|---|---|
| Timeframe | 30 minuti |
| AlgoAlpha Length | 12 |
| AlgoAlpha Multiplier | 2.0 |
| UT Bot Key Value | 1.0 |
| UT Bot ATR Period | 10 |
| Session Filter | ON — London + New York |
| EMA Filter | ON — EMA 200 |
| ATR Volatility Filter | ON |
| TP (pips) | 150 |
| SL (pips) | 75 |
| Pip Multiplier | 0.1 |
---
### 💡 CONSIGLI DI UTILIZZO
- **Aspetta le kill zone**: i segnali più affidabili arrivano tra le 08:00–10:00 e le 14:00–16:00 ora italiana, nell'overlap tra sessione europea e americana.
- **Non tradare contro l'EMA 200**: attiva il filtro EMA e non aprire mai contro il trend macro.
- **Usa il backtest panel**: prima di fare live, testa diversi valori di TP/SL e osserva il win rate storico sul simbolo che vuoi tradare.
- **Sweep di liquidità come conferma**: se attivi il Sweep Filter, ricevi solo segnali preceduti da un'iniezione di liquidità — setup tipicamente più esplosivi.
- **Trade sovrapposti**: il motore di backtest permette trade multipli contemporanei, esattamente come accade nel trading reale con posizioni piramidali o multi-entry.
- **XAUUSD è volatile**: non usare SL troppo stretti sotto i 50 pips su 30M, il rumore di mercato li brucia facilmente.
---
### ⚠️ DISCLAIMER
Questo indicatore è uno strumento di analisi tecnica. Non costituisce consiglio finanziario. Effettua sempre la tua analisi e gestisci il rischio con responsabilità. Il backtest visuale è indicativo e non garantisce risultati futuri.
---
---
## 🇬🇧 ENGLISH DESCRIPTION
**Oracle Matrix Red Pill** is an advanced TradingView indicator written in Pine Script v6 that merges three algorithmic engines into a single tool: the AlgoAlpha Liquidity Sweep Filter, the UT Bot trailing stop system, and a real-time multi-trade visual backtest engine.
Designed and optimised for **scalping XAUUSD on the 30-minute timeframe**, with a focus on London and New York sessions.
---
### ⚙️ WHAT IT DOES
**1 — Liquidity Sweep Engine (AlgoAlpha)**
Identifies institutional liquidity levels by tracking significant volumetric peaks and valleys. When price sweeps through these levels — exactly as market makers do before reversing — the indicator flags it in real time with labels and volumetric intensity scores. Minor and major sweeps are distinguished via a configurable threshold.
**2 — UT Bot Trailing Stop**
The UT Bot engine calculates a dynamic trailing stop based on ATR multiplied by an adjustable Key Value. BUY and SELL signals are generated only when price cleanly crosses this level, with bar colouring based on position relative to the stop.
**3 — Combined Trend Filter**
The final signal fires ONLY when both engines align: UT Bot bullish + positive AlgoAlpha trend for BUYs, UT Bot bearish + negative trend for SELLs. This eliminates most false signals in ranging markets.
**4 — Advanced Optional Filters**
- RSI Filter: enter only if RSI is above/below a configurable threshold
- Volume Filter: signal only when volume exceeds its moving average
- Session Filter: restrict signals to London (07:00–12:00 UTC) and New York (13:00–18:00 UTC) sessions
- EMA Trend Filter: trade only in the direction of the EMA (default 200)
- ATR Volatility Filter: block signals in flat markets (ATR < ATR-MA)
- Sweep Confirmation Filter: require an active liquidity sweep to confirm the signal
**5 — Dynamic Volume Profile**
Displays a real-time volume profile relative to the current trend, with automatic Point of Control (POC). Helps identify zones of greatest institutional interest.
**6 — Multi-Trade Visual Backtest Engine**
The heart of the indicator. TP and SL are expressed in **pips** with a configurable multiplier (XAUUSD default: 0.1). Each signal opens an independent trade on the **next candle** (at the open of the bar following the signal). Trades remain open simultaneously and overlapping until they hit TP or SL. On the chart you will see:
- 🟢 Green box = TP zone
- 🔴 Red box = SL zone
- ➖ Dashed line = entry price
- Entry label with direction and price
- Exit label with ✔ TP or ✘ SL and pips
- Live panel showing W / L / Total / Win Rate / R:R / Breakeven
---
### 📋 RECOMMENDED SETTINGS FOR XAUUSD 30M
| Parameter | Recommended Value |
|---|---|
| Timeframe | 30 minutes |
| AlgoAlpha Length | 12 |
| AlgoAlpha Multiplier | 2.0 |
| UT Bot Key Value | 1.0 |
| UT Bot ATR Period | 10 |
| Session Filter | ON — London + New York |
| EMA Filter | ON — EMA 200 |
| ATR Volatility Filter | ON |
| TP (pips) | 150 |
| SL (pips) | 75 |
| Pip Multiplier | 0.1 |
---
### 💡 HOW TO USE IT
- **Wait for the kill zones**: the most reliable signals appear between 07:00–10:00 and 13:00–16:00 UTC, in the European/American session overlap.
- **Never trade against the EMA 200**: enable the EMA filter and avoid entries that go against the macro trend.
- **Use the backtest panel**: before going live, test different TP/SL values and observe the historical win rate on your target symbol.
- **Liquidity sweeps as confirmation**: enabling the Sweep Filter delivers only signals preceded by a liquidity injection — typically more explosive setups.
- **Overlapping trades**: the backtest engine supports multiple simultaneous trades, exactly as happens in real trading with pyramidal or multi-entry positions.
- **XAUUSD is volatile**: avoid SL tighter than 50 pips on the 30M chart — market noise will take them out regularly.
---
### ⚠️ DISCLAIMER
This indicator is a technical analysis tool. It does not constitute financial advice. Always conduct your own analysis and manage risk responsibly. The visual backtest is indicative and does not guarantee future results.
---
*Oracle Matrix Red Pill — by K@lTony*
*"Take the Red Pill. See the Pattern. The Oracle Never Lies."*
Indicator

ORACLE MATRIX RED PILL# 🔴 ORACLE MATRIX RED PILL — by K@lTony
### *"Take the Red Pill. See the Pattern. The Oracle Never Lies."*
---
## 🇮🇹 DESCRIZIONE ITALIANA
**Oracle Matrix Red Pill** è un indicatore avanzato per TradingView scritto in Pine Script v6 che fonde tre motori algoritmici in un unico strumento: il filtro di liquidità AlgoAlpha, il sistema di trailing stop UT Bot e un motore di backtest visivo multi-trade in tempo reale.
Progettato e ottimizzato per **scalping su XAUUSD a 30 minuti**, ideale nelle sessioni di Londra e New York.
---
### ⚙️ COSA FA
**1 — Liquidity Sweep Engine (AlgoAlpha)**
Identifica i livelli di liquidità istituzionale tracciando i picchi e i minimi volumetrici significativi. Quando il prezzo "sweeppa" questi livelli — esattamente come fanno i market maker prima di invertire — l'indicatore lo segnala in tempo reale con label e intensità volumetrica. Distingue sweep minori da sweep maggiori tramite una soglia configurabile.
**2 — UT Bot Trailing Stop**
Il motore UT Bot calcola uno stop trail dinamico basato sull'ATR moltiplicato per un Key Value regolabile. Genera segnali BUY e SELL solo quando il prezzo attraversa questo livello in modo netto, colorando le barre in base alla posizione rispetto allo stop.
**3 — Filtro Trend Combinato**
Il segnale finale viene emesso SOLO quando entrambi i motori sono allineati: UT Bot bullish + trend AlgoAlpha positivo per i BUY, UT Bot bearish + trend negativo per i SELL. Questo elimina la maggior parte dei falsi segnali in mercati laterali.
**4 — Filtri Opzionali Avanzati**
- RSI Filter: entra solo se RSI è sopra/sotto una soglia configurabile
- Volume Filter: segnale solo con volume superiore alla sua media mobile
- Session Filter: limita i segnali alle sessioni di Londra (07:00–12:00 UTC) e New York (13:00–18:00 UTC)
- EMA Trend Filter: opera solo nella direzione della EMA (default 200)
- ATR Volatility Filter: blocca i segnali nei mercati piatti (ATR < ATR-MA)
- Sweep Confirmation Filter: richiede uno sweep di liquidità attivo per confermare il segnale
**5 — Volume Profile Dinamico**
Visualizza un profilo di volume aggiornato in tempo reale relativo al trend corrente, con Point of Control (POC) automatico. Aiuta a identificare le zone di maggiore interesse istituzionale.
**6 — Backtest Engine Visivo Multi-Trade**
Il cuore dell'indicatore. TP e SL si esprimono in **pips** con moltiplicatore configurabile (XAUUSD default: 0.1). Ogni segnale apre un trade indipendente sulla **candela successiva** (a open della barra dopo il segnale). I trade rimangono aperti contemporaneamente e sovrapposti finché non toccano TP o SL. Sul grafico appaiono:
- 🟢 Box verde = zona TP
- 🔴 Box rosso = zona SL
- ➖ Linea tratteggiata = prezzo di entry
- Label apertura con direzione e prezzo
- Label chiusura con ✔ TP o ✘ SL e pips
- Panel in tempo reale con W / L / Total / Win Rate / R:R / Breakeven
---
### 📋 IMPOSTAZIONI CONSIGLIATE PER XAUUSD 30M
| Parametro | Valore consigliato |
|---|---|
| Timeframe | 30 minuti |
| AlgoAlpha Length | 12 |
| AlgoAlpha Multiplier | 2.0 |
| UT Bot Key Value | 1.0 |
| UT Bot ATR Period | 10 |
| Session Filter | ON — London + New York |
| EMA Filter | ON — EMA 200 |
| ATR Volatility Filter | ON |
| TP (pips) | 150 |
| SL (pips) | 75 |
| Pip Multiplier | 0.1 |
---
### 💡 CONSIGLI DI UTILIZZO
- **Aspetta le kill zone**: i segnali più affidabili arrivano tra le 08:00–10:00 e le 14:00–16:00 ora italiana, nell'overlap tra sessione europea e americana.
- **Non tradare contro l'EMA 200**: attiva il filtro EMA e non aprire mai contro il trend macro.
- **Usa il backtest panel**: prima di fare live, testa diversi valori di TP/SL e osserva il win rate storico sul simbolo che vuoi tradare.
- **Sweep di liquidità come conferma**: se attivi il Sweep Filter, ricevi solo segnali preceduti da un'iniezione di liquidità — setup tipicamente più esplosivi.
- **Trade sovrapposti**: il motore di backtest permette trade multipli contemporanei, esattamente come accade nel trading reale con posizioni piramidali o multi-entry.
- **XAUUSD è volatile**: non usare SL troppo stretti sotto i 50 pips su 30M, il rumore di mercato li brucia facilmente.
---
### ⚠️ DISCLAIMER
Questo indicatore è uno strumento di analisi tecnica. Non costituisce consiglio finanziario. Effettua sempre la tua analisi e gestisci il rischio con responsabilità. Il backtest visuale è indicativo e non garantisce risultati futuri.
---
---
## 🇬🇧 ENGLISH DESCRIPTION
**Oracle Matrix Red Pill** is an advanced TradingView indicator written in Pine Script v6 that merges three algorithmic engines into a single tool: the AlgoAlpha Liquidity Sweep Filter, the UT Bot trailing stop system, and a real-time multi-trade visual backtest engine.
Designed and optimised for **scalping XAUUSD on the 30-minute timeframe**, with a focus on London and New York sessions.
---
### ⚙️ WHAT IT DOES
**1 — Liquidity Sweep Engine (AlgoAlpha)**
Identifies institutional liquidity levels by tracking significant volumetric peaks and valleys. When price sweeps through these levels — exactly as market makers do before reversing — the indicator flags it in real time with labels and volumetric intensity scores. Minor and major sweeps are distinguished via a configurable threshold.
**2 — UT Bot Trailing Stop**
The UT Bot engine calculates a dynamic trailing stop based on ATR multiplied by an adjustable Key Value. BUY and SELL signals are generated only when price cleanly crosses this level, with bar colouring based on position relative to the stop.
**3 — Combined Trend Filter**
The final signal fires ONLY when both engines align: UT Bot bullish + positive AlgoAlpha trend for BUYs, UT Bot bearish + negative trend for SELLs. This eliminates most false signals in ranging markets.
**4 — Advanced Optional Filters**
- RSI Filter: enter only if RSI is above/below a configurable threshold
- Volume Filter: signal only when volume exceeds its moving average
- Session Filter: restrict signals to London (07:00–12:00 UTC) and New York (13:00–18:00 UTC) sessions
- EMA Trend Filter: trade only in the direction of the EMA (default 200)
- ATR Volatility Filter: block signals in flat markets (ATR < ATR-MA)
- Sweep Confirmation Filter: require an active liquidity sweep to confirm the signal
**5 — Dynamic Volume Profile**
Displays a real-time volume profile relative to the current trend, with automatic Point of Control (POC). Helps identify zones of greatest institutional interest.
**6 — Multi-Trade Visual Backtest Engine**
The heart of the indicator. TP and SL are expressed in **pips** with a configurable multiplier (XAUUSD default: 0.1). Each signal opens an independent trade on the **next candle** (at the open of the bar following the signal). Trades remain open simultaneously and overlapping until they hit TP or SL. On the chart you will see:
- 🟢 Green box = TP zone
- 🔴 Red box = SL zone
- ➖ Dashed line = entry price
- Entry label with direction and price
- Exit label with ✔ TP or ✘ SL and pips
- Live panel showing W / L / Total / Win Rate / R:R / Breakeven
---
### 📋 RECOMMENDED SETTINGS FOR XAUUSD 30M
| Parameter | Recommended Value |
|---|---|
| Timeframe | 30 minutes |
| AlgoAlpha Length | 12 |
| AlgoAlpha Multiplier | 2.0 |
| UT Bot Key Value | 1.0 |
| UT Bot ATR Period | 10 |
| Session Filter | ON — London + New York |
| EMA Filter | ON — EMA 200 |
| ATR Volatility Filter | ON |
| TP (pips) | 150 |
| SL (pips) | 75 |
| Pip Multiplier | 0.1 |
---
### 💡 HOW TO USE IT
- **Wait for the kill zones**: the most reliable signals appear between 07:00–10:00 and 13:00–16:00 UTC, in the European/American session overlap.
- **Never trade against the EMA 200**: enable the EMA filter and avoid entries that go against the macro trend.
- **Use the backtest panel**: before going live, test different TP/SL values and observe the historical win rate on your target symbol.
- **Liquidity sweeps as confirmation**: enabling the Sweep Filter delivers only signals preceded by a liquidity injection — typically more explosive setups.
- **Overlapping trades**: the backtest engine supports multiple simultaneous trades, exactly as happens in real trading with pyramidal or multi-entry positions.
- **XAUUSD is volatile**: avoid SL tighter than 50 pips on the 30M chart — market noise will take them out regularly.
---
### ⚠️ DISCLAIMER
This indicator is a technical analysis tool. It does not constitute financial advice. Always conduct your own analysis and manage risk responsibly. The visual backtest is indicative and does not guarantee future results.
---
*Oracle Matrix Red Pill — by K@lTony*
*"Take the Red Pill. See the Pattern. The Oracle Never Lies."*
Indicator

XRS Swing Failure Patterns + AlertsXRS Swing Failure Patterns + Alerts is a modified version of the original LuxAlgo Swing Failure Pattern script.
The original SFP detection logic is credited to LuxAlgo. This XRS version keeps the core swing failure pattern concept while adding small modifications, styling adjustments, and dedicated alert conditions for multiple timeframes.
This indicator identifies bullish and bearish Swing Failure Patterns, where price sweeps a prior swing high or swing low and then closes back through the level. These patterns are commonly used to identify potential liquidity sweeps, failed breakouts, stop runs, and reversal areas.
Features include:
• Bullish and bearish SFP detection
• Swing length customization
• Optional volume validation
• Optional lower-timeframe volume validation
• Swing lines
• Confirmation lines
• Swing failure wick markers
• SFP labels
• Optional dashboard
• Alerts when an SFP prints on 1m, 5m, 15m, 1h, 4h, and 1D timeframes
This version was modified by XRStrading / chasingkilowatts to make the script better suited for discretionary trading workflows, especially for traders who use liquidity sweeps, session highs/lows, VWAP, order flow, and auction-market concepts.
Original Author: LuxAlgo
Modifications: XRStrading / chasingkilowatts
This script is based on original LuxAlgo work and remains subject to the original attribution and license terms.
Disclaimer: This script is for educational and informational purposes only and does not constitute financial advice. Trading involves risk. Use at your own discretion.
Indicator

Indicator

Indicator

[GYTS-CE] Pattern Texture Codex (PTC)Pattern Texture Codex (Community Edition)
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- INTRODUCTION --------- 🌸
💮 What is the Pattern Texture Codex?
Standard technical analysis focuses on two dimensions: Amplitude (how far price moves) and Momentum (how fast price moves). The Pattern Texture Codex introduces a third: Structure (how price moves).
This indicator implements Permutation Entropy (PE), a complexity measure from dynamical systems theory that captures whether price evolves in structured patterns or chaotic noise. We call this "Market Texture":
🫧 Smooth Texture (Low Entropy): Price evolves in ordered, predictable patterns. Trends are durable and causality is high. Momentum strategies favoured.
🌵 Rough Texture (High Entropy): Price evolves chaotically. The market is noisy, trends are fragile. Mean reversion or defensive sizing recommended.
💮 Why Use This Indicator?
Most "entropy" indicators on TradingView fall into common traps:
Shannon entropy of price histograms — measures value distribution but ignores temporal sequence
Approximate Entropy (ApEn) — measures amplitude similarity with O(N²) computational cost
Volatility metrics labelled "entropy" — captures magnitude, not pattern structure
Mathematical errors — normalised values that don't form valid probability distributions
The Pattern Texture Codex provides true ordinal pattern analysis — it examines the sequence of price movements, not just their distribution or magnitude. A smooth uptrend and choppy consolidation may have identical volatility, but their texture is completely different.
↑ Pattern Texture Codex with dynamic threshold bands. Rough Texture (high entropy) often indicates reversals, while Smooth Texture (low entropy) often precedes trend continuation.
🌸 --------- HOW IT WORKS --------- 🌸
💮 Core Concept: Ordinal Patterns
Instead of analysing raw price values, Permutation Entropy converts price into ordinal patterns — the relative ordering of consecutive data points.
For example, with embedding dimension D=3 (three points per pattern):
Pattern "012": first < second < third → ascending
Pattern "210": first > second > third → descending
Pattern "102": middle value smallest → valley shape
The indicator counts how often each pattern appears over a lookback window, then calculates the Shannon entropy of this distribution.
↑ With D=3, three consecutive data points determine each pattern. Left: ascending pattern "012" (first point smallest, second middle, third greatest). Right: descending pattern "210" (first point greatest, second middle, third smallest).
💮 Calculation Overview
The normalised Permutation Entropy is computed as:
H = −∑ p(π) · ln(p(π)) / ln(D!)
Where:
• p(π) is the probability of each ordinal pattern π
• D is the embedding dimension (number of points per pattern)
• D! is the total possible patterns (e.g., 4! = 24 for D=4)
The result ranges from 0 to 1:
• H → 0 : One pattern dominates — highly structured, predictable
• H → 1 : All patterns equally likely — pure randomness
↑ Full calculation example at D=3 showing the lowest entropy point (green vertical line). With 3!=6 possible patterns, the monotonic rising pattern "012" dominates while three other patterns occur only once. The frequency column feeds into the entropy contribution formula, yielding H(3)=1.039. Normalising produces 0.4019 — matching the indicator output exactly.
💮 Theoretical Background
Permutation Entropy has deep theoretical foundations. For piecewise monotone maps, it converges to the Kolmogorov-Sinai entropy — the fundamental measure of chaos in dynamical systems.
Key scientific properties:
• Scale invariance — analyses rank orderings, invariant to monotonic transformations
• Noise robustness — ordinal encoding naturally filters high-frequency noise
• Computational efficiency — O(1) amortised per bar with lookup acceleration
• Micro-structure sensitivity — captures specific sequence patterns, not just distribution
🌸 --------- KEY FEATURES --------- 🌸
💮 Lookup Table Acceleration
Standard PE requires sorting each embedding vector — O(D log D) operations per bar. This implementation uses precomputed transition tables from Unakafova & Keller (2013), reducing complexity to O(D) per bar.
The key insight: successive ordinal patterns in overlapping windows share (D−1) data points. Rather than recomputing from scratch, the algorithm derives the new pattern from the previous one using a single table lookup.
Enabled by default for Delay=1 and Dimension ∈ {3, 4, 5}
Falls back to standard calculation for D=2, D=6
💮 Flexible Threshold Modes
The indicator supports four independent threshold modes for both Smooth and Rough detection:
Static — Fixed threshold values you define
Dynamic — Adaptive bands based on entropy baseline ± standard deviation
Percentile — Threshold at Nth percentile of recent entropy history
Disabled — No threshold for that direction
You can mix modes: for example, Dynamic for Smooth detection while using Percentile for Rough detection.
🌸 --------- CONFIGURATION --------- 🌸
💮 General Settings
• Source — Price series to analyse (default: close)
• Smoothing Critical Period — Smoothing via 2-pole Ultimate Smoother (default: 0 = disabled). Reveals underlying texture by filtering entropy noise.
💮 Entropy Calculation
Dimension (D) — Points per ordinal pattern:
• D=3: 6 patterns — fast, stable. Good for limited lookback.
• D=4: 24 patterns — balanced, captures V-reversals. Recommended.
• D=5: 120 patterns — sensitive, captures W/M patterns. Noisier.
• D=6: 720 patterns — maximum sensitivity. No lookup acceleration.
Lookback — Estimation window size. Hard minimum: D × 5. Statistical recommendation: 5 × D! (e.g., 120 for D=4). Default: 100.
Delay (τ) — Stride between points in each pattern (default: 1). Change only for oversampled data.
Lookup Acceleration — Enables transition tables for D ∈ {3, 4, 5} with Delay=1.
💮 Threshold Management
Rough/Smooth Mode — Static, Dynamic, Percentile, or Disabled for each threshold
Static Values — Fixed threshold when Static mode selected
Std Dev Multiplier — Band width for Dynamic mode (default: 2.0σ)
Baseline/Deviation Length — Lookback for Dynamic mode calculations
Percentile Settings — Lookback and percentile values for Percentile mode
💮 Visualisation & Alerts
Palette — Colour scheme (default: GYTS Purple)
Colouring Bars — Applies texture colours to chart candles
Dark Mode — Optimises colour intensity for dark backgrounds
Alerts — Triggers when entropy crosses above/below thresholds
🌸 --------- USAGE GUIDE --------- 🌸
💮 Getting Started
Apply the indicator with default settings:
• Dimension: 4 (balanced complexity, captures V-shaped reversals)
• Lookback: 100 (responsive; statistical ideal: ≥120 for 5× coverage)
• Smooth Threshold: Dynamic mode with 2.0σ multiplier
Observe how entropy rises during choppy consolidation and falls during clean trends.
💮 Interpretation
Entropy Value (0 to 1):
Below 0.6: Strong pattern dominance — highly ordered
0.7–0.9: Normal complexity — typical market behaviour
Above 0.95: Near-random — patterns uniformly distributed
Transitions:
Watch for regime changes. When entropy rises sharply after a prolonged smooth period, the trend may be losing coherence. When entropy falls from elevated levels, a new trend may be establishing.
↑ Texture transitions during a trend-to-consolidation regime change. During the uptrend, similar patterns (D=3) recur frequently and entropy decreases. As the market transitions to consolidation, entropy rises — signalling the trend is losing structure.
💮 Trading Applications
Trend Filtering — Only take trend-following signals during Smooth texture.
Mean Reversion Timing — Elevated entropy often precedes mean reversion.
Position Sizing — Reduce exposure during Rough texture.
Exit Management — Tighten stops when entropy rises during a position.
💮 Integration with GYTS Suite
The Pattern Texture Codex exports two signals:
PE Continuous — Raw entropy value (0 to 1)
PE Ternary — State signal (+1 = Rough, 0 = Neutral, −1 = Smooth)
These can be read by Flux Composer or used as filter conditions with Market Regime Detector .
🌸 --------- PARAMETER TUNING --------- 🌸
💮 Lookback Selection
Shorter lookbacks react faster but may produce unstable estimates:
50–100: Responsive. Good for intraday regime detection.
100–200: Balanced. Recommended for swing trading.
200–500: Stable. Better for position trading or noisy instruments.
The indicator enforces a hard minimum of D × 5 to prevent meaningless output.
↑ Three dimensions (D=3, D=4, D=5) with their academically recommended minimum lookback periods.
💮 Threshold Tuning
For Smooth Detection:
Dynamic mode with 2.0σ works well across most instruments. Lower multipliers (1.5σ) detect structure earlier but may false-trigger.
For Rough Detection:
Percentile mode at 90th percentile identifies only extreme chaos. Static threshold of 0.95+ focuses on near-random conditions.
Consider disabling Rough detection entirely if your strategy only cares about identifying structured trends.
↑ The three threshold modes on the same PTC calculation. Both upper and lower thresholds are independently configurable.
🌸 --------- LIMITATIONS --------- 🌸
Amplitude Blindness — PE treats all patterns equally regardless of magnitude. A 0.1% drift and a 10% crash produce identical entropy if their ordinal patterns match.
Equal Values (Ties) — Handled via temporal tie-breaking (recent values rank higher), but heavily discretised data may produce edge-case behaviour.
Sample Size Requirements — Very short lookbacks (below D × 5) produce unreliable estimates. Statistical reliability improves with larger samples.
Not Predictive Alone — Low entropy indicates structure exists, not that the trend will continue. Combine with directional analysis for trading decisions.
Lag During Transitions — The sliding window approach introduces inherent lag when market texture changes.
🌸 --------- CREDITS --------- 🌸
💮 Academic Sources
Bandt, C., & Pompe, B. (2002). Permutation entropy: A natural complexity measure for time series. Physical Review Letters, 88 (17), 174102. DOI
Unakafova, V., & Keller, K. (2013). Efficiently measuring complexity on the basis of real-world data. Entropy, 15 (10), 4392-4415. DOI
Ehlers, J. F. (2024). The Ultimate Smoother. Technical Analysis of Stocks & Commodities , 2024-04. TASC
💮 Libraries Used
FiltersToolkit — Ultimate Smoother and other curated filters
PatternTransitionTables — Precomputed lookup tables for O(1) pattern transitions
ColourUtilities — Gradient palette generation and colour management
Indicator

Wick Absorption Reversal Planner [AGPro Series]Wick Absorption Reversal Planner
🧠 Core Idea
Is an extended wick showing absorption, and did the candle body reclaim enough structure to treat the reversal context seriously?
📌 Overview / What it does
Wick Absorption Reversal Planner maps extended wick reactions as absorption pockets and evaluates whether price can reclaim the body rail after that reaction.
The script displays a wick absorption pocket, body reclaim rail, failure shelf, room reference, event labels, right-side tags, optional bar coloring, and a compact AG Pro dashboard with a 0-100 reversal score.
It does not predict reversals. It helps organize wick absorption, body reclaim quality, pressure, room, invalidation, and action state.
🎯 Purpose & Design Philosophy
Many candle tools label rejection candles, engulfing candles, or generic wick events.
This script was built for the next layer: whether the wick reaction is being absorbed and whether the candle body can reclaim the important zone afterward.
It helps traders separate random wick noise from a structured absorption pocket with a body reclaim rail and failure logic.
⚡ Why This Script Is Different
Most wick indicators focus on the wick itself.
This script does NOT treat every long wick as a reversal signal.
Instead, it maps the wick pocket, checks body reclaim, measures pressure and room, and gives a clear action state. The goal is interpretation, not prediction.
⚙️ Methodology
1. Wick Absorption Detection
The script checks upper and lower wick size relative to ATR and total candle range.
2. Context Mapping
The wick is compared with recent structure to avoid treating every isolated candle as meaningful.
3. Body Reclaim Evaluation
After a wick absorption pocket is detected, the body reclaim rail becomes the key threshold for reversal planning.
4. Visual Output
The chart receives the wick pocket, body reclaim rail, failure shelf, room rail, labels, right-side tags, optional bar coloring, and dashboard panel.
🗺️ How to Read the Chart
The wick absorption pocket marks the area created by the extended wick reaction.
The body reclaim rail shows the level price needs to recover for the reversal context to improve.
The failure shelf marks where the absorption context fails.
The room rail marks the nearest structure reference in the reversal direction.
Labels highlight wick absorption, body reclaim, pocket pressure, room tests, and absorption failure.
Colors represent context:
• Teal → bullish wick absorption
• Pink → bearish wick absorption or failure
• Gold → room reference or waiting context
• Indigo → pocket pressure or monitoring context
The panel summarizes:
• Pocket
• Reversal Score
• Pressure
• Room
• Action
🚦 Signals & States
• Bull Wick Absorption → lower wick absorption pocket detected
• Bear Wick Absorption → upper wick absorption pocket detected
• Body Reclaim → price reclaimed the body rail after absorption
• Pocket Pressure → price is testing the wick pocket without clean reclaim
• Room Test → price reached the active room reference
• Absorption Failed → price crossed the failure shelf
• READY → body reclaim and score quality are strong enough to monitor
• MONITOR → pocket or reclaim context is active but not fully ready
• WAIT → no strong active context exists
• INVALIDATED → the wick absorption context failed
• EXPIRED → the pocket is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a bullish or bearish wick absorption pocket appears, when body reclaim appears, when READY state appears, when pocket pressure appears, when the room rail is reached, or when absorption fails.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when wick size, wick-to-range ratio, structural location, participation, body reclaim, and room align.
For example, a lower wick into recent structure followed by body reclaim and available room is more useful than a random wick in the middle of noisy price action.
📊 When to Use
• Reversal watch areas after extended wicks
• Support/resistance reactions with visible rejection
• Pullbacks where wick absorption may matter
• Failed breakdown or failed breakout reactions
• Liquid symbols with readable candles and stable spreads
• 1h, 4h, and 1D charts where wick structure is visible
⚠️ When NOT to Use
• Very low-liquidity markets
• Symbols with unreliable candle structure
• Random spike candles from illiquid prints
• News candles with unstable spreads
• Extremely noisy ranges where every candle has exaggerated wicks
🎛️ Key Inputs
• ATR Length → controls normalization for wick size and visual spacing
• Wick Context Lookback → controls structural comparison
• Minimum Wick ATR → controls required wick size
• Minimum Wick / Range → controls required wick dominance inside the candle
• Minimum Relative Volume → filters very thin wick reactions
• Body Reclaim Buffer ATR → controls the reclaim rail threshold
• Failure Buffer ATR → controls where absorption fails
• Room Lookback → controls the room reference
• Visual settings → control pocket, rails, labels, tags, panel, and bar colors
🖥️ Interface & Visual Design
The visual hierarchy is designed around the wick pocket first, then the reclaim rail.
The pocket defines the reaction, the body reclaim rail defines improvement, the failure shelf defines risk, and the panel gives a quick state read.
The goal is a premium wick absorption map without turning the chart into a generic candle-label board.
🧪 Practical Usage Workflow
1. Check whether a wick absorption pocket is active
2. Read the reversal score and action state
3. Inspect the body reclaim rail
4. Compare pocket pressure with room
5. Watch the failure shelf
6. Confirm the context with broader structure and timeframe alignment
🔍 Interpretation Guidelines
A wick absorption pocket means the candle showed a meaningful wick reaction in context.
Body reclaim means price recovered the reclaim rail after the wick reaction.
READY means the rule-based context has enough quality to monitor.
Room is a reference for structure, not a promised target.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a guaranteed reversal system.
It is not a generic candle pattern detector.
It is not a volume absorption zone engine.
It is not an automated trading tool.
It does not provide financial advice.
It does not guarantee reversal, continuation, profit, or a specific target.
⚠️ Limitations & Transparency
Wick behavior depends on market structure, liquidity, volatility, session conditions, and timeframe.
Some long wicks are random noise.
Some absorption pockets may fail quickly.
The score is a rule-based context score, not a certainty model.
🧠 Market Context Notes
Wicks can show rejection, absorption, stop activity, or simply noise.
The key question is whether price can reclaim the body rail after the wick event.
Use the pocket as context, not as confirmation by itself.
🧾 Use Case Examples
When price prints a long lower wick into recent structure, the script can map a bullish wick absorption pocket.
If price later reclaims the body rail, the script marks body reclaim and updates the panel state.
If price loses the failure shelf, the script marks absorption failure.
🧱 System Philosophy
This script follows the AGPro Series approach: turn a familiar chart behavior into a structured decision-support map.
The focus is not prediction. The focus is wick context, body reclaim, pressure, room, invalidation awareness, and visual clarity.
🔐 Non-Promise Statement
No script can remove uncertainty from markets.
This tool does not promise accuracy, profitability, or future price movement.
Its purpose is to organize wick absorption context so the user can interpret the chart more clearly.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly, and any analytical output can fail.
Users are responsible for their own decisions, risk management, and trade execution.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Do not read a wick by itself.
The strongest reads usually come when wick absorption, body reclaim, structure, participation, and room align.
Indicator

Channel Breakout [EXCAVO]Automatic Convergent Channel Detection with Multi-Filter Breakout Confirmation
The Channel Breakout automatically detects convergent channel patterns — wedges, flags, and triangles — by fitting trendlines through confirmed swing pivots on both boundaries simultaneously. When price breaks out with volume and momentum confirmation, the indicator signals the direction with colored channel lines and an entry label on the breakout candle.
This is not a basic highest/lowest channel. The boundaries are built from verified pivot points, and a convergence filter ensures only genuinely contracting channels qualify — expanding ranges and sideways boxes are excluded.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator. It begins scanning for convergent channel
patterns using swing pivots on the current timeframe.
Step 2 → Wait for a channel to form. The indicator draws the upper and
lower boundary lines in blue while price remains inside.
Step 3 → Watch for the breakout signal. When price closes beyond either
boundary with confirmation, channel lines turn blue (bull) or
red (bear), and an arrow label appears on the breakout candle.
Step 4 → Check the dashboard. It shows the current pattern state,
breakout strength (Strong / Medium / Weak), and the directional
bias score that built up while price was inside the channel.
Step 5 → Read the strength rating. Strong breakouts combine high volume,
deep body penetration, and RSI alignment. Weak breakouts show
fewer confirming factors and may warrant additional analysis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Pivot Detection
Swing highs and lows are identified with ta.pivothigh / ta.pivotlow using a
configurable lookback (Pivot Detection Length, default 5 bars each side). Only
confirmed, closed pivots are used — no repainting. All recent pivots within the
Max Channel Width lookback are stored and passed to the trendline fitting engine.
◆ Best-Fit Trendline Algorithm
For the upper boundary, the engine tests every pair of stored pivot highs (a, b).
For each candidate line through (a, b), it counts how many other pivot highs lie
within ATR × Touch Tolerance of the line while no pivot exceeds it by more than
ATR × Max Deviation. The line with the most qualifying touches becomes the upper
boundary. The same process runs independently for pivot lows to find the lower
boundary. Both boundaries must exist with at least Min Touches (default 2) to
form a valid channel.
◆ Convergence Filter
Once both boundaries are found, the engine measures channel width at the earliest
shared bar (widthStart) and at the current bar (widthNow):
convRate = 1 − (widthNow / widthStart)
A channel is only accepted when convRate >= Min Convergence Rate (default 0.02).
This rejects expanding wedges and flat ranges, keeping only contracting patterns.
◆ Breakout Detection and Strength Score
On each confirmed bar close, the engine projects both boundary lines to the current
bar. A bull breakout fires when close > upper boundary; a bear breakout when
close < lower boundary. The breakout strength score blends five components:
penetration depth relative to ATR (25%), candle body ratio (15%), body commitment
relative to the broken boundary (15%), volume vs SMA-20 spike (25%), and RSI
alignment above/below 50 (20%). Score >= 65 = Strong, >= 35 = Medium, < 35 = Weak.
◆ Confirmation Filters
Three optional filters gate the breakout signal. Volume Spike Multiplier requires
the breakout bar's volume to exceed 20-bar SMA by a configurable factor. Volume
Contraction Filter requires that average volume inside the channel was lower than
before the channel formed — confirming energy compression. Momentum Confirmation
requires RSI > 50 for bull breakouts and RSI < 50 for bear breakouts. Any filter
can be disabled for forex or low-volume instruments.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Pivot-Confirmed Boundaries
Most auto-channel scripts use ta.highest / ta.lowest, which anchors lines to the
highest wick in a window regardless of pattern shape. This indicator builds
boundaries only through confirmed swing pivot points, the same anchor logic a
trader would use when drawing manually.
◆ Convergence-Only Filter
The convRate filter rejects any channel that is not actively narrowing. Sideways
ranges, expanding wedges, and parallel channels are all excluded. Only patterns
where price is compressing toward a decision point qualify.
◆ Best-Fit Touch Counting
The engine evaluates every pair of pivots and selects the line with the highest
touch count, not just the first two pivots it finds. A channel supported by four
touches is stronger than one supported by two, and the algorithm reflects that
by preferring denser confirmation.
◆ Multi-Component Strength Score
The breakout strength is not a simple volume check. It combines five independent
signals — penetration depth, body ratio, body commitment relative to the broken
level, volume spike, and momentum direction — into a single 0-100 score that
classifies the breakout as Strong, Medium, or Weak.
◆ Directional Bias Score
While price is inside the channel, the dashboard tracks a real-time directional
bias built from channel slope (35%), RSI deviation from 50 (35%), and price
position within the channel range (30%). This gives a probabilistic lean on
which side of the channel is more likely to break before the signal fires.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (top right) with key state metrics:
Status - Active (channel forming) / Bull Breakout / Bear Breakout / Scanning
Direction - directional bias with arrow and % while channel is active (e.g. ▲ 64%); BULLISH or BEARISH after breakout
Strength - Strong / Medium / Weak (breakout strength score); — while channel is forming
Convergence - narrowing rate of the active channel in %; — when no channel
Legend table (bottom left) explains every visual element. Toggle in Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Main Settings
Pivot Detection Length - 5 (bars left/right for swing pivot confirmation; lower = more sensitive)
Min Touches per Boundary - 2 (minimum pivot touches required per trendline)
Max Channel Width (bars) - 120 (maximum lookback for channel search)
Min Convergence Rate - 0.02 (minimum narrowing ratio; higher = stricter contraction)
Filters
Volume Spike Mult - 1.2 (breakout bar volume vs SMA-20; set 0.5 to disable on forex)
Volume Contraction Filter - ON (require declining volume inside the channel)
Momentum Confirmation - ON (RSI > 50 for bull, < 50 for bear)
Visual
Show Channel Patterns - ON (draw boundary lines)
Show Pattern Background - OFF (subtle bgcolor while inside active channel)
Channel Lines
Line Width - 2 (boundary line thickness; 1-4)
Risk Management
Show Entry Labels - ON (arrow label on the breakout candle)
Dashboard
Show Dashboard - ON
Position - Top Right (Top Left / Top Right / Bottom Left / Bottom Right)
Font Size - Small (Small / Normal)
Advanced
Touch Tolerance (ATR) - 0.15 (pivot distance to count as a touch; 0.10-0.25)
Max Deviation (ATR) - 0.30 (maximum pivot overshoot from the line)
Min Channel Width (ATR) - 0.5 (minimum channel width filter)
Alerts
JSON Alerts - OFF (structured JSON payload for 3Commas, Wunderbit, and similar bots)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
Bull Breakout - price closes above the upper channel boundary with confirmation
Bear Breakout - price closes below the lower channel boundary with confirmation
Any Breakout - either direction; use for a single alert covering both signals
New Pattern - a new convergent channel has been detected and is now active
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
Indicator

Quasimodo Reversal Zones [AGPro Series]Quasimodo Reversal Zones
🔹 OVERVIEW
Quasimodo Reversal Zones is a focused Smart Money Concepts tool built around one specific idea: the Quasimodo reversal pattern.
Instead of turning the chart into a crowded market-structure dashboard, this script identifies confirmed QM swing sequences, marks the original shoulder-derived QM level, projects a clean reaction zone, and tracks the invalidation threshold from the head.
The goal is simple: help traders see where a valid Quasimodo structure formed, where price may revisit the QM level, whether the reaction zone is active, and when the structure has failed.
It is designed as a premium public-free AGPro tool for traders who want a clean, visual, and selective Quasimodo framework without generic signal clutter.
🔹 WHAT MAKES IT DIFFERENT
Most reversal tools try to detect too many patterns at the same time. They often combine double tops, double bottoms, head and shoulders, order blocks, BOS, CHOCH, liquidity sweeps, and support/resistance zones into one heavy overlay.
Quasimodo Reversal Zones stays intentionally narrow.
Its only job is to map Quasimodo reversal structures with quality scoring, reaction-zone tracking, and invalidation logic. This makes the script easier to read, easier to trust visually, and more useful as a dedicated QM layer inside a larger trading workflow.
The script also avoids marking every small pivot as a pattern. A valid QM structure must pass multiple filters:
- confirmed swing sequence,
- meaningful head extension,
- displacement beyond the pullback swing,
- minimum spacing between pivots,
- swing amplitude quality,
- time-balance evaluation,
- optional relative-volume participation.
This gives the tool a more selective and professional feel than simple pivot-label scripts.
🧭 WHY THIS DOES NOT OVERLAP WITH OTHER AGPRO TOOLS
This script was designed to stay in a very specific lane inside the AGPro Series catalog.
It is not a broad reversal-pattern scanner.
It is not a BOS or CHOCH dashboard.
It is not an order block tool.
It is not a generic support/resistance zone engine.
It is not a liquidity sweep module.
Its focus is the Quasimodo pattern only.
The visual logic is built around four QM-specific components:
- the shoulder,
- the head,
- the QM level,
- the reaction zone with invalidation.
That narrow structure keeps the tool differentiated from broader AGPro pattern, breakout, structure, and zone-based scripts while still giving traders a strong SMC-style visual experience.
⚙️ METHODOLOGY
The script uses confirmed swing pivots to build a four-step Quasimodo sequence.
For a bullish QM structure, the script looks for:
- an initial swing low,
- a swing high,
- a lower low that forms the head,
- a higher high that confirms the sequence break.
For a bearish QM structure, the script looks for:
- an initial swing high,
- a swing low,
- a higher high that forms the head,
- a lower low that confirms the sequence break.
After the sequence is confirmed, the original shoulder becomes the QM level. A compact ATR-based reaction box is projected around that level. The head becomes the invalidation reference, with optional ATR padding.
The quality score is built from:
- head extension strength,
- sequence-break displacement,
- spacing between pivots,
- average swing size,
- internal time balance,
- optional relative-volume confirmation.
Only structures that meet the selected score threshold are drawn on the chart.
📊 PANEL
The AGPro panel summarizes the latest valid QM structure in a compact format.
Panel fields:
- Pattern Side
- Structure Quality
- Zone Status
- Score
The first panel row follows the AGPro standard: one merged blue header row containing only the script name.
Panel location, panel theme, and panel font size are adjustable from settings. The default panel size is Normal for a clean publication-ready layout.
🎛️ KEY INPUTS
Swing Pivot Length
Controls how strict the confirmed swing structure should be. Higher values create fewer but cleaner patterns.
ATR Normalization Length
Used to normalize zone width, head extension, sequence displacement, label offset, and invalidation padding.
Minimum Head Extension
Defines how far the head must extend beyond the original shoulder before the sequence can qualify.
Minimum Sequence Break
Defines how strongly the final swing must break beyond the pullback level.
Minimum Pattern Score
Filters out weaker QM sequences before they are drawn.
Signal Cooldown Bars
Controls label density and prevents the chart from becoming overloaded on noisy markets.
Reaction Zone Width
Controls the ATR-based thickness of the projected QM reaction box.
Reaction Zone Length
Controls how far the reaction zone projects into the future.
Invalidation Buffer
Adds optional ATR padding beyond the head-based invalidation level.
Maximum Visible QM Zones
Limits how many recent QM zones remain visible on the chart.
Label Font Size and Panel Font Size
Both are adjustable, with Normal as the default setting.
🔍 HOW TO READ IT
Start with the panel.
Pattern Side shows whether the latest valid structure is bullish or bearish.
Structure Quality gives a quick qualitative view of the setup.
Zone Status shows whether the reaction zone is waiting, active, confirmed, or invalidated.
Score shows the numerical strength of the latest accepted QM pattern.
On the chart:
- Shoulder marks the original level that later becomes the QM reference.
- Head marks the extension that creates the imbalance.
- QM Level marks the precise shoulder-derived reaction level.
- Reaction Zone shows the area where the QM retest is being tracked.
- Invalidation Line shows where the structure is no longer valid.
- Status Label shows the live state of the latest zone.
The cleanest reads usually come when price returns to the reaction zone after a strong sequence break and then shows a visible response away from the QM level.
🧩 BEST USE CASES
This script is best used for:
- SMC-style Quasimodo analysis,
- swing-based reversal mapping,
- reaction-zone planning,
- invalidation-based structure review,
- higher-timeframe QM context,
- clean chart screenshots for public analysis,
- traders who want one dedicated QM layer instead of a large all-in-one structure scanner.
It can be useful on many markets and timeframes, but the best visual quality usually appears on charts where swings are clear and price action is not excessively compressed.
🧠 VISUAL DESIGN PHILOSOPHY
The visual design is built around clarity, not clutter.
The script uses the AGPro color palette with a restrained premium look:
- blue merged panel header,
- teal bullish structures,
- pink bearish structures,
- gold invalidation or inactive-state emphasis,
- compact labels placed away from candles where possible,
- projected boxes that stay readable without covering the chart.
The chart should not feel empty, but it should also not feel noisy. Labels, zones, and status elements are intentionally controlled with cooldowns, maximum visible zones, adjustable offsets, and configurable font sizes.
The goal is to make the QM story easy to understand at first glance.
🔔 ALERTS
The script includes alerts for important QM events:
- Bullish Quasimodo Sequence
- Bearish Quasimodo Sequence
- QM Reaction Zone Touched
- QM Reaction Confirmed
- QM Pattern Invalidated
These alerts are designed around structure events rather than generic entry messages.
🔹 LIMITATIONS AND TRANSPARENCY
This script uses confirmed pivots, so patterns are confirmed only after enough bars have passed to validate the swing structure.
It is intentionally selective. Some early or aggressive QM ideas may not appear if they fail the pivot, spacing, displacement, or score requirements.
The script is not designed to predict every reversal. It is designed to identify cleaner Quasimodo structures, display the relevant reaction zone, and provide a clear invalidation reference.
It also does not attempt to replace broader market analysis. Trend context, volatility, liquidity conditions, and higher-timeframe structure can still matter.
✅ IDEAL USER
This script is ideal for traders who:
- understand basic SMC and price-action concepts,
- want a clean Quasimodo-specific tool,
- prefer visual structure over signal spam,
- care about invalidation and reaction-zone logic,
- want a focused public-free AGPro tool that does not overlap with broader reversal scanners,
- value a premium chart presentation with adjustable labels, zones, and panel controls.
Quasimodo Reversal Zones is built for traders who want the QM pattern to be visible, structured, and easy to evaluate without adding unnecessary market-structure clutter. Indicator

ABCD Projection Zones [AGPro Series]ABCD Projection Zones
🔹 OVERVIEW
ABCD Projection Zones is a premium price-action projection tool built for traders who want a clean ABCD pattern map without turning the chart into a full harmonic scanner, Auto Fib suite, retracement dashboard, or broad pattern-recognition system.
The script focuses on one specific market-structure idea: a confirmed A-B-C swing sequence can project a forward D completion area when the A-B leg is measured from point C. Instead of plotting a single thin target line, the script converts that measured move into a practical projected completion zone. This makes the result easier to read on real charts where reactions often happen around an area rather than at one exact tick.
The tool detects the structure, measures the leg relationship, projects the completion zone, tracks the distance to that zone, and then follows the reaction lifecycle after price reaches it. The goal is a premium, readable ABCD projection workflow that helps traders understand where the current structure is, how mature it is, and how price is behaving around the projected completion area.
🔹 WHAT MAKES IT DIFFERENT
Many ABCD, projection, and pattern tools try to do too much at once. They combine multiple Fibonacci ratios, harmonic pattern names, extended target ladders, retracement grids, reversal labels, and broad pattern scanning into one chart overlay. That can look busy, but it often makes the active structure harder to understand.
ABCD Projection Zones takes a narrower and cleaner route.
It does not attempt to label every harmonic family.
It does not expose a full Fibonacci framework.
It does not place several competing projection targets on the chart.
It does not turn the layout into a generic support and resistance map.
The difference is the focused lane: confirmed ABCD swing projection, one projected completion zone, one reaction lifecycle, and a concise panel that explains the active setup.
The visual language is also different. The D area is shown as a forward rectangle with centered zone text inside the box. Active and archived zones stay named, labels use consistent sizing, and archived context remains muted so the active projection remains dominant.
🧭 WHY THIS DOES NOT OVERLAP WITH OTHER AGPRO TOOLS
This script is intentionally separated from other AGPro tools by scope, visual behavior, and analytical purpose.
It is not an Auto Fib Structure tool. It does not publish multiple retracement and extension levels, does not expose a full Fib grid, and does not present itself as a broad Fibonacci framework.
It is not a harmonic scanner. It does not label Gartley, Bat, Butterfly, Crab, Shark, or other harmonic families. It does not rank multiple harmonic candidates or compare pattern families.
It is not a generic support and resistance zone script. The rectangles are not general S/R zones. They are specifically ABCD completion and reaction zones derived from swing-leg symmetry.
It is not a trend dashboard, volatility map, liquidity sweep scanner, or broad price-action suite. Its job is only to map a confirmed A-B-C structure into a projected D completion zone and monitor the reaction state around that zone.
This makes the public release lane clear: a focused ABCD projection and reaction-zone tool for measured-move structure, not a duplicate of existing AGPro zone, Fib, S/R, harmonic, or dashboard concepts.
⚙️ METHODOLOGY
The script starts by detecting confirmed swing highs and lows using pivot-based structure logic. This gives the model cleaner A, B, and C points and helps reduce random candle noise.
After the A-B-C sequence is confirmed, the script measures the A-B leg and the B-C pullback. The B-C pullback is evaluated as a ratio of A-B, but this ratio is used as a structure-quality filter, not as a visible Fibonacci grid.
The projected D area is calculated by applying the A-B leg from point C. This creates an AB=CD style measured-move projection. The projected D price is then expanded into a rectangle using ATR-based padding so the completion area behaves like a practical reaction zone rather than a thin target.
The script then tracks the active projection lifecycle:
- Waiting: price has not yet approached the projected zone.
- Approaching: price is close enough to the zone to matter.
- Completed: price has reached the projected D area.
- Reacting: price is moving away from the zone after contact.
- Overrun: price has moved beyond the zone buffer.
- Expired: the projection window passed without completion.
The scoring model combines impulse quality, pullback quality, and structural alignment into a 0-100 score. This score is not a standalone signal; it is a compact way to summarize the quality of the active ABCD projection structure.
📊 PANEL
The AGPro panel is designed for quick chart reading without forcing the trader to inspect every object manually.
Panel fields:
- Leg Ratio: shows the B-C pullback size relative to A-B.
- Completion Distance: shows the current distance to the projected D zone in price and ATR terms.
- Reaction State: shows the active lifecycle state of the projection.
- Symmetry Quality: classifies the active setup as Weak, Developing, Clean, or Strong with directional context.
- Projection Progress: shows how far price has traveled from point C toward the projected D area.
- Score: summarizes the active setup quality from 0 to 100.
Panel standards:
- The first row is one merged blue AGPro header row.
- The header contains only the panel title.
- Panel location is adjustable.
- Panel theme is adjustable.
- Panel font size is adjustable.
🎛️ KEY INPUTS
Detection:
- Swing Left Strength
- Swing Right Strength
- ATR Length
- Minimum AB Leg Size ATR
- Minimum BC Pullback Ratio
- Maximum BC Pullback Ratio
Projection Zone:
- Projection Length Bars
- Zone Padding ATR
- Approach Distance ATR
- Overrun Buffer ATR
- Zone Fill Transparency
- Archived Zones
- Archived Zone Transparency
- Show Text Inside Zones
Visuals:
- Show ABCD Path
- Show ABCD Labels
- Show Completion Marker
- Label Font Size
- Label Offset ATR
- Completion Marker Offset Bars
Panel:
- Show Panel
- Panel Location
- Panel Theme
- Panel Font Size
🔍 HOW TO READ IT
Start with the A-B-C labels. Point A and point B define the impulse leg. Point C defines the pullback from which the measured-move projection begins.
The dotted projected path shows the C-D measured move. The forward rectangle marks the projected completion zone. If price is still far from that rectangle, the panel will usually show Waiting and a lower Projection Progress value.
As price moves toward the rectangle, Projection Progress increases and the Completion Distance decreases. When price reaches the zone, the script marks D Hit and changes the lifecycle state. After that, the most important reading is whether the zone becomes a Reaction Zone or an Overrun Zone.
Archived zones should be read as context, not as the main decision layer. They show previous projected reaction areas in a muted style so the chart does not feel empty, but the active zone remains the priority.
🧩 BEST USE CASES
This script is best suited for traders who study market structure, measured moves, swing projection, ABCD patterns, and reaction-zone behavior.
Strong use cases include:
- Mapping a clean ABCD completion area after a confirmed A-B-C structure.
- Tracking how close price is to a projected D area.
- Separating developing projections from completed projections.
- Watching for reaction behavior after price reaches a projected completion zone.
- Reviewing recent projected zones without overcrowding the chart.
- Keeping a clean price-action workflow without a full harmonic or Fib suite.
The script can be useful across different markets and timeframes, but it is most readable when swing structure is clear enough for pivot-based detection to identify meaningful A-B-C sequences.
🧠 VISUAL DESIGN PHILOSOPHY
The visual design is built around premium restraint.
The chart should not be empty, but it should also not be overloaded. The active ABCD projection needs to stand out clearly, while archived zones should provide background context without taking attention away from the current structure.
Visual standards used in this script:
- Active completion and reaction zones are drawn as forward rectangles.
- Zone text is written inside the rectangle.
- Zone text is horizontally and vertically centered.
- Zone text uses transparent label-center styling instead of extra external tags.
- Active and archived zone text uses the same label font-size control.
- Swing labels are offset with ATR so they do not sit inside candle bodies.
- The completion marker is compact and shifted away from nearby swing labels.
- The projected C-D path is visible but not visually dominant.
- Archived zones are muted to keep the active projection clean.
The result is a chart that communicates structure, projection, and reaction state without looking like a crowded signal board.
🔔 ALERTS
Included alert conditions:
- New ABCD Projection Zone: triggers when a new qualified ABCD projection is detected.
- ABCD Completion Reached: triggers when price reaches the active projected completion zone.
- ABCD Reaction Confirmed: triggers when price reacts away from the active completion zone.
- ABCD Zone Overrun: triggers when price moves beyond the configured zone buffer.
🔹 LIMITATIONS AND TRANSPARENCY
The script waits for confirmed pivot structure, so A, B, and C labels appear after swing confirmation rather than at the exact live turning point.
The projected D area is based on AB=CD symmetry and ATR-based zone padding. It is designed to map structure and reaction context, not to predict every reversal.
The script intentionally avoids a full harmonic library and full Fibonacci framework. This is a design choice, not a missing feature. The goal is to keep the public tool focused on ABCD projection zones.
During choppy or low-structure conditions, fewer clean setups may appear. Increasing or decreasing swing strength and leg-size filters can make the tool more selective or more responsive depending on the market and timeframe.
✅ IDEAL USER
This script is designed for traders who prefer clean structure tools over crowded all-in-one indicators.
The ideal user:
- Studies price action and swing structure.
- Wants a focused ABCD projection tool.
- Prefers zones over single-line targets.
- Wants reaction-state context after completion.
- Values clean chart presentation.
- Wants adjustable labels, panel location, and visual density.
- Does not want a full harmonic scanner or public Auto Fib suite.
ABCD Projection Zones is built for traders who want one clean projected completion lane: A-B-C structure, measured D zone, reaction state, and a premium AGPro visual presentation. Indicator

Cup and Handle Quality [AGPro Series]Cup and Handle Quality
🧩 OVERVIEW
Cup and Handle Quality is a visual pattern-quality overlay for one of the most recognized continuation structures in technical analysis: the cup and handle.
The script is designed to map the full pattern lifecycle instead of only marking a breakout candle. It studies the left cup rim, the cup base, the right rim recovery, the controlled handle pullback, the breakout behavior, and the measured projection context. The goal is to make cup and handle structures easier to recognize, compare, and explain directly on the chart.
The final visual output is intentionally clear. The detected cup and handle candle ranges are framed with subtle boxes, while thick curved outlines make the formation readable at a glance. The rim line, target line, DEPTH arrow, and MOVE arrow help users understand how the structure is measured, not just where the label appears.
✅ WHAT MAKES IT DIFFERENT
Most public cup and handle tools focus on one of two things: either they draw a simple breakout marker, or they scan aggressively and leave the chart crowded with low-context shapes. Cup and Handle Quality takes a narrower approach.
It combines three layers:
- Structure recognition: left rim, cup base, right rim, and handle low
- Quality scoring: cup symmetry, handle depth, and breakout quality
- Visual education: cup box, handle box, thick pattern outline, rim line, target line, and measurement arrows
This makes the script more than a pattern detector. It is also a visual explanation tool. The chart shows where the cup was detected, where the handle formed, how deep the cup is, and where the measured projection line comes from.
🧭 WHY THIS DOES NOT OVERLAP WITH OTHER AGPRO TOOLS
This script has its own lane inside the AGPro Series.
It is not a flag scanner, wedge detector, triangle breakout module, inside-bar breakout tool, Donchian breakout validator, double-top detector, head-and-shoulders detector, generic support-resistance map, or supply-demand zone script.
Its lane is specifically:
Cup rim recovery -> controlled handle depth -> breakout participation -> measured projection line.
The script focuses on the complete cup and handle lifecycle. It does not try to replace broader breakout engines, market-structure tools, support-resistance tools, liquidity tools, or trend dashboards. The defining feature is the combination of a recognizable cup-and-handle drawing with a quality panel that grades the actual pattern components.
⚙️ METHODOLOGY
The engine builds the pattern from pivot structure. A qualified setup begins with a left rim, moves into a cup low, recovers into a right rim, and then forms a handle pullback after the right rim.
The quality model evaluates:
1. Cup Symmetry
The script compares the two rim areas and measures how balanced the cup is over time. A cleaner return from the cup base into the right rim area produces a stronger symmetry reading.
2. Handle Depth
The handle is measured as a percentage of cup depth. A useful handle should create structure without pulling so deeply that the cup profile loses strength. The input range allows the user to control how strict or flexible the handle requirement should be.
3. Breakout Quality
Breakout quality is calculated from candle behavior and participation context. The script checks distance beyond the rim, candle body efficiency, close location, and relative volume against a configurable baseline.
4. Final Score
The final score combines the structure score and breakout behavior into a compact quality reading. Developing setups can be shown before breakout confirmation, while confirmed breakouts require the breakout quality gate.
📊 PANEL
The AGPro panel displays the main quality dimensions in a compact format:
- Cup Symmetry
- Handle Depth
- Breakout Quality
- Score
The first row follows the AGPro standard with a merged blue title row. Panel location, panel theme, panel font size, and label font size are adjustable from settings.
🎛️ KEY INPUTS
- Pivot Span controls structural sensitivity.
- Minimum Cup Bars defines the shortest accepted cup duration.
- Maximum Cup Bars defines the longest accepted cup duration.
- Maximum Rim Variance % controls how closely the left and right rims must align.
- Minimum Cup Depth ATR filters shallow structures.
- Minimum Handle Depth % filters handles that are too shallow.
- Maximum Handle Depth % filters handles that are too deep.
- Breakout Volume Baseline controls the relative volume comparison.
- Minimum Setup Score controls developing setup visibility.
- Minimum Breakout Quality controls confirmed breakout strictness.
- Minimum Pattern Score controls the final quality gate.
- Show Developing Setup controls pre-breakout visualization.
- Show Cup Path controls the curved cup drawing and cup candle box.
- Show Handle Box controls the detected handle range.
- Show Target Line controls the measured projection line.
- Show Measurement Arrows controls the DEPTH and MOVE explanation arrows.
- Pattern Stroke Width controls the thickness of the cup and handle outlines.
- Target Projection Bars controls how far the measured target line extends.
🔍 HOW TO READ IT
Start with the rim line. This is the reference level the structure must recover into and eventually move beyond.
Then read the cup. The subtle cup box marks the detected candle range, while the thick curved outline helps the formation read visually as a cup instead of a simple V-shaped swing.
Next read the handle. The handle box marks the controlled pullback area after the right rim. The curved handle outline makes the handle easier to recognize without turning it into a generic rectangle pattern.
The DEPTH arrow shows the measured cup depth. The MOVE arrow transfers that depth upward from the rim area. The TARGET line shows the forward measured projection level.
The panel summarizes the same structure numerically. Stronger Cup Symmetry, disciplined Handle Depth, and stronger Breakout Quality combine into the final Score.
🧩 BEST USE CASES
Cup and Handle Quality is best used on liquid symbols and timeframes where swing structure has enough room to develop. It is especially useful for users who want a clean visual map of a classic continuation pattern without filling the chart with unrelated pattern families.
The default settings are tuned for active discovery. Users who want fewer patterns can raise pivot sensitivity or score thresholds. Users who want a more reactive view can lower the score thresholds, while still using the chart visuals to review pattern quality.
🧠 VISUAL DESIGN PHILOSOPHY
The design philosophy is simple: make the pattern understandable without making the chart noisy.
The cup and handle are drawn with thick curved lines because this pattern is visual by nature. Newer users should be able to see the shape immediately. At the same time, the candle boxes keep the drawing grounded in the actual detected structure.
The target is shown as a line rather than a large zone, keeping the projection clean. The DEPTH and MOVE arrows explain the measurement logic without turning the indicator into a crowded education panel. Labels are compact, and the panel is restrained so the chart remains the main focus.
🔔 ALERTS
The script includes an alert condition for confirmed cup and handle breakouts.
Alert name:
Cup and Handle Quality Breakout
Alert message:
Cup and Handle Quality : high-quality cup and handle breakout confirmed on {{ticker}} at {{close}}.
Alerts are tied to confirmed breakout logic, which means the structure, breakout quality, and pattern score must pass the configured gates.
🔹 LIMITATIONS AND TRANSPARENCY
Cup and handle structures are pattern-based and depend on pivot interpretation. Different sensitivity settings can produce different structures on the same chart.
Very noisy markets, illiquid symbols, extreme gaps, and unusually compressed price action can reduce pattern readability. Lower thresholds may produce more setups, but visual review remains important when using any chart-pattern tool.
The thick cup and handle lines are designed as visual guides. The subtle candle boxes identify the detected structure ranges, while the curved outlines make the pattern easier to understand on the chart.
✅ IDEAL USER
This script is built for traders and analysts who want a clean, visual, and structured way to study cup and handle formations.
It is especially useful for:
- Users who want classic chart patterns with a modern quality layer
- Price-action traders who care about structure, handle depth, and breakout behavior
- Chart reviewers who want a clear visual explanation of the setup
- Newer users who benefit from seeing the cup, handle, depth, move, and target drawn directly on the chart
- AGPro users who want a focused cup-and-handle tool that does not overlap with broader breakout or market-structure scripts Indicator

Flag Continuation Zones [AGPro Series]🔷 Flag Continuation Zones
Flag Continuation Zones is a premium bull flag and bear flag continuation engine designed to identify clean continuation structures without turning the chart into a generic breakout scanner.
The script focuses on a classic, highly recognizable price-action sequence:
impulse pole → controlled flag compression → qualified breakout → forward continuation zone
Instead of marking every small consolidation as a flag, the engine validates the structure through pole strength, travel efficiency, flag depth, channel compression, trend alignment, breakout distance, and optional volume participation.
🔷 What Makes This Different
Most flag indicators are visually simple but structurally loose. They often label shallow pauses, random pullbacks, or broad ranges as flags.
Flag Continuation Zones takes a stricter route.
It first requires a validated impulse pole. The move must be large enough relative to ATR and efficient enough to show directional commitment. After that, the script waits for a controlled counter-trend flag window. The flag must remain compact, avoid excessive retracement, and preserve continuation structure before any breakout is accepted.
This creates a chart experience that is more selective, cleaner, and easier to trust visually.
🔷 How The Engine Works
The script evaluates four core stages:
1. Pole Validation
The prior impulse is measured by ATR multiple and path efficiency. This helps separate real directional movement from noisy grinding price action.
2. Flag Compression
After the pole, the script studies the consolidation window. A valid flag must remain inside an acceptable depth and range relative to the pole.
3. Breakout Confirmation
A continuation event is accepted only when price clears the flag boundary with an ATR buffer and, when available, enough volume participation.
4. Continuation Mapping
Accepted structures create a forward rectangular zone, an impulse pole line, a breakout label, and an optional measured-move projection line.
🔷 Visual Design
The visual language is intentionally restrained:
- clean bull and bear flag labels
- rectangular continuation zones
- impulse pole reference lines
- optional measured-move target line
- trend EMA context
- compact AG Pro status panel
- adjustable panel location
- dark and light panel themes
- adjustable label and panel font sizes
The goal is to make the pattern visible and premium without crowding the chart.
🔷 How This Is Different From Other AGPro Tools
This script is not a generic Trend Continuation Quality tool. It is not an abstract continuation scorecard.
It is specifically built around the flag pattern family:
- impulse pole quality
- flag channel compression
- breakout through the flag boundary
- measured-move continuation context
It also avoids overlapping with triangle, consolidation breakout, Donchian breakout, inside-bar breakout, and trendline tools by staying focused on the pole-and-flag structure itself.
🔷 Best Fit
This script is useful for traders who want to scan for cleaner bull flag and bear flag continuation patterns across crypto, forex, stocks, indices, and futures.
It is especially suitable for:
- continuation traders
- breakout traders who want stricter structure
- price-action traders who follow classic chart patterns
- users who prefer rectangular zones and measured-move context
- traders who want fewer but higher-quality labels
🔷 Key Inputs
Important controls include:
- Pole Lookback
- Flag Window
- Minimum Flag Bars
- Minimum Pole ATR Multiple
- Minimum Pole Efficiency
- Maximum Flag Depth
- Maximum Flag Range
- Breakout Buffer
- Volume Confirmation
- Signal Cooldown
- Zone Forward Bars
- Label Font Size
- Panel Location
- Panel Theme
- Panel Font Size
🔷 In One Sentence
Flag Continuation Zones turns the classic bull flag and bear flag pattern into a cleaner, scored, zone-based continuation map built for premium public chart presentation.
Indicator

Wedge Reversal Detector [AGPro Series]Wedge Reversal Detector
🔷 Overview
Wedge Reversal Detector is a focused chart-pattern engine built for one specific structure: the rising wedge and falling wedge. Instead of scanning every possible reversal pattern, drawing broad support and resistance, or behaving like a generic breakout dashboard, this script studies the geometry of a wedge itself: confirmed pivot boundaries, slope convergence, pattern maturity, reversal break quality, projected reaction zone, and invalidation context.
The goal is to make wedge analysis cleaner and more objective on a live chart. A valid wedge is not treated as just two random trendlines. The script requires a confirmed pivot structure, a meaningful initial width, a narrowing final width, and the correct slope relationship for either a rising wedge or a falling wedge. Once a qualified structure is active, it draws the converging boundaries directly on the chart and waits for a reversal-side break.
The detector also includes two visual preparation layers. The developing-wedge preview layer can draw dashed boundaries before the structure is fully armed. The Wedge Radar layer keeps the latest compression window visible when no confirmed candidate is active. Radar projection is capped so higher-timeframe charts stay clean, and low-compression radar states can remain boundary-only until the structure becomes visually meaningful. Break labels, reaction zones, and invalidation guides remain reserved for stricter confirmed candidates. This keeps the chart visually informative without weakening the actual confirmation logic.
The visual layer includes compact boundary tags that label the upper and lower rails directly on the right side of the structure. These tags are designed as chart annotations, not signal spam: they identify whether the rail is acting as a rejection rail, compression rail, reclaim rail, break rail, or invalidation rail. A single optional compression tag can also summarize the current radar or wedge state.
🔶 Why This Is Different
Many wedge indicators stop at pattern drawing. Others become broad pattern scanners that mix wedges with channels, double tops, double bottoms, triangles, support and resistance zones, and unrelated reversal signals. Wedge Reversal Detector intentionally stays narrower.
Its edge is the sequence:
1. Detect a qualified rising or falling wedge from confirmed pivots.
2. Measure whether the boundaries are genuinely converging.
3. Grade wedge maturity before any break occurs.
4. Confirm the reversal-side break with an optional close-based rule and ATR buffer.
5. Score break quality using maturity, boundary expansion, candle structure, close location, and volume participation.
6. Project a concept-native reaction zone from the wedge width.
7. Display a clean invalidation guide so the structure remains readable after the break.
This makes the script a wedge lifecycle tool, not a general reversal scanner.
💎 Unique Edge
The most important difference is that the script treats a wedge as a living geometric compression structure. It does not simply connect the latest two highs and lows and call the pattern complete. A candidate must pass span, width, convergence, and slope requirements before it becomes active.
For rising wedges, the script looks for rising pivot highs and rising pivot lows where the lower boundary is climbing faster than the upper boundary. This creates upward compression, which is the core geometry behind a rising wedge. For falling wedges, it looks for falling pivot highs and falling pivot lows where the upper boundary is falling faster than the lower boundary. This creates downward compression, which is the core geometry behind a falling wedge.
That difference matters because many weak wedge tools confuse ordinary channels with wedge compression. This script separates those structures by requiring the final width to be materially smaller than the starting width.
🔹 Methodology
The engine begins with confirmed pivot highs and pivot lows. The user controls the pivot confirmation length, which allows the detector to be tuned for intraday, swing, or higher-timeframe charts.
From the latest confirmed swing pair, the script builds two boundary lines:
- Upper boundary from confirmed pivot highs
- Lower boundary from confirmed pivot lows
The detector then evaluates:
- Pattern span in bars
- Initial boundary width measured against ATR
- Final boundary width relative to the starting width
- Upper boundary slope
- Lower boundary slope
- Correct rising-wedge or falling-wedge geometry
Only when those requirements align does the pattern become an active wedge.
🔸 Break Quality Model
A wedge break is scored only after the reversal-side boundary is broken. The break quality score is built from multiple factors:
- Wedge maturity
- Distance beyond the broken boundary
- Candle body participation
- Close location inside the break candle
- Volume ratio versus recent average volume
The score is translated into a simple grade so the chart stays easy to read. This does not claim that a break must continue. It gives the user a structured read of how strong the confirmed break appears under the script's own rules.
🎯 Projected Reaction Zone
After a confirmed wedge reversal break, the script projects a reaction zone using the initial wedge width. This zone is not a generic support/resistance box. It is tied directly to the wedge geometry and appears only after the structure confirms. The goal is to show the next area where price may naturally react after escaping the compression.
The zone width and projection length are configurable, so users can keep the chart compact or allow more forward context depending on timeframe and style.
🧭 Invalidation Context
The script also draws an invalidation guide after a confirmed break. For a bullish falling-wedge break, invalidation is tracked below the opposite wedge boundary with an ATR buffer. For a bearish rising-wedge break, invalidation is tracked above the opposite wedge boundary with an ATR buffer.
This keeps the post-break structure organized without adding trade instructions or turning the script into a strategy.
📊 Panel
The compact AGPro panel summarizes the current wedge lifecycle:
- Wedge Type
- Maturity
- Break Quality
- Target Zone
Panel location, panel theme, and panel font size are adjustable from settings. The first panel row uses the AGPro standard: one merged blue header row containing only the panel title.
⚙️ Key Settings
- Pivot Confirmation Length controls how strict the swing structure is.
- Minimum Wedge Span filters out tiny patterns.
- Maximum Final Width Ratio controls how much convergence is required.
- Developing Wedge Preview Ratio controls how early dashed formation boundaries can appear.
- Wedge Radar controls the latest-window visual radar that prevents panel-only charts while waiting for confirmed wedge geometry.
- Radar Projection Bars limits how far radar boundaries extend into future bars.
- Radar Fill Threshold keeps low-compression radar structures from creating oversized filled areas.
- Boundary Tags add compact right-side rail annotations so the structure is easier to read without covering candles.
- Compression Tag shows one status label for radar compression or armed-wedge maturity.
- Boundary Break Buffer ATR adds confirmation distance beyond the wedge boundary.
- Volume Confirmation Ratio contributes to break quality scoring.
- Projection Length Bars controls how long the reaction zone extends forward.
- Label Font Size and Label Offset ATR help maintain a clean chart presentation.
🧩 How It Differs From Other AGPro Tools
This script is intentionally separate from AGPro channel, breakout, liquidity, and broad reversal tools.
It is not a channel map. Channel tools organize parallel or multi-family structure. Wedge Reversal Detector only studies converging wedge geometry.
It is not a double top or double bottom detector. Those patterns are based on repeated horizontal rejection and neckline behavior. This script is based on converging diagonal boundaries.
It is not a broad reversal scanner. It does not combine every reversal pattern into one dashboard. It stays focused on wedge compression, wedge maturity, reversal break, projected reaction zone, and invalidation.
It is not a generic breakout quality tool. Break quality is evaluated only after a valid rising or falling wedge exists.
🔔 Alerts
The script includes alerts for:
- Bullish falling wedge break
- Bearish rising wedge break
- High quality wedge break
- Wedge invalidation
These alerts are event notifications for the detected structure, not automated trading instructions.
✨ Best Use Case
Wedge Reversal Detector is best suited for traders who already watch chart patterns, market structure, compression, and failed trend continuation. It helps reduce manual drawing by highlighting qualified wedge structures, then keeping the chart organized through the confirmation, projection, and invalidation phases.
The result is a clean, premium, wedge-specific workflow designed for public chart reading: fewer random lines, fewer noisy labels, and a clearer view of whether the wedge structure is still forming, breaking, projecting, or invalidating.
Indicator

Turtle Soup Reversal Map [AGPro Series]Turtle Soup Reversal Map
🔹 Overview
Turtle Soup Reversal Map is a mean-reversion pattern detector inspired by Linda Raschke's classic "Turtle Soup" setup — a counter-attack on failed 20-bar breakouts. When price pierces a multi-bar extreme and then closes back inside the prior range, institutional traders often interpret it as trapped breakout participants being flushed. This script automates the detection, qualifies each setup with a transparent 0–100 score, and projects a reference target alongside an auto-resolving rejection zone. It is designed for traders who want a disciplined, rule-based way to spot failed breakouts without drawing them manually.
🔹 Unique Edge
Unlike generic liquidity-sweep or wick-rejection indicators, Turtle Soup Reversal Map is built around Raschke's specific 20-bar-extreme rule — a pattern with decades of documented performance in swing-trading literature. Three characteristics separate it from similar tools:
• Strict N-bar-extreme definition (not a simple swing-high/low fade). Price must violate the exact prior-lookback extreme, not just a minor pivot.
• Five-component adaptive quality score — wick rejection, volume spike, overshoot magnitude, higher-timeframe trend alignment, and key-level proximity. Each component is a transparent weighted contribution, with clear A+ / A / B / C grades.
• Full lifecycle state engine — Pending → Fired → Target/Stop/Invalidated. Setups that do not confirm within their window are auto-invalidated (not left hanging), and live win-rate plus average R-multiple are tracked over the most recent resolved setups.
🔹 Methodology
The script continuously monitors for price piercing the highest high or lowest low of the prior N bars (default 20, range 10–50). When a sweep occurs, a Pending setup is created. Confirmation is then evaluated in one of two user-selectable modes:
• Same-Bar Close — the violating bar must close back inside the prior range on the same bar (faster, more signals).
• Next-Bar Close — Raschke's original specification; the next bar must close back inside the prior range (slower, higher reliability).
If confirmation fires, the setup becomes Fired and a reference target is projected from the confirmation close (default 2.5 × ATR(14)). Stop is placed at the sweep extreme plus a configurable ATR buffer. Setups that fail to confirm within their window, or where price overshoots the stop before confirmation, are automatically invalidated.
The quality score blends: wick-to-range ratio at the extreme bar, relative volume spike versus its 20-bar average, overshoot magnitude (ATR-normalized with a sweet-spot curve), counter-trend alignment against a user-defined higher timeframe, and proximity to round numbers or recent pivot levels.
🔹 Signals & Alerts
The script produces three alert types, all configurable:
• Pending — sweep detected, awaiting confirmation.
• Fired — confirmation closed back inside prior range.
• Invalidated — setup dismissed due to overshoot or window timeout.
Each alert message includes direction (Bull/Bear), current grade, ticker, and timeframe. Fired setups are visualized with a labeled confirmation marker, a dashed target-projection line, a dotted stop-reference line, and an auto-closing rejection zone. Labels display the Soup-Bull / Soup-Bear name, grade, and numeric score.
🔹 Key Inputs
• Lookback Bars — size of the extreme window (default 20, range 10–50).
• Confirmation Mode — Same-Bar Close or Next-Bar Close.
• Invalidation Distance (ATR) — stop buffer beyond the sweep extreme (default 0.5).
• Target Projection (ATR) — reference reversal target distance from entry (default 2.5).
• Quality Score Components — each of the five score components can be toggled independently for custom configurations.
• HTF for Trend — higher timeframe used for the trend-alignment component (default 240 min).
• Stats Sample Size — rolling window of resolved setups used for win-rate and average reward metrics (default 30).
• Visual & Panel Options — zones, lines, labels, target projection, panel location, font sizes, and per-element toggles.
🔹 How to Use
1. Apply to any liquid instrument and timeframe. The pattern's rule set is symbol-agnostic but performs differently across assets — review the live Win Rate and Avg Reward metrics in the panel to calibrate expectations.
2. Watch the Status field in the panel. Idle means no active setup; Pending Bull/Bear means a sweep has occurred and the script is waiting for confirmation; Fired Bull/Bear means confirmation closed and a target has been projected.
3. Filter setups by grade. A+ and A setups have stronger confluence — particularly wick rejection, volume, and HTF alignment. B setups are acceptable under favorable market regimes; C grades are educational only.
4. Treat the target projection as a reference, not a trade instruction. The stop reference line marks where the structural invalidation lies. Always combine with your own risk management.
5. The historical Win Rate is computed over the last N resolved setups on the current chart; it reflects the pattern's fit with the current symbol and timeframe, not a guarantee.
🔹 Limitations & Transparency
This indicator identifies historical setups algorithmically. It does not predict future price movement, and no indicator does. Turtle Soup is a counter-trend mean-reversion pattern — in strong trending regimes, false signals increase; in consolidation and range-bound conditions, it performs best. The displayed Win Rate and Avg Reward are historical, rolling, chart-dependent, and should not be interpreted as future expectations. Target and stop references are geometric projections based on ATR, not optimized parameters.
🔹 Risk Disclosure
This script is a technical analysis tool for educational and research purposes. It is not a trading strategy, not a recommendation, and not financial advice. Past performance does not guarantee future results. Always conduct your own analysis and use proper risk management. Trade at your own risk. Indicator

Head & Shoulders Auto Detector [AGPro Series]Head & Shoulders Auto Detector
🎯 **Overview**
Head & Shoulders Auto Detector is a precision pattern recognition tool that automatically identifies classic Head & Shoulders (bearish) and Inverse Head & Shoulders (bullish) reversal formations across any market and timeframe. Built from the ground up for traders who want the full lifecycle of a pattern tracked on-chart — not just a label and a line, but forming → confirmation → target/stop outcome — with a transparent, quality-scored framework that filters low-probability setups before they clutter the chart.
Every pattern carries a composite quality score, a symmetry percentage, an ATR-adaptive neckline, two projection targets, and a live status label that evolves through the pattern's lifespan.
🔹 **Unique Edge**
Most H&S indicators stop at detection. This one goes further:
• **Full lifecycle state machine** — every pattern moves through four explicit states (Forming → Confirmed → Target Hit / Stopped / Invalidated / Expired), and the visuals update in real time at each transition.
• **Dead pattern hygiene** — once a pattern fails or hits target, orphan TP and stop lines are removed, the neckline freezes at the decision bar, and the status label grays out. The chart never accumulates stale clutter.
• **Quality-driven visual hierarchy** — high-quality patterns (Q≥75) are rendered with a star marker and full saturation, mid-tier patterns get standard treatment, and low-tier patterns (Q<60) fade into the background so the trader's eye is guided to what matters.
• **Dual-target projection with R:R** — every confirmation displays both a classic measured-move TP1 and an extended 1.618× TP2, each labeled with the exact reward-to-risk ratio calculated at entry.
• **ATR-adaptive everything** — shoulder tolerance, neckline flatness, head prominence, stop buffer, and label offsets all scale with volatility, so the same settings work across BTC 4H, gold daily, or small-cap stocks.
🔹 **Methodology**
Patterns are detected from confirmed pivot highs and lows using a configurable pivot length. For a valid Head & Shoulders, three same-side pivots (Left Shoulder → Head → Right Shoulder) must satisfy:
• Head extends beyond both shoulders by at least the configured ATR multiple (prominence test).
• Shoulder heights differ by less than the shoulder tolerance in ATR units (symmetry test).
• Two opposite-side pivots between LS-Head and Head-RS define the neckline; their vertical distance must be within the neckline tolerance.
• Composite symmetry score (50% time symmetry, 50% price symmetry) must exceed the minimum threshold.
Quality score combines four weighted components:
• Symmetry (45%) — time + price balance between shoulders
• Neckline flatness (25%) — how horizontal the neckline is
• Volume profile (15%) — head-bar volume relative to shoulder average
• Head prominence (15%) — how clearly the head dominates
Confirmation triggers when price closes beyond the neckline level (interpolated for sloped necklines). Stop is placed at the head level plus an ATR buffer to avoid wick stop-outs. TP1 uses the standard head-to-neckline measured move; TP2 extends to 1.618× that projection.
🔹 **Signals & Alerts**
Four alert events available:
• **Pattern Forming** — a valid H&S or Inverse H&S structure has been detected but not yet confirmed.
• **Pattern Confirmed** — close has broken the neckline; entry is live with TP/Stop drawn.
• **Target Hit** — TP1 has been reached on a confirmed pattern.
• **Neckline Retest** — after confirmation, price has returned to touch the neckline (common high-probability re-entry zone).
🔹 **Key Inputs**
• **Pivot Length** — controls swing-point sensitivity
• **Min Symmetry Score** — minimum shoulder symmetry percentage to accept a pattern (default 60, balanced)
• **Neckline Tolerance (ATR)** — how sloped a neckline is allowed to be
• **Shoulder Height Tolerance (ATR)** — how different the two shoulders can be
• **Head Prominence (ATR)** — minimum head extension beyond shoulders
• **Volume Soft Confirmation** — toggle volume influence on quality score
• **TP1 Method** — Classic (horizontal neckline reference) or Measured Move (slope-aware)
• **Stop Buffer (ATR)** — extra room beyond the head level (default 0.35)
• **Max Pattern Lifetime** — bars after which an unconfirmed pattern expires
• Full visual controls: font size, panel position, theme, zone display, label offset, color palette
🔹 **How to Use**
1. Apply the indicator to any liquid market and timeframe. 4H and higher tend to produce the most reliable formations; intraday works but expects more noise.
2. Watch for patterns labeled with a ⭐ and bright color (Q≥75) — these are the highest-confidence setups.
3. Wait for the ✓ Confirmed status to appear before entering; the ⚡ breakout marker pinpoints the exact confirmation bar.
4. Use the TP1 / TP2 R:R labels to size the trade. Stop is pre-calculated at head level + ATR buffer.
5. Monitor the panel stats over time to understand the indicator's behavior on your specific market — Win Rate, Avg Quality, and Last Signal all update live.
6. Consider combining with trend context (a bearish H&S is far more powerful at resistance in a downtrend than in the middle of a strong uptrend).
🔹 **Limitations & Transparency**
• Pattern detection uses confirmed pivots, so signals appear with a natural delay equal to the Pivot Length setting. This is intrinsic to pivot-based logic, not a flaw.
• Quality score and historical win rate are chart-native calculations based on the loaded history; they are descriptive, not predictive.
• The script does not include multi-timeframe confluence or trend filters — these are deliberate design choices to keep the tool focused and composable with other indicators.
• Volume confirmation is a soft scoring input, not a hard filter, since many crypto pairs and indices have volume data of variable reliability.
• Pattern state transitions use close-based confirmation; intrabar wicks do not trigger state changes except for stop/target hits, which are high/low based as expected.
🔹 **Risk Disclosure**
This indicator is an analytical tool, not a trading recommendation or financial advice. Pattern recognition describes what has formed on a chart; it does not predict future price movement with certainty. Always use proper risk management, position sizing, and confirm signals with your own analysis. Past pattern statistics shown on the panel are descriptive of the visible history and do not guarantee future performance. Trading involves substantial risk of loss. Indicator

Double Top / Bottom Quality [AGPro Series]Double Top / Bottom Quality
Double Top / Bottom Quality is a disciplined, rules-based detector for the two most iconic reversal chart patterns: the Double Top (M-shape) and the Double Bottom (W-shape). Unlike basic pattern finders that fire on any two similar swings, this indicator scores every candidate pattern on a transparent 0–100 Quality Score across four independent factors — and only confirms patterns that pass a user-defined minimum. The result is a cleaner chart with fewer, higher-conviction setups.
Every confirmed pattern delivers a full trading lifecycle: a neckline flip S/R zone (resistance → support on a Double Bottom; support → resistance on a Double Top) and a measured-move target projection band. Pending, confirmed, target-hit and invalidated states are all tracked with disciplined cleanup, so the chart never becomes cluttered.
🔹 WHAT THE INDICATOR DOES
It detects classic Double Top and Double Bottom reversal structures using pivot-based swing analysis with ATR-normalised equality, depth and time-window filters. Each valid candidate is then scored on four independent quality factors. Only candidates that exceed the user-defined minimum score and break the neckline on close are confirmed. Once confirmed, the pattern draws its neckline flip zone and target projection band, labels the setup with its letter grade and score, and tracks the outcome until target hit or invalidation.
🔹 UNIQUE EDGE — WHY IT IS DIFFERENT
Most Double Top / Double Bottom scripts simply connect two similar swings and draw a line. This indicator adds a transparent 4-component Quality Score so every setup is rated before confirmation, not just flagged. Three factors that most scripts ignore are treated as first-class inputs here:
• Pattern Symmetry — the left leg and the right leg of the M / W must be comparable in time, or the pattern is penalised
• Break Volume Confirmation — the neckline break bar is compared to its rolling volume average, and thin breaks score lower
• Depth Quality — shallow, flat patterns are filtered out in favour of deep, decisive reversals
The full lifecycle visualisation (pending → confirmed → target hit) and same-region deduplication are also uncommon in this pattern category, and together they produce a chart that reads cleanly even on long history.
🔹 METHODOLOGY
• Pivot detection via ta.pivothigh / ta.pivotlow with user-configurable length
• Equality check: the two peaks (or troughs) must be within a configurable ATR tolerance
• Time-window filter: minimum and maximum bars allowed between the two pivots
• Depth filter: the vertical distance from peaks to neckline must exceed a minimum ATR threshold
• Neckline: lowest low between the two peaks for a Double Top, or highest high between the two troughs for a Double Bottom
• Confirmation trigger: daily close beyond the neckline
• Invalidation: price exceeds the pattern extreme before the neckline break
• Cooldown: after confirmation, new patterns in the same price region are suppressed for N bars to prevent clustering
🔹 QUALITY SCORE (0–100)
Each confirmed pattern receives a transparent score based on four equally-weighted factors (25 points each):
1. Peak / Trough Equality — how close the two extremes are to each other, measured in ATR units
2. Break Volume Confirmation — break-bar volume relative to the 20-bar average
3. Pattern Symmetry — ratio of the shorter leg to the longer leg (time-based)
4. Depth Quality — pattern height relative to ATR (deeper = higher score)
Score → Grade mapping:
• 85–100 = A
• 70–84 = B
• 55–69 = C
• <55 = D
🔹 SIGNALS, ZONES & ALERTS
Once a pattern confirms, the indicator renders:
• A solid neckline that extends to the right edge
• A neckline flip zone (rectangular S/R band at the neckline level)
• A target projection zone at the measured-move price (pattern height projected from neckline)
• A grade label (A / B / C) and numeric score on the pattern
Two alert types are available: "Confirmed Pattern" fires on confirmation, and "Target Hit" fires when the measured-move target is reached.
🔹 KEY INPUTS
• Pivot Length, ATR Length
• Peak / Trough Equality tolerance (ATR)
• Min / Max bars between peaks
• Minimum Pattern Depth (ATR)
• Break Volume Multiplier
• Cooldown bars
• Minimum Quality Score filter
• Show Pending Patterns toggle
• Show Neckline Flip Zone / Target Zone toggles
• Zone Width (ATR)
• Stale Cleanup Distance, Max Active Zones
• Label size, Panel position / theme / size
• Alert toggles
🔹 HOW TO USE
• Choose a liquid market and a timeframe that matches your trading style (4H and 1D are particularly well-suited to classic reversal patterns)
• Watch for Pending patterns (dashed lines) — these mark candidates awaiting a neckline break
• A Confirmed pattern with grade B or higher is the typical entry signal; aggressive traders may use C-grade while conservative traders may filter to A-grade only
• Use the neckline flip zone as a logical stop-loss reference (above it for Double Tops, below for Double Bottoms)
• Use the target projection zone as a take-profit reference based on the classical measured-move rule
• Combine with higher-timeframe trend, volume profile or an independent confluence tool for best results
🔹 LIMITATIONS & TRANSPARENCY
• Pivot-based detection means patterns confirm with a natural lag equal to the pivot length
• No strategy is 100% reliable — Quality Score filters improve average conviction but do not guarantee outcomes
• Very low-liquidity markets may produce unstable pivots; a longer pivot length helps
• Measured-move targets are a classical reference, not a prediction
• Historical statistics shown in the panel are pattern-completion counts on the loaded chart; they are not a guaranteed forward performance estimate
🔹 RISK DISCLOSURE
This script is provided for educational and analytical purposes only. It is not financial advice and does not constitute a recommendation to buy, sell or hold any asset. Trading involves substantial risk of loss; past pattern performance is not indicative of future results. Always perform your own research and use appropriate risk management.
Open-source under the Mozilla Public License 2.0 — contributions and feedback are welcome. Indicator

Swing Failure Pattern (SFP) Engine [AGPro Series]Swing Failure Pattern (SFP) Engine
────────────────────────────────────────────────────────────
OVERVIEW
────────────────────────────────────────────────────────────
Swing Failure Pattern (SFP) Engine detects high-probability liquidity sweep
events at prior swing highs and lows. An SFP occurs when price pierces a
recent swing level with a long wick but closes back inside the prior range,
signalling failed continuation and potential mean reversion. Each event is
scored on four components, drawn as a mid-sized support/resistance reaction
zone, and tracked through its live cycle — with panel statistics on MFE,
MAE, and hit rate. Designed for visual pattern reading and confluence;
not a buy/sell system.
────────────────────────────────────────────────────────────
UNIQUE EDGE
────────────────────────────────────────────────────────────
Most SFP indicators mark the sweep candle and stop there. This engine treats
each SFP as a living support/resistance band: the zone extends to the right
every bar and only freezes when the swept level is actually broken on close.
That preserves the SR context that traders use in real decisions, without
cluttering charts with zones that never die. A composite score (0-100),
confluence grouping of nearby events within 0.5 ATR, and live MFE/MAE
tracking in ATR units turn a common pattern into a measurable framework.
────────────────────────────────────────────────────────────
METHODOLOGY
────────────────────────────────────────────────────────────
Swing detection uses pivot highs and lows confirmed by a configurable
lookback. An SFP is confirmed on bar close when four conditions are met:
1. The bar wicks beyond a prior unswept swing high (bearish) or swing low
(bullish) within the active lookback window.
2. The close reclaims the prior range by at least the user-defined ATR
distance (default 0.25 ATR).
3. The sweep-side wick represents at least the minimum wick ratio of total
bar range (default 55 percent).
4. Bar volume exceeds its 20-period SMA by the configured multiplier
(optional, default 1.15x).
Composite score (0-100) weights wick ratio (40), reclaim distance in ATR
(30), volume confirmation (15), and swing age (15). Only events above the
minimum score threshold are drawn. Each confirmed SFP removes its swept
swing from the active array to prevent re-triggering on the same level.
Confluence grouping merges same-side events within 0.5 ATR into a single
labelled zone with an x2, x3 count.
────────────────────────────────────────────────────────────
SIGNALS & ALERTS
───────────────────────────────────────────────────────────
Visual signals on chart:
- State-coloured label at the sweep bar reading Bull SFP or Bear SFP with
the composite score (e.g., Bull SFP 74). Confluence-grouped events are
suffixed with the merge count (e.g., Bear SFP 81 x2).
- Rectangular zone spanning the swept level and the SFP close, with a
small ATR buffer. The zone extends right each bar while active and
freezes in neutral grey when the swept level breaks.
- Dotted horizontal line marking the swept swing level.
- Dashed projection line indicating the reversal direction.
Alert conditions:
- Bullish SFP: fires on the confirmation bar of a bullish event above
the score threshold.
- Bearish SFP: same, for bearish events.
- Zone Invalidation (optional): fires when an active zone's swept level
is broken on close.
────────────────────────────────────────────────────────────
KEY INPUTS
────────────────────────────────────────────────────────────
Detection:
- Swing Pivot Length - bars each side of a pivot (default 5).
- Swing Lookback - how far back active swings are tracked (default 120).
- Min Wick Ratio - minimum sweep wick as fraction of bar range (0.55).
- Min Reclaim Distance (ATR) - how far close must reclaim (0.25 ATR).
- Require Above-Average Volume and Volume Multiplier (default 1.15x).
- ATR Length (default 14).
Scoring & Filters:
- Min SFP Score (default 55 of 100).
- Max Active Zones retained on chart (default 8).
- Stats Timeout - bars after which an unresolved event is counted in
averages (default 30). Does not affect zone visibility.
Visuals:
- Zone transparency (default 80), confluence grouping distance (0.5 ATR),
label size, and toggles for zones, swing lines, and reversal projections.
Panel:
- Location (8 options), Dark/Light theme, text size.
Alerts:
- Independent toggles for bullish, bearish, and invalidation alerts.
────────────────────────────────────────────────────────────
HOW TO USE
────────────────────────────────────────────────────────────
Apply the indicator to any chart and timeframe. Higher timeframes (1h and
above) produce cleaner swings; lower timeframes require a higher Min Wick
Ratio and Min Score to filter noise.
Read SFPs as liquidity sweep events, not standalone entries. A bullish SFP
below a prior swing low indicates that sellers failed to extend the move —
often a location where larger participants accumulate. The score reflects
sweep quality; higher scores (70+) generally correspond to cleaner
rejections. Use the zone as a support/resistance reference until it is
invalidated.
Panel statistics describe the observed sample on the loaded chart, not a
backtested system. MFE Hit Rate is the percent of resolved zones that
reached 1 ATR in the SFP direction before the swept level broke — it is a
quality reference, not a win rate for any trading strategy.
────────────────────────────────────────────────────────────
LIMITATIONS & TRANSPARENCY
────────────────────────────────────────────────────────────
- Signals confirm on bar close; intrabar conditions may change until close.
- Pivot detection introduces a natural bars-of-right-context lag equal to
the Pivot Length. This is intrinsic to any pivot-based approach.
- Panel statistics reflect events visible on the current chart load and
will vary with timeframe, symbol, and bar range.
- MFE Hit Rate is not a profit expectation. It measures whether price
moved 1 ATR in the SFP direction before the swept level broke.
- Volume confirmation uses chart volume and may behave differently on
symbols with inconsistent volume data.
- The indicator uses standard Pine Script drawing objects. Chart reload
may reset ephemeral visual states of resolved zones.
────────────────────────────────────────────────────────────
RISK DISCLOSURE
────────────────────────────────────────────────────────────
This indicator is a visualisation and analysis tool. It is not a trading
system, not financial advice, and not a signal service. It does not
predict future price movement. All trading decisions carry risk of loss
and are the sole responsibility of the user. Historical pattern behaviour
does not guarantee future results. Test thoroughly on your instruments
and timeframes before making any decisions. Indicator

Judas Swing Detector [AGPro Series]Judas Swing Detector
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The Judas Swing is a well-known intraday pattern in ICT (Inner Circle Trader)
methodology describing how price often makes a deceptive initial move at the
London or New York session open — pulling in participants in one direction —
before reversing to reveal the session's true directional bias.
Judas Swing Detector systematically identifies, visualizes, and tracks this
pattern across every London and New York session open. It shades the trap
zone, flags the reversal bar, highlights the true-direction bias, and maintains
a rolling 20-session performance log so users can assess how consistently the
pattern resolves on their chosen symbol and timeframe.
IMPORTANT — Timeframe requirement: This indicator is designed for intraday
charts of 1 hour or lower (1m, 5m, 15m, 30m, 1h). Session windows anchor the
entire logic, and a 1-hour Judas window cannot be resolved on 4-hour or higher
charts. The panel always shows an "Optimal TF: 1m - 1h" footer, and the TF
status row turns yellow with "use <=1h" if the current chart exceeds this
range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
UNIQUE EDGE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Unlike generic session-open or breakout indicators, Judas Swing Detector is
built around a defined four-state lifecycle (Pending → Active → Forming →
Confirmed / Failed) with ATR-normalized thresholds, so detection remains
stable across different volatility regimes and asset classes.
Three design choices make it distinct:
1. Independent two-way extremum tracking inside the Judas window — both the
maximum upward and maximum downward excursion are recorded, and the larger
of the two is declared the fake move when the window closes. This removes
ambiguity in choppy openings.
2. Separate fake-move and reversal thresholds. The initial push must exceed
a minimum ATR-scaled size to qualify, and the reversal must travel a second
ATR-scaled distance beyond the session open — filtering out shallow round
trips that would otherwise inflate the signal count.
3. Rolling 20-session statistics panel reporting success rate, average fake
distance, and directional bias, giving discretionary traders an objective
view of how the pattern is behaving on their instrument before they act on
it.
4. Support/resistance-style invalidation zone drawn at the fake-move extremum
after confirmation. This gives a clear visual anchor: if price later
re-enters this zone from the opposite side during the session, the Judas
read is considered broken. The zone is a reference, not an automatic
signal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
METHODOLOGY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 — Session anchoring
At the first bar of the configured London or New York window the script
records the session open price, resets the two-way extremum trackers, and
transitions to the Active state.
Step 2 — Fake-move accumulation
During the window the script tracks both the maximum high and minimum low
relative to the session open. Neither is committed as the fake move until the
window closes.
Step 3 — Window-close evaluation
When the window ends the larger excursion (up vs down) becomes the fake
direction. If its size reaches the user-defined ATR multiple it qualifies and
the script transitions to the Forming state; otherwise it resets to idle.
Step 4 — Reversal confirmation
In the Forming state the script waits for price to cross the session open in
the opposite direction of the fake move and travel at least the configured
ATR-scaled distance beyond it. When that happens the swing is Confirmed and
the true direction is drawn on the chart. If the reversal window expires
without confirmation the swing is recorded as Failed.
Step 5 — History log
Every confirmed and failed outcome is appended to a rolling 20-session log
used by the statistics panel.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SIGNALS & ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
On-chart visuals:
• Dashed vertical line at session start (accent color)
• "LON" or "NY" label at the session anchor bar (Balanced / Detailed only)
• Shaded fake-move box from session open to fake extremum, colored opposite
to the true direction (a bearish trap is shaded in the bear tone because
the true direction is down — and vice versa)
• Optional "Fake" distance label at the extremum (Detailed density only)
• Reversal marker "X UP" or "X DOWN" at the confirmation bar, offset
from the candles for readability
• Horizontal support/resistance-style invalidation zone around the fake
extremum, extending 40 bars to the right — a visual reference for where
the Judas read would break down if price re-enters the zone
Alert conditions (toggle individually in settings):
• Judas Swing Forming — fake move has qualified, waiting for reversal
• Judas Swing Confirmed — reversal threshold crossed, true direction known
• Judas Swing Failed — reversal window expired without confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
KEY INPUTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Session Windows
• Track London Open — toggle London session monitoring
• London Judas Window (NY time) — session string, default 0200-0300
• Track New York Open — toggle NY session monitoring
• NY Judas Window (NY time) — session string, default 0930-1030
• Session Timezone — timezone used to interpret the windows
• Reversal Window (minutes) — maximum time after window close in which a
valid reversal can still be recorded
Detection Logic
• Min Fake-Move Size (ATR mult) — minimum excursion required to qualify
• Reversal Confirmation (ATR mult) — distance beyond session open needed
to confirm the reversal
• ATR Length — lookback for threshold scaling
Visuals
• Show Session Start Line, Show Fake-Move Zone, Show Reversal Marker,
Show Invalidation Zone — individual visual toggles
• Label Density — Minimal / Balanced / Detailed
• Font Size — tiny / small / normal / large (applies to labels and panel)
• Theme — Dark / Light (panel only, chart candles unaffected)
Panel
• Show Info Panel — master toggle
• Panel Location — 6 chart positions
• Always displays: current session, state, true direction, fake distance,
rolling 20-session statistics (success rate, avg distance, bull/bear
bias), current TF status, and a footer reminding the optimal timeframe
range
Alerts — three individual toggles (Forming / Confirmed / Failed)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Supported timeframes: 1m, 5m, 15m, 30m, 1h. These resolve a session's early
structure cleanly while keeping enough bars inside each Judas window for the
extremum tracker to work with. Recommended default: 15m or 1h.
Not supported: 4h, 1D, 1W. On these timeframes a single bar exceeds the
session window, so nothing is detected. The panel will show a yellow "use
<=1h" hint if you accidentally switch to one of these.
Recommended instruments: FX majors (EURUSD, GBPUSD, USDJPY), index futures
(NQ, ES), liquid crypto (BTC, ETH). The ATR-normalized thresholds keep the
logic portable across these asset classes.
Workflow suggestion:
1. Apply the indicator and let it observe several sessions so the panel
populates a meaningful sample.
2. Review the 20-session success rate on your specific symbol and timeframe.
This is not a forecast — it is a descriptive statistic of how the pattern
has resolved in recent history on that chart.
3. Use the Forming alert as a heads-up, and the Confirmed alert as the main
event. The true-direction arrow marks the bias of the remaining session,
not a trade entry or exit.
4. Combine with your own structural context — higher timeframe bias, key
levels, liquidity pools — before acting on any signal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
LIMITATIONS & TRANSPARENCY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Not a strategy. This is a discretionary analysis tool; it neither places
orders nor implies any specific trade setup.
• Intraday timeframes only. The logic requires 1h or lower charts to resolve
the session windows. On 4h, 1D or higher the indicator will not detect
anything and the panel will show a "use <=1h" notice.
• No forecasting. Displayed statistics describe past behavior on the current
chart only and do not imply future performance.
• Pattern-dependent. When price opens and trends cleanly in one direction
without a fake move, the pattern legitimately will not trigger. Low
signal count on such sessions is expected behavior, not a malfunction.
• Session boundary sensitivity. Results depend on the configured session
windows and timezone. Outside the major FX and equities session hours the
ICT framing may not translate cleanly.
• Extreme-volatility sessions. During very large gaps or news spikes the ATR
thresholds can be dominated by a single bar; users should review the
defaults in those conditions.
• Symbol coverage. Pip conversion handles forex and JPY pairs explicitly and
falls back to tick-based sizing for other asset types. Values are intended
as relative magnitudes, not broker-specific pip quotes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RISK DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is provided for educational and analytical purposes only. It
does not constitute financial advice, a recommendation, or a solicitation to
buy or sell any instrument. Trading involves substantial risk of loss; past
pattern behavior is not indicative of future results. Users are responsible
for their own trading decisions and for verifying that any signal aligns with
their own methodology and risk management.
The source code is published under the Mozilla Public License 2.0. Feedback
and constructive suggestions are welcome. Indicator

AG Pro Reversal Pattern Quality Scanner [AGPro Series]AG Pro Reversal Pattern Quality Scanner
Overview / What it does
AG Pro Reversal Pattern Quality Scanner is an overlay tool designed to detect and visualize selected classical reversal structures directly on the chart while adding a structured quality layer to each valid setup. The script focuses on four widely recognized reversal formations: Double Top, Double Bottom, Head & Shoulders, and Inverse Head & Shoulders.
Instead of marking every possible structural resemblance, the script applies a filtered detection workflow based on pivot structure, pattern width, peak or trough equality, pullback depth, neckline logic, and an internal quality model. The goal is not simply to identify a shape, but to highlight formations that display more balanced structure and more usable context.
Each detected pattern can be displayed with a pattern box, a projected neckline, and a quality label that summarizes the pattern type, directional bias, quality score, and grade. This makes the script suitable for traders who want a structured visual map of potential reversal zones rather than a raw pattern-highlighting tool with no ranking logic.
The indicator is built for chart reading and workflow support. It does not attempt to forecast future price movement with certainty, and it should not be interpreted as a standalone trade system. Its role is to help users organize reversal structures, compare them visually, and focus on higher-quality formations when reviewing price action.
Unique Edge
The main distinction of this script is that it does not treat all reversal patterns as equivalent. A detected pattern is further evaluated through a composite quality framework that considers structural symmetry, pullback depth, and volume behavior during formation and break conditions.
For Double Top and Double Bottom structures, the script checks whether the two peaks or troughs remain sufficiently close to each other within a defined tolerance and whether the intermediate pullback is large enough to make the structure meaningful. For Head & Shoulders and Inverse Head & Shoulders structures, the script evaluates shoulder symmetry, time symmetry, and relative positioning of the head against the shoulders.
The volume component is not used as a promise of confirmation. It is used as an additional contextual factor inside the quality score. In general terms, contracting volume during formation and stronger participation during the break candidate can improve the overall score when those conditions are present.
Another important part of the design is visual prioritization. The script does not only draw the structure. It also attempts to keep the chart readable by organizing labels, neckline extensions, and pattern boxes in a way that preserves interpretation. The result is a cleaner reversal-pattern map that aims to be more practical than a simple shape detector.
Methodology
The script begins with swing pivot detection. These pivots act as the structural foundation for all pattern candidates. Once enough pivot highs and lows are available, the script evaluates whether recent pivot sequences fit the requirements of one of the supported reversal structures.
For Double Top detection, the script checks whether two recent highs are similar enough, whether the interim low forms a valid neckline reference, whether the pattern width stays within defined limits, and whether price has broken below the neckline. For Double Bottom detection, the logic is mirrored on the bullish side through two similar lows, an interim high as the neckline reference, and a bullish break condition above that neckline.
For Head & Shoulders detection, the script evaluates a sequence of three pivot highs where the middle high must exceed the two shoulders. It then estimates neckline structure from the lows between those highs and applies symmetry and pullback checks before accepting the setup. Inverse Head & Shoulders applies the same structural concept in reverse using pivot lows.
After a valid break condition is detected, the script calculates a composite quality score. This score is based on user-controlled weights for volume behavior, symmetry, and pullback depth. The final output is normalized into a 1 to 10 quality scale, then translated into a grade label for easier scanning.
Signals & Alerts
The script can generate pattern-based alert conditions for:
- Double Top
- Double Bottom
- Head & Shoulders
- Inverse Head & Shoulders
These alerts are tied to the script’s internal structural conditions and neckline break logic. As with any chart-based alert workflow, users should confirm that the selected settings match their market, timeframe, and execution style.
Visual output can include:
- Pattern boxes
- Neckline lines
- Neckline labels
- Pattern quality labels
- Break candle highlighting
- Information panel with detection statistics
The quality label is intended to summarize the detected structure, not to guarantee outcome quality. A higher score means the pattern aligned more closely with the script’s internal criteria. It does not mean the setup must succeed.
Key Inputs
The script includes adjustable inputs for both detection behavior and presentation. Key controls include:
- Swing Pivot Length
- Peak / Trough Equality tolerance
- Minimum Pullback Between Peaks or Troughs
- Minimum and Maximum Pattern Width
- Minimum Quality to Display
- Weighting of volume, symmetry, and pullback depth inside the quality score
- Box, neckline, and pattern-label visibility
- Global label size
- Panel font size
- Panel position
- Neckline extension length
- Pattern-specific alert toggles
These controls make it possible to adapt the scanner to different chart densities, volatility profiles, and personal visual preferences.
Limitations & Transparency
This indicator is a rule-based pattern scanner. It is not a predictive engine, and it does not claim that all detected formations will lead to continuation or reversal. Classical chart structures can fail, invalidate, or behave differently depending on volatility, trend strength, liquidity conditions, timeframe, and broader market context.
Pattern recognition on live charts is inherently sensitive to pivot settings and bar structure. Small changes in pivot length, equality tolerance, or minimum pullback can materially change how many formations appear. Because of that, users should treat the script as a configurable analytical framework rather than a universal template.
The quality score is an internal ranking model built from the script’s own criteria. It is meant to help compare setups inside the same framework. It should not be interpreted as an objective probability model, a performance promise, or a substitute for independent trade management.
Volume analysis also depends on the reliability and characteristics of the symbol’s reported data. On some instruments, volume may be less informative or behave differently than expected. Users should evaluate this in the context of their own market.
Risk Disclosure
This script is provided for chart analysis, workflow organization, and educational use. It does not provide financial advice, investment advice, or guaranteed trade signals. All trading and investment decisions remain the sole responsibility of the user.
Reversal patterns can fail even when they appear clean and well-structured. Breaks can reverse, neckline moves can trap participants, and high-scoring formations can still underperform. Risk management, confirmation process, position sizing, and overall strategy design remain essential.
Use this tool as a structured visual aid inside a broader decision-making process, not as a standalone reason to enter or exit a position. Indicator

AG Pro Inside Bar Breakout Quality [AGPro Series]AG Pro Inside Bar Breakout Quality
Overview / What it does
AG Pro Inside Bar Breakout Quality is an overlay tool built to study one of the market’s most familiar compression structures: the inside bar. Instead of stopping at simple detection, the script evaluates what happens after the pattern forms and grades the breakout attempt with a structured quality model. The result is a workflow-oriented view of inside bar compression, breakout strength, and failed continuation behavior.
The script first identifies a strict inside bar condition, where the current bar remains fully contained within the previous bar’s range. That parent range becomes the active reference zone. From there, the script monitors whether price resolves above or below the structure, whether the move is confirmed by close, whether volume supports the breakout, and whether the breakout later fails and re-enters the range within a user-defined window.
This is not designed as a generic “any breakout” marker. Its purpose is narrower and more specific: it focuses on a compact volatility contraction event, then measures how decisively price leaves that compression. In practical chart work, this helps separate a low-commitment range poke from a more convincing expansion move.
The visual presentation is intentionally structured. Inside bar zones are boxed, breakout direction is marked, quality is scored, and fakeouts are labeled when the breakout reverses back into the monitored range. This makes the script suitable for traders who want a cleaner way to inspect inside bar behavior without manually drawing every structure.
Unique Edge
The main difference here is that the script does not treat every inside bar break as equally meaningful. Many tools stop at “pattern detected” or “level broken.” This script adds a second layer: breakout quality. That layer is derived from close position, volume context, candle body participation, and alignment with the parent candle’s directional bias.
A second differentiator is the built-in fakeout logic. After a breakout is detected, the script continues to watch price for a limited number of bars. If the move quickly returns back through the breakout boundary, the event is tagged as a fakeout. This adds post-event context instead of only marking the first directional move.
Another distinction is that the methodology is deterministic and chart-native. The logic is rule-based, visible, and reproducible from bar to bar. Users can decide whether to require close confirmation beyond the inside bar range, whether to require volume confirmation, and how strict they want the displayed threshold to be through the minimum score filter.
In short, this script is not only about finding compression. It is about ranking the quality of the expansion attempt that follows the compression, while also acknowledging that some breakouts fail quickly and should be read differently.
Methodology
1) Inside Bar Detection
An inside bar is identified when the current bar’s high is lower than the previous bar’s high and the current bar’s low is higher than the previous bar’s low. This creates a strict containment definition based on the previous candle’s full range.
2) Reference Zone
Once an inside bar is detected, the prior candle becomes the parent reference bar. Its high and low define the active breakout boundaries. That range can be visualized as a box, with an optional midpoint line to make the compression zone easier to read on chart.
3) Breakout Confirmation
A bullish breakout occurs when price moves above the parent high. A bearish breakout occurs when price moves below the parent low. Users can choose whether breakout confirmation should be based on close beyond the range or on a less restrictive intrabar break condition.
4) Quality Score
Each breakout can be scored on a 0–10 scale. The score is built from multiple components:
- close position relative to the inside bar boundary
- volume ratio versus the selected moving average
- body participation within the breakout candle’s total range
- directional alignment between the breakout and the parent candle bias
This scoring model is designed to estimate how committed the breakout candle appears, rather than assuming all breaks have equal informational value.
5) Fakeout Detection
If enabled, the script monitors a user-defined number of bars after breakout. A bullish breakout that returns back below the upper boundary within that window is labeled as a bull trap / fakeout. A bearish breakout that returns back above the lower boundary within that window is labeled as a bear trap / fakeout.
6) Visual Layer
The script can display the inside bar zone, midpoint, breakout arrows, score labels, and fakeout markers. A summary panel tracks aggregate statistics such as total inside bars, total breakouts, breakout direction counts, fakeouts, and the latest breakout score.
Signals & Alerts
The script can provide alert conditions for:
- bullish inside bar breakout
- bearish inside bar breakout
- fakeout detection
- high-quality breakout events
- any breakout event
These alerts are intended to help users monitor the pattern and its resolution more efficiently. They do not replace trade planning, confirmation from broader market context, or independent risk management.
Key Inputs
Min Score to Show Breakout
Filters displayed breakout labels by quality threshold. This can be useful for reducing low-quality visual noise.
Volume Confirmation Required
When enabled, breakout evaluation requires volume to be above its moving average threshold. This can help remove low-participation breaks.
Volume MA Period
Defines the lookback length for average volume comparison.
Require Close Beyond IB
When enabled, breakout confirmation depends on bar close beyond the parent range. This creates a more conservative and more stable breakout definition.
Max IBs to Display
Controls how many recent structures and related objects remain visible on chart.
Show IB Box / Midline / Breakout Arrow / Score Label
Lets users decide how much visual detail they want to keep on screen.
Glow Effect on High Score
Adds emphasis to stronger breakout events without changing the underlying logic.
Fakeout Window
Defines how many bars after breakout the script should continue monitoring for a return back through the breakout boundary.
Limitations & Transparency
This script studies inside bar compression and subsequent breakout behavior. It does not claim to identify all meaningful consolidations, and it does not attempt to classify every market regime. The methodology is intentionally focused on one structure.
The score is a rule-based quality model, not an objective measure of future outcome. A high score does not guarantee continuation, and a lower score does not guarantee failure. It simply reflects how the breakout candle and its context behave according to the script’s internal criteria.
Volume-based interpretation may vary across symbols and markets. On some instruments, especially those with inconsistent or synthetic volume data, volume confirmation may be less informative than on others. Users should evaluate whether volume filtering is appropriate for the asset they are studying.
Fakeout detection is also definition-dependent. The script labels a fakeout when price returns through the breakout boundary within the selected lookback window. Different traders may prefer a different timing window or a different failure definition.
As with any overlay, chart readability depends on market volatility, timeframe, and user settings. On lower timeframes or during highly active periods, more visual events may appear. The built-in filters and display controls are there to help manage that density.
Risk Disclosure
This script is an analytical tool for chart study. It is not financial advice, not a trade recommendation, and not a promise of future results.
Inside bar breakouts can behave differently across timeframes, instruments, and market regimes. Users should not rely on a single pattern, score, or alert in isolation. Context still matters, including trend condition, liquidity environment, nearby structure, volatility regime, and execution discipline.
Before using this script in any live decision process, it should be reviewed in the specific market and timeframe relevant to the user’s own approach. Testing, observation, and risk controls remain essential.
Indicator

AG Pro Pin Bar Quality Filter [AGPro Series]AG Pro Pin Bar Quality Filter
Overview / What it does
AG Pro Pin Bar Quality Filter is a price-action overlay built to detect pin bar candles and then separate higher-quality rejection candles from weaker or noisier ones.
The script does not treat every long-wick candle as equally meaningful. Instead, it evaluates the internal candle structure first, then applies a compact quality framework around volume, recent momentum, and local support/resistance context. The result is a filtered pin bar workflow designed for traders who want cleaner chart annotation rather than a raw pattern dump.
This tool focuses on one specific job: identifying rejection candles with a measurable structure and presenting them with a readable quality label directly on the chart. It is intended to help users inspect potential reaction points, not to replace broader market context or execution rules.
The visual design is intentionally simple at the core: pin bar body highlighting, wick emphasis, directional markers, and compact quality labels. This makes the script suitable for traders who want candle-based context without converting the chart into a full market-structure dashboard.
Unique Edge
The distinctive feature of this script is that it does not stop at pattern detection.
A standard pin bar script often marks candles only because they have a long wick. This script goes further by checking whether the wick is large enough relative to the body, whether the body itself is small enough relative to the full candle range, and whether one wick clearly dominates the other. That combination helps reduce ambiguous candles that visually resemble pin bars but do not express clean rejection.
After the structural test, the script applies a three-part quality model:
- volume confirmation
- momentum context
- support/resistance proximity
This creates a practical quality hierarchy rather than a binary pattern label. In other words, the script is not only asking “Is this a pin bar?” but also “How much contextual support does this pin bar have?”
An optional piercing check is also available for users who want stricter validation. This adds another layer of selectivity by requiring the candle body to show stronger positional behavior relative to the prior bar.
Methodology
The script starts by measuring the current candle:
- candle body size
- full candle range
- upper wick length
- lower wick length
- dominant wick versus body ratio
A raw pin bar candidate requires:
- a minimum wick/body ratio
- a maximum body percentage of full range
- directional wick dominance
This helps define whether the candle is a legitimate bullish or bearish rejection structure.
Bullish pin logic is based on lower-wick dominance.
Bearish pin logic is based on upper-wick dominance.
Once a raw pin bar is detected, the script evaluates three contextual filters.
1) Volume filter
The current volume can be compared against a moving average of volume. This helps identify candles that form with relatively stronger participation.
2) Momentum confirmation
The script can check whether recent candles were moving in the opposite direction of the current pin bar. For example, a bullish pin bar becomes more meaningful when it forms after short-term downward pressure, while a bearish pin bar becomes more meaningful after short-term upward pressure.
3) Support / resistance proximity
The script tracks pivot-based reference levels and checks whether the pin bar forms close to a recent local support or resistance area, using an ATR-based distance threshold.
Each passed filter contributes to the final quality score. This produces a compact tiered output instead of a single undifferentiated signal stream.
Signals & Alerts
The script can identify:
- bullish pin bars
- bearish pin bars
- higher-quality pin bars based on the selected minimum score
Visual elements may include:
- body highlighting on detected pin bars
- wick emphasis
- directional arrow markers
- quality labels with contextual details
- an information panel summarizing the active state
The quality label can display the signal tier and relevant confirmations such as:
- wick/body ratio
- volume confirmation
- momentum confirmation
- support/resistance proximity
Alert conditions are available for:
- bullish pin bars
- bearish pin bars
- prime-quality pin bars
- any valid pin bar that meets the selected score threshold
This allows users to align alerts with their own strictness settings rather than monitoring every possible candle manually.
Key Inputs
Important user controls include:
- minimum wick/body ratio
- maximum body percentage of full range
- wick dominance threshold
- optional piercing requirement
- volume filter enable/disable
- momentum filter enable/disable
- support/resistance filter enable/disable
- minimum quality score
- label size
- panel display
- maximum number of displayed signals
These settings make the script adaptable across different instruments and chart styles. Users who prefer a broader scan can lower the strictness, while users who want fewer but cleaner signals can raise the thresholds.
Limitations & Transparency
This script is a rule-based candle-quality filter. It is not a market prediction engine, and it does not attempt to classify broader trend structure, liquidity behavior, or macro regime by itself.
A pin bar can still fail even when all filters pass. A visually strong rejection candle is not automatically a durable reversal. Context such as higher-timeframe structure, trend state, volatility regime, session behavior, and instrument-specific character still matters.
Support and resistance detection in this script is pivot-based and proximity-based. It is designed as a practical contextual filter, not as a complete structural mapping model.
Volume behavior also varies by asset and market type. On some instruments, especially where centralized volume data is limited or interpreted differently, the volume filter should be treated as a supplementary input rather than a universal truth test.
The momentum check is intentionally compact and local. It is meant to improve candle context, not to replace broader directional analysis.
For these reasons, the script is best used as a chart-reading assistant within a larger process, not as a standalone decision framework.
Risk Disclosure
This script is provided for technical analysis and chart annotation purposes only.
It highlights selected pin bar conditions based on user-defined structural and contextual rules. It does not provide financial advice, investment advice, or guaranteed trade outcomes. Markets can remain irrational, trend continuation can invalidate rejection candles, and false positives can occur in all timeframes and asset classes.
Users should validate the script on their own instruments, timeframes, and risk models before relying on it in live conditions. Position sizing, stop placement, execution discipline, and overall trade management remain the responsibility of the user.
In summary, AG Pro Pin Bar Quality Filter is designed to help traders study rejection candles with more structure, more selectivity, and cleaner on-chart presentation than a basic pin bar marker, while remaining transparent about what the script does and does not do.
Indicator
