ADX Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Wilder split trend measurement into two halves, and the adx indicator keeps them apart. One line rates how forceful the move has been. Two more decide which side produced it. Reading them together is the point, because either half alone will mislead you.

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 Separate window (levels 25)
Plots 3: ADX, +DI, -DI
Alerts popup, push notification, email, sound
Inputs 8

What the ADX Indicator draws on the chart

Three lines below the price chart.

`ADX` runs goldenrod at width 3.

`+DI` runs lime green at width 1.

`-DI` runs crimson at the same width.

A level marks twenty-five.

Values never fall below zero.

  • ADX: line, goldenrod, width 3
  • +DI: line, lime green, width 1
  • -DI: line, crimson, width 1
adx indicator: Strength and both directional lines on the EURUSD H1 chart.
Strength and both directional lines on the EURUSD H1 chart.

How the ADX Indicator calculates its values

Where the numbers come from

iADX returns all three. `AdxPeriod` `14` is the window. Three modes pull the main reading and each directional line out of a single call.

Directional movement

Wilder compared bar edges. How much a high extends past the last one feeds the upward side. How much a low extends below feeds the downward one.

Strength from the gap

The main reading comes from the spread between them. A wide gap smoothed over the window gives a high value. Neither direction makes it rise more than the other.

How to read the signals

Goldenrod is strength and carries no direction.

So the two thin lines decide the side.

Lime green on top means upward movement dominated.

Crimson on top means the other way instead.

Meanwhile rising goldenrod under twenty-five is a move getting going.

But falling goldenrod over forty is a move running out.

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

`EnableAlerts` governs the directional-cross alerts and starts true with `EnablePopup`. Set `EnablePushNotify` for a phone, `EnableEmail` for mail, or `EnableSound` to sound `SoundFile`. Those three begin off.

Every ADX Indicator input

Core settings

Setting What it does Default
AdxPeriod Bars in the window, `14`. 14
TrendLevel Where the level sits, `25`. 25

Alert settings

Setting What it does Default
EnableAlerts Master switch, `true`. on
EnablePopup Box in the terminal, `true`. on
EnablePushNotify Buzz on a phone, `false`. off
EnableEmail Mail on a cross, `false`. off
EnableSound Cue on a cross, `false`. off
SoundFile Which clip plays, `”alert.wav”`. alert.wav
adx indicator: Inputs panel with AdxPeriod and the alert routes.
Inputs panel with AdxPeriod and the alert routes.

Settings that fit your chart

Fourteen bars with Wilder smoothing behaves the same on any liquid market. EURUSD H1 is the reference chart. Fourteen bars covers most of a session there. On M5 the reading spends its day under the level. On daily bars it tracks a whole trend.

When the ADX Indicator fails

Smoothing means the strength line turns late.

Also a high reading says nothing about which way.

In a range the two thin lines cross often.

Worse, the reading can stay high through a whole retracement.

Copy the compiled ADX 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 ADX Indicator: Trend following trading on Wikipedia, Slope Performance Trend at StockCharts ChartSchool.

Download the ADX Indicator for MT4 and MT5

The zip holds the compiled ADX 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 the ADX line say which way price moved?

No, and that is the most common misreading. It rates force alone. A market falling hard and a market rising hard produce the same high value, which is why the two directional lines exist beside it.

What separates the +DI and -DI plots?

Which side of the bar extended. Highs pushing past the previous high feed the upward line, lows pushing below feed the downward one. Whichever is larger tells you who did more work in that window.

What does TrendLevel 25 mark?

The point Wilder treated as the start of a trending market. Under it, the strength reading says the move lacks force, whatever the two directional lines happen to be doing.

Why does AdxPeriod 14 need extra warm-up?

Because the smoothing runs twice, once on directional movement and once on the result. The build skips roughly twice the window before writing values, so early bars stay empty on a short history.

Are results guaranteed?

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

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