Mitigation Block Quality [AGPro Series]OVERVIEW
Mitigation Block Quality grades every order-block retest as A, B, or C based on
the strength, speed, and follow-through of the bounce after price returns to
the block. Instead of just drawing order blocks and leaving you to guess
which ones matter, the script measures each mitigation objectively and keeps
a live scoreboard of how those reactions have been performing.
The result is an order block tool that tells you two things at once: where
the zones are, and how well price has historically respected them on the
symbol and timeframe you are looking at.
UNIQUE EDGE
Most order-block indicators end at detection. This one begins there. Each
time a block is mitigated, the script measures the reaction over a fixed
window and grades the bounce by its ATR-normalized magnitude. That grade
is then reflected everywhere: on the block border, in the on-chart label,
in the dashboard, and in the historical success-rate statistics.
You also get multi-timeframe context, confluence detection, streak tracking,
and a dynamic setup banner that describes the current price-block
relationship in plain English.
METHODOLOGY
1. Detection. Swing pivots are identified using a configurable pivot length.
The last opposite-colored candle before the pivot forms the order block.
2. Mitigation. A block is mitigated when price re-enters the zone.
3. Grading. After a fixed reaction window, the script measures the peak of
the bounce and normalizes it to ATR. Grade A is a strong bounce, B is
solid, C is weak.
4. Invalidation. A body close beyond the block marks it as invalidated.
Invalidated blocks can be hidden or shown as a dotted reference.
5. Retirement. Blocks retire by age, by distance from price, or when the
per-side cap is exceeded.
FEATURES
- A, B, or C grade assigned to every mitigation (ATR-normalized reaction)
- Reaction trail line on Grade A mitigations showing the bounce extent
- Entry marker (diamond) at the exact mitigation bar of Grade A bounces
- Confluence glow when two or more blocks overlap within 0.5 ATR
- Time-based opacity decay so older blocks recede and fresh ones pop
- Optional pulse animation on A/B blocks while price is inside them
- Price-scale labels tagging each active block's grade and side
- Higher-timeframe alignment check against a configurable HTF structural bias
- Dashboard panel with: active count, tested count, success (current),
nearest-block state (Inside / Touching / distance in ATR), all-time
success rate with stacked distribution bar, last-20 success, health
progress bar, current Win/Loss streak, HTF alignment, and a dynamic
setup banner
SIGNALS & ALERTS
Three alert conditions are provided:
- Grade A Mitigation — a premium-quality bounce has been detected
- Grade B Mitigation — a solid bounce has been detected
- Block Invalidation — an active block has been broken
These are alertconditions and can be configured from the TradingView
Create Alert dialog in the usual way.
KEY INPUTS
- Pivot Length and Lookback: control how blocks are detected and how long
they stay on the chart
- Reaction Window and Grade Thresholds (A, B in ATR units): define what
counts as a premium, solid, or weak bounce
- Invalidation Mode: choose between body close or wick pierce
- Retire Block Beyond (xATR): automatic cleanup when price moves far away
- Max Active Blocks per Side and Max Visible Labels: keep the chart premium
- Premium Visuals toggles: Reaction Trail, Entry Marker, Confluence Glow,
Quality Heatmap row, Setup Banner, Pulse, Time Decay, Price Scale Labels,
HTF Alignment, Streak row
- HTF for Alignment: the higher timeframe used for multi-timeframe confluence
- Panel location and theme
HOW TO USE
1. Add the script to any chart and timeframe.
2. Read the panel top-down:
- Last 20 breakdown tells you the recent quality regime
- Nearest Block tells you how close the closest active zone is
- All-time and Last 20 success tell you how reliable those zones have been
- Streak gives you momentum context
- HTF Alignment tells you if the bigger picture agrees
- Setup banner describes what is happening right now
3. Look at the chart:
- A/B/C labels on mitigated blocks tell you how those tests resolved
- Reaction trails and diamonds highlight the premium Grade A mitigations
- Confluence glows mark zones where multiple blocks agree
4. Use alerts to get notified when a fresh Grade A or Grade B mitigation
occurs, or when an active block is invalidated.
The tool is designed to help with discretionary analysis. It is not a
trading system and does not generate buy or sell signals on its own.
LIMITATIONS & TRANSPARENCY
- Pivots are confirmed after the swing length completes, so block detection
has a small structural lag. This is inherent to any pivot-based method.
- Grades are assigned after the reaction window closes. A very fresh
mitigation will briefly show "Active" before its grade appears.
- HTF Alignment uses a 50-period simple moving average on the chosen higher
timeframe as a structural bias proxy. It is a context filter, not a
predictive signal.
- All metrics are computed from the visible historical data on the current
chart. Loading more bars will change the all-time statistics.
- The script uses Pine Script v6 drawing objects. Extremely long histories
on very low timeframes may hit TradingView object limits; the built-in
per-side cap and distance-based retire keep this under control in normal
use.
RISK DISCLOSURE
This script is an analysis aid, not financial advice. It does not predict
future price movement and does not generate trade recommendations. Any
decision to enter or exit a position is the responsibility of the user.
Historical grade distributions are descriptive, not predictive. Past
mitigation behavior on a symbol does not guarantee future behavior.
Trade with risk capital you can afford to lose and use appropriate
position sizing and stop placement.
LICENSE
Released under the Mozilla Public License 2.0. The full source is available
on TradingView via the Open-Source badge. You are free to study and modify
the code subject to the terms of the license.
Penunjuk Pine Script®






















