Luxalgo Supply And Demand Indicator: Three-Bar Gap Zones

Written by Dominic Walsh · Published · Last updated

The Luxalgo Supply And Demand Indicator marks three-bar price gaps and turns each one into a zone on the chart. Rectangles cover the gap and stretch to the right, so you can watch price return to them. Two hidden buffers publish the midpoint of the zone found on each bar. Traders who work from imbalance rather than lines will recognise the layout.

This build ships as luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.ex4 for MT4 and luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 2: DemandMid, SupplyMid
Alerts popup, push notification, email, sound
Inputs 13

What the Luxalgo Supply And Demand Indicator draws on the chart

Rectangles carry the whole picture. A demand zone appears when the low of a bar sits above the high from two bars earlier. That leaves an untraded gap between them, and the tool boxes it in dodger blue. A supply zone uses the mirror gap and draws in crimson.

Every box runs forward, not just across its own bars. ExtendBars pushes the right edge 60 bars past the newest candle. Each pass refreshes that edge, so a zone keeps pace with price. OutlineWidth sets how thick the border draws, while the fill stays off.

Two buffers stay invisible on purpose. DemandMid and SupplyMid publish the midpoint of the zone found on that bar as hidden plots. Read them in the data window or from another tool, because nothing of them appears on the chart itself.

  • DemandMid: hidden buffer, dodger blue
  • SupplyMid: hidden buffer, crimson
Luxalgo Supply And Demand Indicator on EURUSD H1 with blue demand boxes and crimson supply boxes.
Luxalgo Supply And Demand Indicator on EURUSD H1 with blue demand boxes and crimson supply boxes.

How the Luxalgo Supply And Demand Indicator calculates its values

The three-bar gap test

Detection needs only three candles. The code compares the current bar against the bar two places back. When the current low sits above that older high, the space between them never traded, and a demand zone opens. The bearish case flips the comparison and opens a supply zone.

Zone geometry and the midpoint

Boundaries come straight from the gap. A demand box runs from the current low down to the older high, so its edges mark the untraded band exactly. The midpoint of those two prices goes into DemandMid for that bar. SupplyMid carries the same figure for bearish gaps.

Housekeeping and the cap

Zone counts need a limit. MaxZones holds the visible set at 40 rectangles and deletes the oldest whenever a new gap forms. ObjectPrefix labels every rectangle the tool owns, which keeps the cleanup away from your own drawings. LookbackBars sits in the inputs at 500, though the scan itself walks forward from the last calculated bar.

How to read the signals

Blue boxes below price mark demand. A pullback into one gives buyers a reference where an earlier move left orders behind. Watch how price behaves inside the band rather than at a single line.

Crimson boxes above price mark supply. Rallies that stall inside one suggest sellers still sit there. A candle that closes cleanly through the box takes most of that meaning away.

Freshness beats size. The newest few zones tend to matter most, and older boxes survive only because the cap has not reached them yet. Scan the chart for zones price already ran through.

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

EnableAlerts fronts the block, with popup, push notification, email and sound each on its own switch. A gap on the newest bar sends one message, and the guard stops it repeating on later ticks.

Every Luxalgo Supply And Demand Indicator input

Core settings

Setting What it does Default
LookbackBars bars to scan for FVG zones. Ships at 500 in the inputs, though this build scans forward from the last calculated bar rather than a fixed depth. 500
MaxZones maximum zones kept on chart. Caps the drawn set at 40 rectangles and drops the oldest first; lower it on a crowded chart. 40
ExtendBars bars to project the rectangle into the future. Projects each zone 60 bars to the right so you can follow price back into it. 60
ObjectPrefix Names every rectangle the tool creates so the cleanup routine leaves your own objects alone. LUXSD_

Display settings

Setting What it does Default
DemandColor Colours the bullish gap boxes, dodger blue out of the box. dodger blue
SupplyColor Colours the bearish gap boxes in crimson. crimson
OutlineWidth Sets the border thickness of each box, while the fill stays off so candles remain visible. 2

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
luxalgo supply and demand indicator: Inputs panel showing MaxZones, ExtendBars and OutlineWidth for the zone drawing.
Inputs panel showing MaxZones, ExtendBars and OutlineWidth for the zone drawing.

Settings that fit your chart

Gap-based zones need instruments that move in impulses. EURUSD H1 sits behind the screenshots and produces a handful of clean gaps in a normal week. Indices and gold jump more often, which fills the chart faster and makes the MaxZones cap matter. On M1 nearly every burst leaves a small gap, so the picture turns busy. H4 and D1 produce fewer zones, and those tend to hold attention for longer.

When the Luxalgo Supply And Demand Indicator fails

Gaps are not order blocks. A three-bar imbalance shows where price moved fast, which often overlaps with heavy institutional activity but never proves it.

Zones never expire here. The build does not test whether price already filled a gap, so a box can sit on the chart long after the market traded straight through it.

Five-digit noise creates tiny zones. On low timeframes a one-point gap draws the same rectangle as a fifty-point one, and the cap then discards genuinely useful zones.

The two published buffers draw nothing. DemandMid and SupplyMid exist for the data window and for other tools, so a trader expecting a visible midline will not find one.

Copy luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.ex4 into MQL4/Indicators and luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.ex5 into MQL5/Indicators, then restart the terminal and drag the Luxalgo Supply And Demand Indicator 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.

Download the Luxalgo Supply And Demand Indicator for MT4 and MT5

The zip luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.zip holds luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.ex4, luxalgo-supply-and-demand-indicator-indicator-forexmt4systems.ex5 and a short README, compiled files only. 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

What counts as a demand zone in this build?

A three-bar gap does. When the low of the current candle sits above the high recorded two bars earlier, the band between them never traded. The tool treats that untraded band as demand and draws a dodger blue rectangle across it. Supply uses the exact mirror.

Why do DemandMid and SupplyMid show nothing on the chart?

Both plots declare a hidden draw type on purpose. They publish the midpoint of the zone found on that bar, so other tools and the data window can read it. The visible layer stays the rectangle set instead. Nothing goes missing, and no setting turns the two buffers into lines.

How many zones does MaxZones keep on screen?

Forty by default. Each time a new gap forms, the tool counts its own rectangles and deletes the oldest until the total fits. That keeps the chart readable on instruments that jump often. Lower the number for a cleaner screen, or raise it when you like tracking older imbalances.

Does a supply zone disappear once price fills the gap?

No. This build never checks whether price traded back through a box, so a filled zone stays on the chart until the cap removes it. Judge each rectangle by eye before you use it. Many traders mark the ones price has already cleared and ignore them afterwards.

Are results guaranteed?

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

Category: this is part of our Trend collection. Also, 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