Indicator · Pine Script v6 · On the chart

EQH / EQL Liquidity

by mumbi-dev

An overlay indicator that finds pivot highs and lows and marks equal highs and equal lows, the areas where buy-side and sell-side liquidity tend to rest.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code144
Settings14inputs
LicenceMIT
Last update5 weeks ago19 Sep 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

144 lines of Pine Script v6 from Liquidity_EQHs_and_EQLs.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

Liquidity_EQHs_and_EQLs.pine
//@version=6
indicator("EQH / EQL Liquidity", shorttitle = "EQH/EQL", overlay = true,
     max_lines_count = 500, max_labels_count = 100)

// ─── INPUTS
gL         = "Liquidity"
pivLen     = input.int(5,      "Pivot Length",              minval = 1, group = gL)
tolPct     = input.float(0.15, "Equal Tolerance %",         minval = 0.0, step = 0.01, group = gL)
minBars    = input.int(10,     "Min Bars Between Pivots",   minval = 1, group = gL)
maxMem     = input.int(6,      "Remember N Pivots",         minval = 2, maxval = 20, group = gL)
minProm    = input.float(0.5,  "Min Pivot Prominence (ATR)", minval = 0.0, step = 0.1, group = gL)
extend     = input.int(20,     "Extend Right (bars)",       minval = 0, group = gL)
sweepBuf   = input.float(0.05, "Sweep Buffer (% of level)", minval = 0.0, step = 0.01, group = gL)
maxBack    = input.int(500,    "Max Historical Lookback",   minval = 50, group = gL)

gV         = "Visuals"
showBSL    = input.bool(true,  "Show Buyside (EQH)",        group = gV)
showSSL    = input.bool(true,  "Show Sellside (EQL)",       group = gV)
bslCol     = input.color(color.blue, "Buyside (EQH) Color", group = gV)
sslCol     = input.color(color.red,  "Sellside (EQL) Color", group = gV)
lineWid    = input.int(2,      "Line Width",  minval = 1, maxval = 4, group = gV)
showTag    = input.bool(true,  "Show EQH / EQL Tag",        group = gV)

// ─── GLOBAL ta.* 
atrNow  = ta.atr(14)
lowRef  = ta.lowest(low,   pivLen * 2)[pivLen]
highRef = ta.highest(high, pivLen * 2)[pivLen]

// ─── PIVOTS 
ph = ta.pivothigh(high, pivLen, pivLen)
pl = ta.pivotlow(low,   pivLen, pivLen)

// ─── STORAGE 
var array<float> rH  = array.new<float>()
var array<int>   rHb = array.new<int>()
var array<float> rL  = array.new<float>()
var array<int>   rLb = array.new<int>()

var array<line>  zLn   = array.new<line>()
var array<label> zTg   = array.new<label>()
var array<float> zPx   = array.new<float>()
var array<bool>  zIsHi = array.new<bool>()
var array<int>   zBar  = array.new<int>()

// ─── HELPERS 
zoneNear(float p, bool isHigh) =>
    e = false
    n = array.size(zPx)
    if n > 0
        for i = 0 to n - 1
            zp   = array.get(zPx, i)
            same = array.get(zIsHi, i) == isHigh
            if same and math.abs(p - zp) / zp * 100 <= tolPct * 2.0
                e := true
                break
    e

// ─── DRAW LIQUIDITY 
drawLiq(array<float> lvls, array<int> brs, float pvt, int currPivBar, bool isHigh) =>
    if not na(pvt)
        promHi = pvt - lowRef
        promLo = highRef - pvt
        prom   = isHigh ? promHi : promLo
        passes = prom >= atrNow * minProm

        if passes
            n   = array.size(lvls)
            hit = false
            mL  = 0.0
            mB  = 0
            if n > 0
                for i = 0 to n - 1
                    lvl  = array.get(lvls, i)
                    bri  = array.get(brs, i)
                    dist = currPivBar - bri
                    if math.abs(pvt - lvl) / lvl * 100 <= tolPct and dist >= minBars
                        hit := true
                        mL  := lvl
                        mB  := bri
                        break
            if hit
                // Level = shallower of the two (the target price stops rest at)
                lvl = isHigh ? math.min(pvt, mL) : math.max(pvt, mL)
                buf = lvl * sweepBuf / 100.0

                // Walk every bar from the FIRST pivot to the current bar
                // and see if price has already pierced the level.
                alreadySwept = false
                lb = math.min(bar_index - mB, maxBack)
                if lb >= 0
                    for k = 0 to lb
                        if isHigh
                            if high[k] > lvl + buf
                                alreadySwept := true
                                break
                        else
                            if low[k] < lvl - buf
                                alreadySwept := true
                                break

                if not alreadySwept and not zoneNear(lvl, isHigh)
                    col = isHigh ? bslCol : sslCol
                    ln  = line.new(mB, lvl, bar_index + extend, lvl, color = col, width = lineWid)
                    lblTxt = isHigh ? "EQH" : "EQL"
                    lblSty = isHigh ? label.style_label_down : label.style_label_up
                    lb2 = showTag ? label.new(bar_index + extend, lvl, lblTxt, style = lblSty, color = color.new(col, 20), textcolor = color.white, size = size.tiny) : na
                    array.push(zLn,   ln)
                    array.push(zTg,   lb2)
                    array.push(zPx,   lvl)
                    array.push(zIsHi, isHigh)
                    array.push(zBar,  bar_index)
            array.push(lvls, pvt)
            array.push(brs,  currPivBar)
            while array.size(lvls) > maxMem
                array.shift(lvls)
                array.shift(brs)

if showBSL
    drawLiq(rH, rHb, ph, bar_index - pivLen, true)
if showSSL
    drawLiq(rL, rLb, pl, bar_index - pivLen, false)

// ─── SWEEP DETECTION — DELETE ON HUNT (ongoing)
if array.size(zPx) > 0
    for i = array.size(zPx) - 1 to 0
        if bar_index > array.get(zBar, i)
            lvl   = array.get(zPx, i)
            isHi  = array.get(zIsHi, i)
            buf   = lvl * sweepBuf / 100.0
            swept = isHi ? high > lvl + buf : low < lvl - buf
            if swept
                line.delete(array.get(zLn, i))
                lbl = array.get(zTg, i)
                if not na(lbl)
                    label.delete(lbl)
                array.remove(zLn,   i)
                array.remove(zTg,   i)
                array.remove(zPx,   i)
                array.remove(zIsHi, i)
                array.remove(zBar,  i)

// ─── ALERTS 
alertcondition(showBSL, "EQH formed", "Equal highs detected on {{ticker}}")
alertcondition(showSSL, "EQL formed", "Equal lows detected on {{ticker}}")

Overview

Pivots must match within a percentage tolerance, sit a minimum number of bars apart and pass an ATR prominence test. Lines extend to the right and are tracked for sweeps with a buffer. Inputs set pivot length, tolerance, memory, colors, line width and tags.

Details

Published by

mumbi-dev on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Pivot Lengthint5pivLen
Equal Tolerance %float0.15tolPct
Min Bars Between Pivotsint10minBars
Remember N Pivotsint6maxMem
Min Pivot Prominence (ATR)float0.5minProm
Extend Right (bars)int20extend
Sweep Buffer (% of level)float0.05sweepBuf
Max Historical Lookbackint500maxBack
Show Buyside (EQH)booltrueshowBSL
Show Sellside (EQL)booltrueshowSSL
Buyside (EQH) Colorcolorcolor.bluebslCol
Sellside (EQL) Colorcolorcolor.redsslCol
Show all 14 settings
SettingTypeDefaultVariable
Line Widthint2lineWid
Show EQH / EQL TagbooltrueshowTag
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

ICT Equal Highs and Lows

by ArunKBhaskar
575 stars

This overlay indicator finds pivot highs and lows on the price chart and compares the last two highs and the last two lows. When the percentage difference between a pair is below the Equal HL threshold, it treats them as equal levels and draws a box. Left and

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows

DE-tracker

by Allen1212
303 stars

This indicator plots labels on the TradingView price chart to mark ARK Invest's buy and sell trades for the DE stock. Buy transactions appear in green with X1 or X2 multipliers showing the number of ARK ETFs involved on the same day; sells appear in red. The m

Indicator v4 Support & resistanceSMC / ICT / price action
Updated 2 years ago · None stated GitHub repository of DE-tracker

This Pine Script indicator plots a ZigZag on the price chart. It identifies reversal points when price moves more than a set percentage from the last pivot. The script calculates forecasts using zigzag data and labels detected geometric patterns including harm

Indicator v4 TrendSupport & resistance

Golden Bullet Strategy

by TradersPost
218 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 3 months ago · None stated GitHub repository of Golden Bullet Strategy

Open Source Fractal

by cantolab
183 stars

This indicator implements the Fractal Model concept to plot market structure shifts, liquidity sweeps, and Change in State of Delivery (CISD) levels. It overlays custom higher-timeframe candle previews, open prices, and time markers directly on the price chart

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MIT GitHub repository of Open Source Fractal

Swing Failure Signals

by Ganador1
154 stars

This indicator calculates pivot highs and pivot lows to detect liquidity sweeps and Swing Failure Patterns. It identifies when price breaks past recent key swing highs or lows within a configurable historical window, then looks for a quick reversal or change i

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · Apache-2.0 GitHub repository of Swing Failure Signals

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers