ICT Market Structure Indicator: HH, HL, LH, LL and a Trend Flip

Written by Dominic Walsh · Published · Last updated

The ict market structure indicator reads the sequence of swings and gives it a name. Every confirmed pivot gets an HH, HL, LH or LL label, and a small state machine decides which way the trend is pointing. Two consecutive higher highs turn it up. Two consecutive lower lows turn it down. Nothing else moves it.

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 3: Swing High, Swing Low, Trend Ref
Alerts popup, push notification, email, sound
Inputs 16

What the Ict Market Structure Indicator draws on the chart

Swing High marks each confirmed pivot high with a dodger blue arrow above the bar.

Swing Low marks each pivot low with a crimson arrow below it.

Trend Ref is a gold line at the midpoint between the last swing high and the last swing low.

Text objects place the HH, HL, LH and LL labels beside their pivots, each colour-coded by type.

  • Swing High: arrow, dodger blue, width 2, arrow code 233
  • Swing Low: arrow, crimson, width 2, arrow code 234
  • Trend Ref: line, gold, width 1
ICT market structure indicator on EURUSD H1 with HH, HL, LH and LL labels
ICT market structure indicator on EURUSD H1 with HH, HL, LH and LL labels

How the Ict Market Structure Indicator calculates its values

The three-bar swing

`InpSwingStrength` defaults to `1`, which the source header calls the classic three-bar swing: the pivot bar’s high must sit strictly above both neighbours, with the mirror test for lows. needed takes InpSwingStrength * 2 + 3, the minimum bars the detector requires before it can judge anything.

Naming each swing against the last of its kind

A new swing high is compared with the previous swing high, never with a low. Above it becomes an HH, below it an LH. Swing lows compare the same way to produce HL or LL. That pairwise comparison is what turns a list of pivots into a readable sequence, and `InpDrawLabels` writes the result onto the chart.

Flipping the trend state

The state machine is deliberately slow. It turns UP only after `InpConfirmCount` consecutive HHs, and DOWN after the same number of consecutive LLs, with the default at `2`. One higher high changes nothing. Alongside it, mid takes the average of the last swing high and low, which is what the gold reference line plots.

How to read the signals

Read the labels as a run, not one at a time. HH then HL is an intact uptrend; HH then LL is not.

The gold line sits between the last two swings, so price above it is in the upper half of the current structure.

A single HH after a downtrend does not flip the state, and that patience is the design.

Arrows mark every pivot, so a busy chart usually means the swing strength is too low for that timeframe.

Alert channels in this build: popup, push notification, email and sound.

Four channels sit under `EnableAlerts`: popup, push notification, email and sound, with popup on by default. Worth knowing that the facts for this build show no once-per-bar guard, so a bar confirming more than one structure event can raise more than one message.

Every Ict Market Structure Indicator input

Core settings

Setting What it does Default
InpSwingStrength Swing strength (bars on each side; 1 = classic 3-bar). Bars either side of a pivot, default `1` for the classic three-bar swing. Raise it to 2 or 3 for fewer, more significant pivots. 1
InpConfirmCount Consecutive HH or LL needed to flip trend. Consecutive HHs or LLs needed before the trend state flips, default `2`. Raising it makes the state slower and steadier. 2
InpLookbackBars Max bars to process. Maximum bars processed, default `1500`, which bounds the work on a long history. 1500

Display settings

Setting What it does Default
InpDrawLabels Draw HH/HL/LH/LL text labels. Turns the HH/HL/LH/LL text on and off; `InpDrawTrendLine` does the same for the gold midpoint line. on
InpDrawTrendLine Draw mid trend reference line. on
InpLabelOffsetPt Label vertical offset (points). Vertical gap for the labels, default `35` points. 35
InpHHColor (see inputs panel) lime
InpHLColor (see inputs panel) lime green
InpLHColor (see inputs panel) tomato
InpLLColor (see inputs panel) crimson

Alert settings

Setting What it does Default
EnableAlerts (see inputs panel) on
EnablePopup (see inputs panel) on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
ICT market structure indicator inputs: InpSwingStrength and InpConfirmCount
ICT market structure indicator inputs: InpSwingStrength and InpConfirmCount

Settings that fit your chart

Structure reading suits instruments that move in clean legs. EURUSD H1 is the reference chart, where a three-bar swing catches intraday turns without overwhelming the chart. On M1 the same setting labels nearly every wiggle. On H4 and daily pivots become rare, each label carries more weight, and the trend state changes only a handful of times a year.

When the Ict Market Structure Indicator fails

A three-bar swing is shallow. In a range the labels alternate constantly and the sequence tells you nothing useful.

Pivot confirmation needs the bars either side, so every label arrives after the turn it describes.

The trend state only ever counts HHs and LLs. A market making higher lows without higher highs never flips it, however clearly it is rising.

Copy the compiled Ict Market Structure 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.

Related on forexmt4systems.com: ICT Style Strategy.

Background reading on the method behind the Ict Market Structure Indicator: Composite (finance) on Wikipedia, Morningstar at Investopedia.

Download the Ict Market Structure Indicator for MT4 and MT5

The zip holds the compiled Ict Market Structure 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

How shallow is a swing at InpSwingStrength 1?

The classic three-bar swing. A pivot high needs its own high strictly above the bar before and the bar after, and nothing more. That is the shallowest useful definition, which is why it produces plenty of pivots. Raise it to 2 and each pivot must beat two bars on each side, which thins the chart considerably.

Why does InpConfirmCount need two HHs to flip the trend?

To stop a single swing reversing the read. One higher high inside a downtrend happens constantly during pullbacks. Requiring two consecutive HHs means the sequence itself has changed rather than one swing. Raise it to 3 for an even slower state that ignores most retracements.

What is the gold Trend Ref line?

The midpoint between the most recent swing high and the most recent swing low, computed as their average. It gives you a quick sense of where price sits inside the current structure. It is not a moving average and it only moves when a new swing confirms.

Can the trend state flip on higher lows alone?

No, and that is a genuine blind spot. The state machine counts consecutive HHs and consecutive LLs only. A market grinding up through higher lows without taking out prior highs keeps whatever state it had. Watch the HL labels yourself in that situation.

Are results guaranteed?

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

Category: this is part of our Smart Money collection. Next, plainly, truly, 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