indicator · on price · open source
Imbalance Zones indicator
Imbalance Zones is a free open-source indicator by @deepwick. Imbalance Zones — permissive Fair Value Gaps (any 3-candle imbalance, no minimum size) so… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Imbalance Zones does
Imbalance Zones — permissive Fair Value Gaps (any 3-candle imbalance, no minimum size) so you see every unfilled area.
- Green zone = bullish imbalance, red = bearish.
- Optional
minGapPctto suppress noise on instruments with micro-gaps. - Use when you want to see all imbalances, not just the SMC-grade ones.
- Bullish imbalances below current price = demand; bearish imbalances above = supply.
- Two adjacent imbalances in the same direction = 'conduit' — price moves straight through without pause.
- Default
minGapPctof 0 captures everything; raise to 0.1% to filter micro-gaps. - Use the colour inputs to theme bullish/bearish imbalances independently to match your chart palette.
- The new-imbalance alert signals every fresh zone so you can chain entries on retests.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Imbalance Zones", overlay=true)
minGapPct = input.float(0, "Min Gap %", minval=0, maxval=5, step=0.05)
extendBars = input.int(30, "Extend Bars", minval=5, maxval=200)
bullColor = input.string("color.green", "Bullish Imbalance Color")
bearColor = input.string("color.red", "Bearish Imbalance Color")
transparency = input.int(90, "Fill Transparency", minval=50, maxval=99)
alertBull = input.bool(true, "Alert on Bullish Imbalance")
alertBear = input.bool(true, "Alert on Bearish Imbalance")
alertOpposite = input.bool(false, "Alert on Opposing Imbalances (compression)")
markerColor = input.string("color.gray", "Marker Color")
markerText = input.string("IMB", "Marker Text")
imbBull = low[0] > high[2]
imbBear = high[0] < low[2]
imbBullPct = (low[0] - high[2]) / close * 100
imbBearPct = (low[2] - high[0]) / close * 100
imbBull := imbBull and imbBullPct >= minGapPct
imbBear := imbBear and imbBearPct >= minGapPct
var float imbBullTop = na
var float imbBullBot = na
var float imbBearTop = na
var float imbBearBot = na
var int imbBullAge = 9999
var int imbBearAge = 9999
if imbBull
imbBullTop := low[0]
imbBullBot := high[2]
imbBullAge := 0
if imbBear
imbBearTop := low[2]
imbBearBot := high[0]
imbBearAge := 0
imbBullAge += 1
imbBearAge += 1
if imbBullAge > extendBars
imbBullTop := na
imbBullBot := na
if imbBearAge > extendBars
imbBearTop := na
imbBearBot := na
p_Bull_Imb_Top = plot(imbBullTop, "Bull Imb Top", color=bullColor, style=plot.style_linebr)
p_Bull_Imb_Bot = plot(imbBullBot, "Bull Imb Bot", color=bullColor, style=plot.style_linebr)
p_Bear_Imb_Top = plot(imbBearTop, "Bear Imb Top", color=bearColor, style=plot.style_linebr)
p_Bear_Imb_Bot = plot(imbBearBot, "Bear Imb Bot", color=bearColor, style=plot.style_linebr)
fill(p_Bull_Imb_Top, p_Bull_Imb_Bot, color=color.new(bullColor, transparency))
fill(p_Bear_Imb_Top, p_Bear_Imb_Bot, color=color.new(bearColor, transparency))
alertcondition(imbBull, "Bullish imbalance", "Bullish imbalance zone formed")
alertcondition(imbBear, "Bearish imbalance", "Bearish imbalance zone formed")
alertcondition(imbBull and imbBull[1], "Stacked bullish imbalances", "Two consecutive bullish imbalances — sustained demand")
alertcondition(imbBear and imbBear[1], "Stacked bearish imbalances", "Two consecutive bearish imbalances — sustained supply")
alertcondition(imbBull and imbBear, "Opposing imbalances", "Bullish and bearish imbalances on the same bar — compression")
No comments yet.
Sign in to comment.