Liquidity Indicator: Swing Levels Extended as Liquidity Lines

Written by Dominic Walsh · Published · Last updated

Stops cluster above swing highs and below swing lows. The liquidity indicator finds those swing points and carries each level forward as a horizontal line, so you can see which pools price has not yet reached. It marks structure rather than direction, and there is nothing in it that tells you to buy or sell.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 2: SwingHigh, SwingLow
Alerts popup
Inputs 11

What the Liquidity Indicator draws on the chart

SwingHigh puts a tomato marker above each confirmed pivot high.

SwingLow puts a dodger blue marker below each confirmed pivot low.

Trend line objects extend every level forward across the chart, coloured to match their marker.

Line width and style follow your settings, so the levels can sit quietly behind the candles.

  • SwingHigh: arrow, tomato, width 1, arrow code 234
  • SwingLow: arrow, dodger blue, width 1, arrow code 233
Liquidity indicator on EURUSD H1 with swing levels extended forward as lines
Liquidity indicator on EURUSD H1 with swing levels extended forward as lines

How the Liquidity Indicator calculates its values

A strict pivot test

isHigh starts true and survives only while high[i] beats high[i + k] on the older side and high[i – k] on the newer side, for every k inside the window. Note the comparison uses a strict greater-than. Two bars sharing an identical high both fail, so a level only appears when one bar clearly stands above its neighbours.

Scanning within bounds

scanFrom takes MathMin(`LookbackBars`, rates_total – `PivotRight` – 1). That second term matters: a pivot needs bars on its newer side to be tested against, so the scan has to stop short of the chart edge. The same test runs again over a second index in the confirmation pass, using isHigh2 and isLow2.

Carrying the level forward

Each confirmed pivot becomes a trend line object drawn `LineExtendBars` bars into the future. Sixty bars is the default reach. Markers sit 20 points clear of the candle, a value fixed in the code rather than exposed as an input, and `ShowArrows` switches them off when you want lines alone.

How to read the signals

Lines price has not yet touched mark the pools still sitting there.

Several levels stacked at a similar price is a stronger cluster than one line on its own.

A level swept and left behind tells a different story from one price stopped short of.

Extension is a drawing choice, not a prediction. A line reaching 60 bars forward says nothing about those bars.

Alert channels in this build: popup, one message per closed bar.

A terminal popup is the only channel, and `AlertOnNewSwing` ships `false`, so the tool stays silent until you turn it on. Enable it and a message follows each newly confirmed swing on a closed bar, limited to one per bar by the guard.

Every Liquidity Indicator input

Core settings

Setting What it does Default
PivotLeft Pivot left bars. Bars required on the older side of a pivot, default `3`. 3
PivotRight Pivot right bars. Bars required on the newer side, default `3`. Raise both together for fewer, more significant levels. 3
LookbackBars Bars to scan for swings. How far back the scan runs, default `500`. Lower it when the chart gets crowded. 500
LineExtendBars Extend each level forward (bars). How far each level reaches forward, default `60` bars. 60
ObjPrefix Names every line object, default `”LIQ_”`. LIQ_

Display settings

Setting What it does Default
HighLineColor (see inputs panel) tomato
LowLineColor (see inputs panel) dodger blue
LineWidth (see inputs panel) 1
LineStyleSel 0=solid 1=dash 2=dot. Picks the line style, with `0` solid, 1 dashed and 2 dotted. Dotted keeps levels subordinate to price. 0
ShowArrows (see inputs panel) on

Alert settings

Setting What it does Default
AlertOnNewSwing (see inputs panel) off
Liquidity indicator inputs: PivotLeft, PivotRight, LookbackBars and LineExtendBars
Liquidity indicator inputs: PivotLeft, PivotRight, LookbackBars and LineExtendBars

Settings that fit your chart

Liquidity reading works wherever traders place stops around obvious highs and lows, so the majors and gold all qualify. EURUSD H1 is the reference chart, where a 500-bar scan reaches back about three weeks. On M5 that same lookback covers under two days and the levels turn over fast. On the daily chart 500 bars is two years, which is more history than most levels stay relevant for.

When the Liquidity Indicator fails

The tool infers where stops probably sit. It has no order book and cannot see actual resting orders, so every level is an assumption.

The strict comparison misses equal highs, and a clean double top is exactly the formation many traders consider the strongest liquidity pool.

A 500-bar scan on a fast chart draws dozens of lines. Without raising the pivot settings the display becomes unreadable rather than informative.

Copy the compiled Liquidity Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Liquidity Indicator: Head fake on Wikipedia, Relative Rotation Graphs Rrg Charts at StockCharts ChartSchool.

Download the Liquidity Indicator for MT4 and MT5

The zip holds the compiled Liquidity Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

Why does the liquidity indicator miss equal highs?

The pivot test uses a strict greater-than. high[i] must beat every neighbour within the window, so two bars at an identical high cancel each other and neither becomes a level. That is a real limitation here, because equal highs are often considered the cleanest liquidity pool of all. Widening `PivotLeft` and `PivotRight` does not fix it.

What does LineExtendBars at 60 mean?

Each confirmed level is drawn as a trend line reaching 60 bars into the future. On H1 that is about two and a half days of chart. The number affects drawing only. A level does not become more or less valid because the line is longer, and shortening it simply declutters the display.

How do PivotLeft and PivotRight change what I see?

They set how many bars either side a candidate must beat. Both default to `3`, which is shallow and produces many levels. Raising them to five or eight leaves only pivots that stood out across a wider window, which suits a chart already crowded with lines from a long `LookbackBars` setting.

Why is AlertOnNewSwing off by default?

Because a shallow three-bar pivot confirms often, and on a fast chart that would mean constant messages. The tool is built for reading structure at a glance rather than reacting bar by bar. Turn it on once you have widened the pivot settings enough that a new swing genuinely means something.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Liquidity Indicator as one input. Always backtest before trading live.

Category: this is part of our Smart Money collection. Also, browse more Smart Money for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment