DeMark Trend Lines Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Tom DeMark’s complaint about trend lines was that two people draw two different ones. His answer was a rule: start from the most recent qualifying pivot and work backwards. The demark trend lines indicator applies exactly that, which means the same chart always produces the same lines.

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: TD Buy, TD Sell
Alerts popup
Inputs 5

Drawn output, plot by plot

Two marks on price plus the lines themselves.

`TD Buy` prints lime using arrow 233.

`TD Sell` prints red using arrow 234.

A supply line joins two qualifying highs.

A demand line joins two qualifying lows.

Objects carry the `InpObjPrefix` `”FMTS_TDLINE_”` prefix.

  • TD Buy: arrow, lime, width 2, arrow code 233
  • TD Sell: arrow, red, width 2, arrow code 234
demark trend lines indicator: A rule-drawn line with a confirmed break, EURUSD H1.
A rule-drawn line with a confirmed break, EURUSD H1.

The mechanism

Finding the pivots

`InpPivotBars` `5` bars either side must fail to beat a candidate. Five is a wide rule, so the anchors describe real turns rather than small wobbles.

Working right to left

The most recent qualifying pivot is the first anchor and the one before it is the second. That ordering is the whole DeMark contribution, and it removes the choice entirely.

Confirming a break

`InpBreakBufferPt` `5.0` is the extra distance required. Price must clear the line by that much, which discards the touches that merely graze it.

Reading day to day

Both lines redraw whenever a new pivot qualifies.

A supply line usually slopes down over a falling market.

A demand line usually slopes up under a rising one.

`InpLookbackBars` `400` bounds the search.

Five points is a deliberately small buffer.

Every pivot confirms five bars late.

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

`InpEnableAlerts` `true` raises a terminal message when price clears a line by the required buffer on a closed bar. The terminal is the only destination this build offers, with no handset, mail or audio route in the panel.

Every DeMark Trend Lines Indicator input

Core settings

Setting What it does Default
InpPivotBars bars on each side for pivot detection. Bars either side defining a pivot, `5`. 5
InpLookbackBars bars to scan for swing points. History the scan covers, `400`. 400
InpBreakBufferPt extra points beyond TD line to confirm break. Extra points a break must clear, `5.0`. 5.0
InpObjPrefix Prefix on every object name, `”FMTS_TDLINE_”`. FMTS_TDLINE_

Alert settings

Setting What it does Default
InpEnableAlerts Speak when a line breaks, `true`. on
demark trend lines indicator: Inputs panel, all five settings at once.
Inputs panel, all five settings at once.

Where it earns its keep

A five-bar pivot rule across four hundred bars needs swings with size. EURUSD H1 is the reference chart, covering about seventeen days. On M5 the lines redraw constantly. On H4 the same scan spans most of a quarter.

Where it disappoints

The lines move whenever a newer pivot qualifies.

A rule-based line is still only two points.

Five points of buffer is small on a fast symbol.

Every anchor confirms five bars after it printed.

Copy the compiled DeMark Trend Lines 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 DeMark Trend Lines Indicator: Trend line (technical analysis) on Wikipedia, Trendline at Investopedia.

Download the DeMark Trend Lines Indicator for MT4 and MT5

The zip holds the compiled DeMark Trend Lines 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 DeMark work right to left?

Because the most recent structure is what price is trading against now. Starting from the newest qualifying pivot and reaching back removes the judgement call that makes two traders draw two different lines.

What does InpBreakBufferPt 5.0 filter out?

Touches that barely cross. Requiring five extra points beyond the line means a bar grazing it produces nothing, which is a small filter but enough to discard the most marginal breaks.

How wide is the InpPivotBars 5 rule?

Eleven bars in total, five on each side plus the candidate. That is considerably stricter than the common three-bar fractal, so the anchors are genuinely significant turns rather than minor ones.

Do the lines stay put once drawn?

No. Each redraws as soon as a newer pivot qualifies, which is a property of the rule rather than a fault. The line you see always reflects the two most recent qualifying turns.

Are results guaranteed?

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

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