OPEN-SOURCE SCRIPT
Telah dikemas kini X VIB

Volume Imbalance Zones
X VIB highlights price-levels where buying or selling pressure overwhelmed the opposing side within a single bar transition, leaving a void that the market often revisits. The script paints those voids as boxes so you can quickly see where liquidity may rest, where price may pause or react, and which imbalances persist across sessions.
What it plots
For each completed calculation bar (your chart’s timeframe or a higher timeframe you choose), the indicator draws a box that spans the prior bar’s close to the current bar’s open—only when that bar-to-bar transition exhibits a valid volume imbalance (VIB) by the selected rules. Boxes are time-anchored from the previous bar’s time to the current bar’s time close, and they are capped to a configurable count so the chart remains readable.
Two ways to define “Volume Imbalance”
X VIB calculates imbalances in two complementary ways. Both techniques isolate bar-to-bar displacement that reflects one-sided pressure, but they differ in strictness and how much confirmation they require.
Continuity VIB (Bar-to-Bar Displacement)
A strict definition that requires aligned progress and overlap between consecutive bars. In practical terms, a bullish continuity VIB demands that the new bar advances beyond the prior bar’s close, opens above it, and maintains upward progress without erasing the displacement; the bearish case mirrors this to the downside.
Use when: you want the cleanest, most structurally reliable voids that reflect decisive initiative flow.
Effect on boxes: typically fewer, higher-quality zones that mark locations of strong one-sided intent.
Gap-Qualified VIB (Displacement with Gap Confirmation)
A confirmatory definition that treats the bar-to-bar displacement as an imbalance only if the transition also observes a protective “gap-like” relationship with surrounding prices. This extra condition filters out many borderline transitions and emphasizes voids that were less likely to be traded through on their formation.
Use when: you want additional confirmation that the void had genuine follow-through pressure at birth.
Effect on boxes: often slightly fewer but “stickier” zones that can attract price on retests.
Both modes are drawn identically on the chart (as boxes spanning the displacement). Their difference is purely in the qualification of what counts as a VIB. You can display either set independently or together to compare how each mode surfaces structure.
Multi-Timeframe (MTF) logic
You can compute imbalances on a higher timeframe (e.g., 15-minute) while viewing a lower timeframe chart. When MTF is active, X VIB:
Samples open, high, low, close, time, and time_close from the selected HTF in a single, synchronized request (no gaps, no lookahead).
Only evaluates and draws boxes once per HTF bar close, ensuring clean, stable zones that don’t repaint intra-bar.
How traders use these zones
Reversion into voids: Price often returns to “fill” part of a void before deciding on continuation or reversal.
Context for entries/exits: VIB boxes provide precise, mechanically derived levels for limit entries, scale-outs, and invalidation points.
Confluence: Combine with session opens, HTF levels, or volatility bands to grade setups. Continuity VIBs can mark impulse anchors; Gap-Qualified VIBs often mark stickier pockets.
Inputs & controls
Calculate on higher timeframe? Toggle MTF computation; choose your Calc timeframe (e.g., 15).
Show VIBs: Master toggle for drawing imbalance boxes.
Color & Opacity: Pick the box fill and border intensity that suits your theme.
# Instances: Cap how many historical boxes remain on the chart to avoid clutter.
Notes & best practices
Signal density: Continuity VIBs tend to be more frequent on fast charts; Gap-Qualified VIBs are more selective. Try both and keep what aligns with your trade plan.
MTF discipline: When using a higher calc timeframe, analyze reactions primarily at that timeframe’s pace to avoid over-fitting to noise.
Lifecycle awareness: Not all voids fill. Track which boxes persist; durable voids often define the map of the session.
X VIB highlights price-levels where buying or selling pressure overwhelmed the opposing side within a single bar transition, leaving a void that the market often revisits. The script paints those voids as boxes so you can quickly see where liquidity may rest, where price may pause or react, and which imbalances persist across sessions.
What it plots
For each completed calculation bar (your chart’s timeframe or a higher timeframe you choose), the indicator draws a box that spans the prior bar’s close to the current bar’s open—only when that bar-to-bar transition exhibits a valid volume imbalance (VIB) by the selected rules. Boxes are time-anchored from the previous bar’s time to the current bar’s time close, and they are capped to a configurable count so the chart remains readable.
Two ways to define “Volume Imbalance”
X VIB calculates imbalances in two complementary ways. Both techniques isolate bar-to-bar displacement that reflects one-sided pressure, but they differ in strictness and how much confirmation they require.
Continuity VIB (Bar-to-Bar Displacement)
A strict definition that requires aligned progress and overlap between consecutive bars. In practical terms, a bullish continuity VIB demands that the new bar advances beyond the prior bar’s close, opens above it, and maintains upward progress without erasing the displacement; the bearish case mirrors this to the downside.
Use when: you want the cleanest, most structurally reliable voids that reflect decisive initiative flow.
Effect on boxes: typically fewer, higher-quality zones that mark locations of strong one-sided intent.
Gap-Qualified VIB (Displacement with Gap Confirmation)
A confirmatory definition that treats the bar-to-bar displacement as an imbalance only if the transition also observes a protective “gap-like” relationship with surrounding prices. This extra condition filters out many borderline transitions and emphasizes voids that were less likely to be traded through on their formation.
Use when: you want additional confirmation that the void had genuine follow-through pressure at birth.
Effect on boxes: often slightly fewer but “stickier” zones that can attract price on retests.
Both modes are drawn identically on the chart (as boxes spanning the displacement). Their difference is purely in the qualification of what counts as a VIB. You can display either set independently or together to compare how each mode surfaces structure.
Multi-Timeframe (MTF) logic
You can compute imbalances on a higher timeframe (e.g., 15-minute) while viewing a lower timeframe chart. When MTF is active, X VIB:
Samples open, high, low, close, time, and time_close from the selected HTF in a single, synchronized request (no gaps, no lookahead).
Only evaluates and draws boxes once per HTF bar close, ensuring clean, stable zones that don’t repaint intra-bar.
How traders use these zones
Reversion into voids: Price often returns to “fill” part of a void before deciding on continuation or reversal.
Context for entries/exits: VIB boxes provide precise, mechanically derived levels for limit entries, scale-outs, and invalidation points.
Confluence: Combine with session opens, HTF levels, or volatility bands to grade setups. Continuity VIBs can mark impulse anchors; Gap-Qualified VIBs often mark stickier pockets.
Inputs & controls
Calculate on higher timeframe? Toggle MTF computation; choose your Calc timeframe (e.g., 15).
Show VIBs: Master toggle for drawing imbalance boxes.
Color & Opacity: Pick the box fill and border intensity that suits your theme.
# Instances: Cap how many historical boxes remain on the chart to avoid clutter.
Notes & best practices
Signal density: Continuity VIBs tend to be more frequent on fast charts; Gap-Qualified VIBs are more selective. Try both and keep what aligns with your trade plan.
MTF discipline: When using a higher calc timeframe, analyze reactions primarily at that timeframe’s pace to avoid over-fitting to noise.
Lifecycle awareness: Not all voids fill. Track which boxes persist; durable voids often define the map of the session.
Nota Keluaran
clean up codeNota Keluaran
another code clean up Nota Keluaran
clean upNota Keluaran
fixesSkrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.