OPEN-SOURCE SCRIPT
Aperture Imbalance Register [JOAT]

Aperture Imbalance Register [JOAT]
Introduction
Aperture Imbalance Register is an open-source Pine Script v6 indicator built to detect, rank, and manage directional imbalance zones in a more structured way than a basic fair value gap overlay. Instead of marking every raw three-candle gap and leaving the trader to judge which ones matter, the script builds a register of active bullish and bearish imbalance zones, measures their internal lower-timeframe participation, assigns a quality score, tracks mitigation progress, and keeps the resulting stack visible with a compact institutional-style dashboard.
The problem this indicator solves is selectivity. Many imbalance tools show too many zones, retire them too slowly, or provide no context for which inefficiencies are likely to matter. Aperture Imbalance Register focuses on the active imbalance stack and grades each register by combining gap displacement with lower-timeframe volume participation. That lets the trader see not only where imbalance exists, but how concentrated the internal participation was when the zone formed.
The script is designed for traders who use imbalance as part of a broader market-structure process. It is not trying to predict every reversal. It is designed to answer practical chart questions: where are the open directional inefficiencies, how strong are they, how much of each zone has been mitigated, and whether the current stack favors bullish or bearish continuation pressure.
Because the script uses Pine Script v6 lower-timeframe arrays, the register is not just a visual box painter. It uses lower-timeframe intrabar data to build participation histograms inside each zone, identify the local point of control of the imbalance, and display whether a register still has open space or has already been substantially repaired by later price action.

Core Concepts
1. Confirmed Bullish and Bearish Gap Detection
The script detects a bullish register when the current low is above the high from two bars ago and the middle bar confirms continuation. It detects a bearish register with the inverse condition. A sigma-style filter based on the statistical size of the gap helps reject weaker dislocations:
Pine Script®
This means the indicator is not plotting every minor price skip. It requires both structural displacement and a size filter before a new register is added to the active stack.
2. Lower-Timeframe Participation Ranking
Once a gap is confirmed, the script requests lower-timeframe `close` and `volume` data using `request.security_lower_tf()` and maps intrabar participation into configurable bins across the zone. That participation profile is then used to score the register.
This matters because not all imbalances are equal. Some form with broad participation spread across the full zone. Others form with concentrated acceptance in one portion of the gap. The participation histogram helps identify where the market transacted most heavily inside the register and where the imbalance may be most meaningful on a retest.
3. Quality Scoring and Register Prioritization
Each register receives a quality score derived from the concentration of lower-timeframe participation plus the size of the gap sigma event. Higher-quality zones get more visual emphasis, stronger edges, and greater dashboard influence.
In practice, this creates a hierarchy. The trader does not need to treat every imbalance equally. The register list naturally emphasizes the zones with stronger displacement and denser participation.
4. Mitigation Tracking and Lifecycle Management
Open imbalance is not enough. What matters is whether the zone remains unfilled. The script measures mitigation depth as price trades back into the register and updates the display from open to partial mitigation to fully filled. When the `Retire Fully Mitigated Zones` option is enabled, fully repaired or invalidated zones are removed from the active stack.
This keeps the chart cleaner and prevents stale boxes from dominating the view after the market has already rebalanced the inefficiency.
5. Participation Histogram and Local POC
Each register can display a small internal histogram showing participation intensity by price segment. The maximum participation bin defines the register’s local point of control, and that level is drawn as a line through the zone.
This gives the register more structure than a plain box. Instead of just seeing the outer bounds, the trader can see where activity concentrated inside the imbalance.

Features
Visual Elements
Best Practices
Input Parameters
Intrabar Data:
Imbalance Detection:
Lifecycle And Display:
How to Use This Indicator
Step 1: Read the Stack Bias
Start with the dashboard. Compare the bullish and bearish active register counts and note the stack bias value. A positive bias means bullish imbalance is dominating the active structure. A negative bias means bearish imbalance is dominating.
Step 2: Focus on Quality, Not Quantity
Use the average and strongest quality readings to judge whether the active stack is meaningful. A chart with fewer but stronger registers is often more actionable than a chart with many weak inefficiencies.
Step 3: Watch Mitigation Progress
Each active register updates from open to partial mitigation to filled. Open registers represent unresolved inefficiency. Deeply mitigated registers have already lost part of their tactical edge.
Step 4: Use The Internal Profile
When the participation histogram is enabled, look for bins that concentrated most of the intrabar volume. The local point of control and denser profile segments often become the most useful retest references inside the wider zone.
Step 5: Apply It As Context, Not A Standalone Trigger
Aperture Imbalance Register works best as a context layer. It helps frame whether an imbalance stack is supporting continuation or warning of unresolved opposing pressure. Use it with your own structure, execution, and risk model.
Indicator Limitations
Originality Statement
Aperture Imbalance Register is original in the way it treats imbalances as managed registers rather than passive boxes. The script is published because it contributes more than a generic fair value gap mashup:
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. Imbalance zones are analytical references based on historical price behavior and lower-timeframe participation, not guarantees of future reaction. Markets can rebalance, ignore, or invalidate any zone without warning. Always use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Introduction
Aperture Imbalance Register is an open-source Pine Script v6 indicator built to detect, rank, and manage directional imbalance zones in a more structured way than a basic fair value gap overlay. Instead of marking every raw three-candle gap and leaving the trader to judge which ones matter, the script builds a register of active bullish and bearish imbalance zones, measures their internal lower-timeframe participation, assigns a quality score, tracks mitigation progress, and keeps the resulting stack visible with a compact institutional-style dashboard.
The problem this indicator solves is selectivity. Many imbalance tools show too many zones, retire them too slowly, or provide no context for which inefficiencies are likely to matter. Aperture Imbalance Register focuses on the active imbalance stack and grades each register by combining gap displacement with lower-timeframe volume participation. That lets the trader see not only where imbalance exists, but how concentrated the internal participation was when the zone formed.
The script is designed for traders who use imbalance as part of a broader market-structure process. It is not trying to predict every reversal. It is designed to answer practical chart questions: where are the open directional inefficiencies, how strong are they, how much of each zone has been mitigated, and whether the current stack favors bullish or bearish continuation pressure.
Because the script uses Pine Script v6 lower-timeframe arrays, the register is not just a visual box painter. It uses lower-timeframe intrabar data to build participation histograms inside each zone, identify the local point of control of the imbalance, and display whether a register still has open space or has already been substantially repaired by later price action.
Core Concepts
1. Confirmed Bullish and Bearish Gap Detection
The script detects a bullish register when the current low is above the high from two bars ago and the middle bar confirms continuation. It detects a bearish register with the inverse condition. A sigma-style filter based on the statistical size of the gap helps reject weaker dislocations:
bool confirmedBullGap = enoughGapHistory and barstate.isconfirmed and low > high[2] and high[1] > high[2] and bullGapSigma > gapSigma
bool confirmedBearGap = enoughGapHistory and barstate.isconfirmed and high < low[2] and low[1] < low[2] and bearGapSigma > gapSigma
This means the indicator is not plotting every minor price skip. It requires both structural displacement and a size filter before a new register is added to the active stack.
2. Lower-Timeframe Participation Ranking
Once a gap is confirmed, the script requests lower-timeframe `close` and `volume` data using `request.security_lower_tf()` and maps intrabar participation into configurable bins across the zone. That participation profile is then used to score the register.
This matters because not all imbalances are equal. Some form with broad participation spread across the full zone. Others form with concentrated acceptance in one portion of the gap. The participation histogram helps identify where the market transacted most heavily inside the register and where the imbalance may be most meaningful on a retest.
3. Quality Scoring and Register Prioritization
Each register receives a quality score derived from the concentration of lower-timeframe participation plus the size of the gap sigma event. Higher-quality zones get more visual emphasis, stronger edges, and greater dashboard influence.
In practice, this creates a hierarchy. The trader does not need to treat every imbalance equally. The register list naturally emphasizes the zones with stronger displacement and denser participation.
4. Mitigation Tracking and Lifecycle Management
Open imbalance is not enough. What matters is whether the zone remains unfilled. The script measures mitigation depth as price trades back into the register and updates the display from open to partial mitigation to fully filled. When the `Retire Fully Mitigated Zones` option is enabled, fully repaired or invalidated zones are removed from the active stack.
This keeps the chart cleaner and prevents stale boxes from dominating the view after the market has already rebalanced the inefficiency.
5. Participation Histogram and Local POC
Each register can display a small internal histogram showing participation intensity by price segment. The maximum participation bin defines the register’s local point of control, and that level is drawn as a line through the zone.
This gives the register more structure than a plain box. Instead of just seeing the outer bounds, the trader can see where activity concentrated inside the imbalance.
Features
- Bullish and bearish imbalance registers: Detects confirmed gap-style inefficiencies in both directions using confirmed-bar logic
- Lower-timeframe participation model: Uses lower-timeframe arrays to rank each register by internal participation rather than gap presence alone
- Quality scoring: Combines participation concentration and sigma displacement into a single register score
- Mitigation tracking: Continuously estimates how much of each register has been repaired by later price action
- Automatic lifecycle retirement: Fully mitigated or invalidated zones can be retired automatically to reduce clutter
- Internal histogram bars: Optional profile bars show where lower-timeframe participation concentrated inside the zone
- Point-of-control line: Each register maintains a local participation midpoint for tactical reference
- Midline support: Optional dotted midpoint line helps visualize the fair center of the register
- Dashboard summary: Displays bull count, bear count, mitigated count, average quality, best quality, stack count, and bias
- Data-window exports: Publishes stack bias, quality sum, and active register count for downstream reading
Visual Elements
- Register boxes: The outer body of each imbalance zone shows whether price is dealing with bullish or bearish open inefficiency
- Participation bars: Optional internal profile bars highlight where lower-timeframe participation concentrated inside the register
- Midline and POC references: The centerline and participation high point help identify the most important sub-levels inside the zone
- Adaptive edge intensity: Stronger registers receive more visual emphasis than weaker ones
- Mitigation labels: Each register updates from open to mitigation to filled so the chart communicates lifecycle state directly
Best Practices
- Use the register stack as context, then let your own execution model decide entries
- Favor high-quality registers that align with broader structure instead of reacting to every new zone
- Treat partial mitigation as a sign that some imbalance has already been repaired, not as automatic invalidation
- Be especially careful on symbols with poor lower-timeframe data because internal participation quality can degrade
- If the active stack flips from one side to the other quickly, read that as changing imbalance context rather than a guaranteed reversal signal
Input Parameters
Intrabar Data:
- Auto Lower Timeframe: Automatically derives a lower timeframe for participation analysis
- Custom Lower Timeframe: Allows manual lower-timeframe selection when auto mode is disabled
- Calculation Depth: Controls how much lower-timeframe history is requested
Imbalance Detection:
- Gap Sigma Filter: Sets the minimum displacement strength required for a new register
- Participation Bins: Controls how many internal profile slices are built inside each zone
- Max Active Registers: Limits how many open registers remain on the chart at once
- Retire Fully Mitigated Zones: Removes zones once they are effectively repaired or invalidated
Lifecycle And Display:
- Extend Active Zones: Extends open registers to the right for forward reference
- Show Participation Histogram: Displays the internal lower-timeframe bar profile
- Show Midline: Draws a dotted centerline through each register
- Show Dashboard: Enables the top-right summary panel
How to Use This Indicator
Step 1: Read the Stack Bias
Start with the dashboard. Compare the bullish and bearish active register counts and note the stack bias value. A positive bias means bullish imbalance is dominating the active structure. A negative bias means bearish imbalance is dominating.
Step 2: Focus on Quality, Not Quantity
Use the average and strongest quality readings to judge whether the active stack is meaningful. A chart with fewer but stronger registers is often more actionable than a chart with many weak inefficiencies.
Step 3: Watch Mitigation Progress
Each active register updates from open to partial mitigation to filled. Open registers represent unresolved inefficiency. Deeply mitigated registers have already lost part of their tactical edge.
Step 4: Use The Internal Profile
When the participation histogram is enabled, look for bins that concentrated most of the intrabar volume. The local point of control and denser profile segments often become the most useful retest references inside the wider zone.
Step 5: Apply It As Context, Not A Standalone Trigger
Aperture Imbalance Register works best as a context layer. It helps frame whether an imbalance stack is supporting continuation or warning of unresolved opposing pressure. Use it with your own structure, execution, and risk model.
Indicator Limitations
- Because the script uses lower-timeframe data requests, realtime behavior can differ slightly from historical behavior as new intrabars accumulate inside the live bar
- Mitigation does not guarantee reversal or continuation. It only shows how much of the zone has been traded back through
- A strong register can still fail if broader market structure, liquidity, or volatility conditions change
- On very low-history charts or symbols with thin lower-timeframe data, participation quality can be less informative than on liquid instruments
Originality Statement
Aperture Imbalance Register is original in the way it treats imbalances as managed registers rather than passive boxes. The script is published because it contributes more than a generic fair value gap mashup:
- It ranks each imbalance with a lower-timeframe participation model instead of drawing every gap with equal importance
- It combines gap displacement, intrabar participation, mitigation tracking, and internal histogram rendering into a single workflow
- It maintains a tactical register stack with lifecycle management rather than leaving stale zones permanently on the chart
- It exposes stack-level information through a dashboard and data-window fields so the indicator can be read systematically
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. Imbalance zones are analytical references based on historical price behavior and lower-timeframe participation, not guarantees of future reaction. Markets can rebalance, ignore, or invalidate any zone without warning. Always use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.