Impulse Structure Zones [JOAT]Impulse Structure Zones
Introduction
Impulse Structure Zones (ISZ) is an open-source, institutional-grade zone engine that detects statistically significant price impulses using a Z-Score methodology, identifies the origin candle of each impulse as an order block, and grades each zone using a multi-factor wick rejection scoring system. Bullish and bearish zones are tracked in parallel arrays with full lifecycle management — creation, extension, mitigation detection, and rejection confirmation — all rendered as clean, non-repainting boxes on the chart with a mid-line bisecting each zone.
The core problem ISZ solves is the manual process of locating high-probability order block zones on a chart. Institutional price delivery frequently originates from specific candles where large orders were placed — the last opposing candle before a strong directional move. ISZ automates the detection of those moves, marks the origin candles, and then monitors each zone to fire a graded rejection signal when price returns to test the level. Grades A, B, and C communicate signal quality based on wick dominance, proportional wick depth, volume confirmation, and candle size relative to ATR.
Core Concepts
1. Z-Score Impulse Detection
Price change is measured bar-by-bar as a percentage move and normalized into a Z-Score against a rolling mean and standard deviation window:
float pxChg = (close - close ) / close * 100.0
float zscore = (pxChg - avgChg) / math.max(stdChg, 0.0001)
A bar qualifies as an impulse when the absolute Z-Score exceeds the user-defined threshold (default: 1.5). This isolates moves that are statistically unusual relative to recent activity — the same principle used in quantitative strategies to filter meaningful displacement from noise. All signals are gated on barstate.isconfirmed to prevent repainting.
2. Order Block Identification
When a bullish impulse is confirmed, ISZ scans back through recent bars to locate the last bearish candle (close < open) before the move. That candle's high and low become the order block zone boundaries. For bearish impulses, the last bullish candle is used. This matches the ICT definition of an order block — the final imbalance candle before institutional displacement.
3. Zone Lifecycle Management
Each zone is stored as a user-defined type (UDT) containing the box object, mid-line, price boundaries, birth bar, direction, mitigation flag, and rejection flag. Zones extend rightward on each bar until price closes beyond the zone (mitigation), at which point the box is frozen and marked as mitigated. A maximum zone count is enforced and oldest zones are trimmed to maintain chart performance.
4. A/B/C Rejection Grading
When price returns to test a live zone and a rejection candle forms, ISZ grades the signal quality using four independent scoring factors:
Wick dominance ratio: The rejection wick length divided by candle body size
Proportional wick depth: The wick as a percentage of the total candle range
Volume confirmation: Current bar volume compared to the 20-bar average
Candle size vs ATR: Whether the rejection candle is of meaningful size relative to recent volatility
A total score of 6+ = Grade A, 4-5 = Grade B, below 4 = Grade C. Grade is displayed as a label on the rejection bar.
Features
Z-Score Impulse Engine: Statistically filters price moves against a rolling mean/standard deviation window — configurable length and threshold
Automatic Order Block Detection: Last opposing candle before each confirmed impulse identified and stored as a zone
Bidirectional Zone Tracking: Bullish (demand) and bearish (supply) zones managed in separate arrays with independent colors
A/B/C Rejection Grading: Four-factor scoring system labels each zone test with a quality grade
Zone Mitigation Detection: Zones that are fully closed through are frozen and visually distinguished from active zones
Mid-Line Reference: Each zone box includes a dashed mid-line at the 50% level — institutional equilibrium reference
ATR Proximity Filter: Rejection signals only fire when price is within a configurable ATR multiple of the zone
Volume Confirmation: Optional volume filter requires above-average volume at rejection for grading
Non-Repainting: All signals gated on barstate.isconfirmed — no look-ahead bias
Zone History Limit: Oldest zones automatically removed when the maximum count is reached to maintain performance
Dashboard (Top Right): Active bull/bear zone counts, last signal grade, last impulse Z-Score, and ATR — updated on each bar
Live Z-Score Candle Gradient Coloring: Impulse candles colored teal or rose based on Z-Score strength — immediately identifies statistically significant displacement bars on the chart
ATR Band Plots Around EMA 750: Visual upper and lower extremity zones drawn as ATR-based bands around the 750-period EMA — communicates when price is at macro stretch relative to the long-term anchor
RR Trade Boxes on Rejection Signals: Auto-generated SL/TP boxes on every rejection signal — 1.5× ATR stop loss with 3:1 reward-to-risk ratio, extending forward from the signal bar
Session Win Rate Tracking: Asia, London, and NY win rates tracked independently for rejection trades — outcome recorded against each signal's ATR-based TP/SL levels
Best Session Highlight: Dashboard automatically identifies and highlights the highest win-rate session across all three windows
Expanded Dashboard (9 Rows): Dashboard expanded to 9 rows — now includes live Z-Score reading, total impulse count, and full session win rate breakdown alongside existing zone and signal data
Input Parameters
Z-Score Settings:
Z-Score Length: Rolling window for mean and standard deviation calculation (default: 20)
Z-Score Threshold: Minimum absolute Z-Score required to qualify as an impulse (default: 1.5)
Zone Settings:
Max Active Zones: Maximum number of zones tracked simultaneously per direction (default: 8)
Bull Zone Color / Bear Zone Color: Independent colors per direction
Rejection Settings:
ATR Proximity (multiplier): How close price must be to a zone to trigger rejection check (default: 0.5)
ATR Length: Period for ATR calculation (default: 14)
Require Volume Confirmation: Toggle — above-average volume required for Grade A
How to Use This Indicator
Step 1: Identify Active Zones
Active bullish zones (demand) appear below price in teal. Active bearish zones (supply) appear above price in rose. Mitigated zones are visually dimmed. Focus on zones that have not yet been tested — these are the most relevant levels for future price interaction.
Step 2: Wait for Price to Return to the Zone
ISZ does not generate entry signals on impulse creation. It monitors active zones for return tests. When price pulls back into a zone, watch for the rejection grading label to appear.
Step 3: Grade the Signal
An A-grade rejection at a fresh, unmitigated zone is the highest-quality setup. B-grade is acceptable with additional confluence. C-grade rejections at already-tested zones carry the least weight. Use the grade in combination with your own bias and higher-timeframe analysis.
Step 4: Monitor the Dashboard
The dashboard shows active zone counts, last Z-Score, last grade, and ATR. A high Z-Score at impulse creation indicates an unusually strong move — those zones tend to attract more significant future tests.
Indicator Limitations
Z-Score impulse detection requires sufficient historical bars (at least 2× the Z-Score length) to produce accurate statistics — on very short chart histories the first few zones may form under unstable conditions
Order block detection scans back a fixed number of bars (configurable). In fast-moving markets where multiple candles are the same color, the scan may place the zone further back than an analyst would manually
Rejection grading uses volume data. On instruments with synthetic or unreliable volume (e.g., some CFDs, synthetic indices), the volume scoring component will not reflect true market activity
Zones do not account for gap fills, overnight moves, or after-hours sessions — a zone that appears unmitigated on the chart may have been effectively traded through outside of regular hours depending on the instrument
The A/B/C grading is a quantitative scoring system, not a certainty measure. Grade A signals do not guarantee price continuation in the expected direction
Originality Statement
ISZ combines Z-Score statistical impulse detection with origin-candle order block identification and a multi-factor rejection grading system in a single, self-contained indicator. This combination is original for the following reasons:
The use of a Z-Score normalized against a rolling mean and standard deviation — rather than a fixed pip or percentage threshold — makes impulse detection adaptive to current market volatility. The same threshold parameter behaves consistently across instruments and timeframes without requiring manual recalibration
The A/B/C grading system applies four independent quantitative factors (wick dominance, wick proportion, volume, candle size) simultaneously to classify signal quality at the point of zone interaction — rather than simply marking every return to a zone as equal
Zone lifecycle management (create → extend → mitigate → reject → trim) is handled automatically through UDT arrays with in-place field mutation, eliminating the need for manual zone maintenance or re-drawing
The combination of impulse detection, zone creation, and rejection grading in a single engine — with a unified dashboard — removes the need to layer multiple indicators to accomplish the same workflow
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Order block zones are historical reference levels and do not guarantee that price will react at those levels. A/B/C grades reflect quantitative scoring and do not predict future price movement. Always apply proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Chỉ báo Pine Script®






















