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. Indicateur

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. Indicateur

AG Pro CCI Reversion Quality [AGPro Series]AG Pro CCI Reversion Quality
Overview
AG Pro CCI Reversion Quality is a chart-based analysis framework designed to evaluate the quality of potential mean reversion conditions after meaningful CCI displacement. The script is not built around the simplistic idea that every overextended reading should immediately reverse. Instead, it focuses on whether a stretch condition begins to mature into a more structured, readable, and context-aware reversion environment.
The core objective is to separate raw CCI extremes from higher-quality reversion candidates. In many conventional oscillator workflows, a high positive or negative CCI reading is treated as a direct trigger. This script does not follow that approach. A strong stretch may still reflect healthy continuation, trend persistence, or unstable counter-trend conditions. For that reason, the script evaluates the quality of the reversion setup rather than the existence of a threshold breach alone.
The indicator is built for users who want a more selective framework around mean reversion. It examines whether price has deviated enough from an EMA-based reference mean, whether the reversion path remains meaningful, whether trend pressure is working against the setup, and whether recent structure suggests a cleaner or more crowded return path. The output is a contextual quality view rather than a one-dimensional overbought or oversold label.
This means the script should be understood as a decision-support tool for chart study and workflow organization. It is intended to help users distinguish between conditions that are immature, weak, blocked, developing, or stronger within a mean reversion context. It does not guarantee that price will reverse, and it does not assume that every stretch condition deserves a fade.
What the script does
The script monitors CCI displacement and then evaluates whether that displacement is beginning to convert into a more credible reversion environment. In practical terms, the workflow asks a sequence of questions. First, is there a meaningful stretch? Second, is the move beginning to lose directional quality or show reversion readiness? Third, is there enough room back toward the mean to matter? Fourth, is dominant trend pressure still strong enough to reduce the attractiveness of fading the move? Fifth, is nearby structure relatively clean, or is the path crowded by congestion and repeated mean interaction?
By combining those layers, the script attempts to reduce the noise associated with raw oscillator threshold logic. A positive stretch does not automatically imply a short setup. A negative stretch does not automatically imply a long setup. The script instead checks whether the overall reversion context is becoming more coherent.
This framework can be useful in discretionary workflows where users want to prioritize cleaner mean reversion candidates over mechanically reacting to every extreme oscillator reading. It is also useful for users who prefer a visual structure that summarizes context rather than one that continuously emits aggressive directional prompts.
Unique edge
The unique edge of this script is that it treats CCI as the starting point of the analysis, not the end point. Many oscillator-based studies stop at the detection of an extreme value. AG Pro CCI Reversion Quality continues beyond that stage and asks whether the extreme is maturing into a higher-quality reversion environment.
This makes the tool different from a basic CCI threshold script, a classic overbought/oversold marker, or a simple cross-based reversal detector. The script is not designed to label every extreme. It is designed to grade the environment around the extreme.
The indicator also keeps a clear distinction between stretch direction and stretch intensity. A market may be in a positive stretch or a negative stretch, but the degree of that stretch can still vary between mild, extended, and extreme conditions. In parallel, the script separately estimates reversion quality, trend pressure against the reversion idea, distance back to the reference mean, and structural friction. This multi-layered structure is meant to help users avoid treating all extreme readings as equivalent.
Another important difference is that the script explicitly accounts for context that can weaken a counter-trend reversion idea. Strong directional pressure, repeated interactions with the mean, and crowded local structure can all reduce the clarity of a fade. Instead of ignoring those conditions, the model reflects them in the displayed quality state.
Methodology
The script begins with a CCI calculation and identifies whether price is in a neutral regime, a positive stretch regime, or a negative stretch regime. It then classifies stretch intensity according to threshold-based displacement logic. The purpose of this stage is to define whether the market is extended enough for reversion analysis to become relevant.
From there, the indicator evaluates reversion readiness. This layer looks for signs that the stretch may be beginning to lose directional quality. Rather than relying on one isolated condition, the readiness component blends several pieces of information, such as directional change in CCI behavior, body structure, wick behavior, and simple stalling characteristics. This is meant to produce a broader view of whether reversion conditions are starting to organize.
The model then evaluates distance to mean. This matters because a reversion concept is less meaningful if price is already too close to the reference mean, while a more meaningful opportunity may exist when displacement remains materially extended. The reference anchor used here is an EMA-based mean, and the script also visualizes an ATR-based reversion zone around that mean.
Trend pressure is treated as a separate contextual penalty. This is a key design choice. A mean reversion idea that opposes strong directional pressure may be materially weaker than a similar stretch in a less forceful trend environment. The script therefore estimates how much prevailing directional pressure works against the reversion idea and reduces the effective quality view accordingly.
Structure friction is also included. This component is intended to reflect whether the recent path is relatively clean or crowded. Repeated interaction with the mean, compression, and congestion can reduce the clarity of a reversion path. Instead of assuming that all distance from the mean is equally attractive, the script attempts to reflect when the path back toward the mean is noisy or structurally inefficient.
All of these elements are combined into a composite Reversion Quality view. The final output is then expressed through panel information, chart labels, the zone display, and state logic.
State model
The state model is intentionally selective. It is meant to help users read context, not flood the chart with constant directional calls.
NEUTRAL indicates that there is no active stretch regime currently qualifying for reversion analysis.
WATCH indicates that a stretch exists and some reversion characteristics are forming, but the overall quality remains in an earlier or less mature stage.
READY indicates that the reversion quality has advanced enough to meet the preferred threshold defined by the user inputs. This does not imply certainty or guaranteed reversal. It simply means that the model sees a stronger monitored reversion context than it did at lower-quality states.
WEAK indicates that a stretch may exist, but the quality remains below the preferred threshold. This state is intentionally treated with caution.
BLOCKED indicates that the environment is materially impaired by elevated opposing pressure or structural friction. In other words, the stretch may exist, but the model does not consider the reversion context clean enough.
These states are designed to provide a workflow hierarchy rather than a promise hierarchy. The purpose is to help users prioritize and interpret, not to replace judgment.
Visual structure
The reference mean is displayed as an EMA-based mean line. Around it, the script plots an ATR-based reversion zone. This zone is intended to help users see the region surrounding the mean that is being used as the reversion anchor. The zone becomes more visually expressive when an active stretch context is present and more neutral when no active stretch is in focus.
The on-chart labels are designed to show the dominant local state when relevant. Depending on user settings, the script can display WATCH, READY, BLOCKED, and optionally WEAK labels. The label system is filtered by spacing logic so the chart remains more readable and does not endlessly repeat the same message on adjacent bars.
The information panel summarizes the active context. It is designed to show state, current reversion side, stretch direction, stretch intensity, reversion quality, trend pressure versus reversion, distance to mean, structure friction, setup bias, and a short risk note. The panel can also be repositioned from the settings, allowing the user to adapt placement to chart layout and personal preference.
The chart guide labels are included to make the mean and zone easier to identify visually. Their role is descriptive, not predictive.
Signals and alerts
The alert structure is built around monitored reversion states rather than trading promises. The available alert conditions include Ready Long Reversion, Ready Short Reversion, Watch Long Reversion, Watch Short Reversion, Reversion Quality Upgrade, and Reversion Quality Breakdown.
These alerts are designed to notify the user that the modeled reversion environment is changing. They should not be interpreted as guaranteed turning points. The script does not know future price behavior and does not claim to identify all reversals. It only identifies conditions that fit its internal reversion-quality logic.
Because different assets, sessions, and volatility structures behave differently, users should always validate whether the alert behavior matches their own chart-reading process and timeframe preference.
Key inputs
The script includes inputs for CCI length, reference mean length, multiple stretch thresholds, READY and WATCH thresholds, trend pressure filter strength, structure friction lookback, reversion zone width, label spacing, background highlight transparency, and visual display controls.
These inputs are intended to let users adapt the framework to different instruments and chart conditions. The script is not presented as universally optimal out of the box for all markets or all styles. Some users may prefer a more selective threshold structure, while others may prefer earlier WATCH states. Similarly, different assets may respond differently to the same mean length or zone width.
The visual controls are included to help users keep the chart readable. Users can enable or disable signal labels, WATCH labels, WEAK labels, background highlights, guide labels, and the information panel. Label size and panel text size are also configurable.
How to interpret the tool
A useful way to interpret the script is to think of it as a contextual filter around reversion conditions. A high stretch value alone is not enough. The quality concept becomes more meaningful when stretch, readiness, distance to mean, and contextual penalties begin to align.
If the script is neutral, it is signaling that no active stretch regime is currently in focus. If it is in WATCH, the script sees an emerging reversion environment, but one that may still be early or incomplete. If it reaches READY, the model is identifying a stronger monitored reversion context according to its current thresholds. If the state is BLOCKED, the model is emphasizing that pressure or structure is reducing the attractiveness of the reversion idea.
The panel is especially helpful for separating why a setup is weak. In some cases, quality may be limited because distance to mean is too thin. In other cases, trend pressure may still be high. In others, structure friction may be elevated even if displacement exists. This decomposition is intentional because it gives the user a more transparent framework than a single opaque signal.
What this script is not
This script is not a simple CCI threshold indicator. It is not designed to mark every move above or below a fixed level as a reversal opportunity.
It is not a guaranteed turning-point detector. Markets can remain extended for longer than expected, and strong trends can continue even after oscillator readings become extreme.
It is not a standalone execution system. The script does not account for all trade management variables, liquidity considerations, news catalysts, slippage, or user-specific risk parameters.
It is not a substitute for independent chart reading. It is intended to support analysis, not replace it.
Limitations and transparency
Like any chart-based model, this script has limitations. CCI extremes can persist, and a stretch can remain extended longer than a reversion-focused framework may prefer. In strong continuation phases, what appears to be a mature stretch can still fail to revert meaningfully.
The reversion-quality approach is also sensitive to the interaction between volatility, price structure, and trend behavior. Different markets can produce different behavior profiles. A configuration that feels balanced on one asset or timeframe may feel too early or too conservative on another.
The structure friction layer is an estimate, not an objective statement of future path quality. The trend pressure component is likewise a contextual model, not a certainty model. The script uses observable chart information to organize conditions, but it does not predict future order flow.
Users should also understand that visualization choices are meant to improve readability, not imply certainty. The mean line, reversion zone, state labels, and background highlights are interpretive aids.
Risk disclosure
This script is provided for chart analysis, research, and workflow support. It does not provide financial, investment, legal, or tax advice. Nothing displayed by the script should be interpreted as a promise of outcome or a guarantee of reversal.
All markets involve risk. Mean reversion concepts can fail, continuation can persist, and volatility conditions can change rapidly. Users should apply independent judgment, appropriate risk controls, and broader market context before acting on any chart-based interpretation.
The script should be used as one analytical layer among many, not as a self-sufficient decision engine.
Summary
AG Pro CCI Reversion Quality is a selective mean reversion quality framework built around CCI displacement, EMA-based mean reference logic, distance-to-mean context, trend pressure, and structure friction. Its purpose is not to say that every extreme should fade. Its purpose is to help identify when an extreme begins to organize into a more structured reversion environment.
The model is intended for users who want a cleaner, more context-aware interpretation of stretch conditions than a traditional threshold-only oscillator can provide. By separating stretch direction, stretch intensity, reversion quality, and contextual penalties, the script aims to make mean reversion analysis more structured, more transparent, and more selective.
Indicateur
