Advanced Supply Demand Indicator: Two Levels That Hold Until Replaced

Written by Dominic Walsh · Published · Last updated

The advanced supply demand indicator keeps two levels on your chart at all times. Demand sits at the most recent confirmed fractal low, supply at the most recent fractal high. Each level holds until a new fractal replaces it, so the lines step rather than drift. An arrow appears when price reaches one and the candle rejects 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 4: Demand, Supply, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 8

What the Advanced Supply Demand Indicator draws on the chart

Demand is the forest green line at the last confirmed fractal low.

Supply is the crimson line at the last confirmed fractal high.

Buy places a wide lime arrow where price dipped to demand and closed back above it.

Sell places a wide red arrow at the mirror rejection under supply.

  • Demand: line, forest green
  • Supply: line, crimson
  • Buy: arrow, lime, width 4, arrow code 233
  • Sell: arrow, red, width 4, arrow code 234
Advanced supply demand indicator on EURUSD H1 with the two fractal levels and rejection arrows
Advanced supply demand indicator on EURUSD H1 with the two fractal levels and rejection arrows

How the Advanced Supply Demand Indicator calculates its values

Carrying the level forward

Each bar starts by inheriting: dem takes Demand[i+1] when that value exists, otherwise low[i]. sup does the same from Supply[i+1]. That inheritance is why the lines run flat between swings rather than tracking price. A level only moves when something replaces it.

Replacing on a new fractal

IsFractalLow tests the bar at i + `SwingLookback`, stepping back so the candidate has the bars either side it needs. A pass sets dem to low at that bar, and IsFractalHigh does the same for sup. With `SwingLookback` at `8` a pivot must stand out across a wide window, so replacements are infrequent and the levels stay meaningful.

Requiring rejection, not a touch

A buy needs three things on one bar: low[i] at or below dem, close[i] above dem, and close[i] above open[i]. Price reached the level, came back through it, and finished bullish. The sell side inverts all three. Demanding the candle direction as well as the close-back is what separates a rejection from price simply passing through.

How to read the signals

Flat stretches are the normal state. A stepping line means a new swing just replaced the old level.

The two levels bracket price, so the distance between them is a rough read on the current range.

An arrow requires the candle itself to agree, which is why price can touch a level without producing one.

A level broken cleanly stays on the chart until a new fractal replaces it, so it may sit on the wrong side of price for a while.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

Four channels sit beneath `EnableAlerts`: popup, push notification, email and sound, with `SoundFile` naming the clip. Popup ships enabled. The guard compares against the stored bar time, so a closed bar produces at most one message.

Every Advanced Supply Demand Indicator input

Core settings

Setting What it does Default
SwingLookback Bars either side of a fractal, default `8`. This is the only calculation input, and it governs how often the levels move. 8

Display settings

Setting What it does Default
ArrowOffsetPoints Distance between candle and arrow, default `40` points, set wide because the arrows draw at width 4. 40

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
Advanced supply demand indicator inputs: SwingLookback and ArrowOffsetPoints
Advanced supply demand indicator inputs: SwingLookback and ArrowOffsetPoints

Settings that fit your chart

An eight-bar fractal needs a chart with real swings, which points at H1 and above. The screenshot note calls for EURUSD H1, where the levels typically change a few times a week. On M5 they update faster and mean less. On H4 and daily each level can stand for weeks, which suits traders who work from a small number of reference prices.

When the Advanced Supply Demand Indicator fails

The levels are single fractal prices rather than zones, so a rejection a few points away from the line produces nothing.

A level persists until a new fractal replaces it, which means it can sit well behind price after a strong move.

Eight bars either side is a long confirmation, so the level updates several bars after the swing that set it.

Copy the compiled Advanced Supply Demand 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: Supply and Demand Strategy.

Background reading on the method behind the Advanced Supply Demand Indicator: Precautionary demand on Wikipedia, Trend Lines at StockCharts ChartSchool.

Download the Advanced Supply Demand Indicator for MT4 and MT5

The zip holds the compiled Advanced Supply Demand 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

Does SwingLookback produce levels or zones?

Single price levels. Demand holds one fractal low and Supply one fractal high, each drawn as a line rather than a band. That is stricter than a zone-based tool: price has to reach the exact level for the rejection test to fire, so a near miss produces nothing. Traders who prefer zones will find this unforgiving.

What does SwingLookback at 8 require?

That the pivot bar’s low sits below every low within eight bars on each side, giving a seventeen-bar window. That is a demanding test, which is why the levels change infrequently. Lowering it to 4 or 5 makes them update far more often at the cost of marking smaller swings.

Why does the Buy arrow need the candle to close bullish too?

Because a close back through the level is not enough on its own. A buy also needs close[i] above open[i], so the bar itself finished bullish. Without that test a candle could dip to demand, close a fraction above it while still falling overall, and register as a rejection it plainly was not.

Why does the Demand line sometimes sit far below price?

Because it holds until a new fractal low replaces it. After a strong rally the last confirmed low can be well behind, and with an eight-bar confirmation a fresh one takes time to register. The line is telling you honestly where the last confirmed swing low was, not where support is now.

Are results guaranteed?

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

Category: this is part of our Trend collection. Then, still, browse more Trend 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