Skip to content

Free MT5 indicator

ADX Trend Strength

Wilder ADX histogram for MT5 coloured by trend strength and direction, with DI+ and DI- lines and filtered DI cross arrows.

Trendv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

What it does

ADX Trend Strength turns J. Welles Wilder's Average Directional Index into a colour histogram, so you can see at a glance whether the market is trending and in which direction. DI+ and DI− lines are drawn on top, and arrows mark DI crossovers that happen while ADX shows at least a developing trend.

The histogram uses five colours: grey for weak or no trend, light green or light red for a developing trend, and strong green or strong red for a strong trend.

How it works

The ADX, DI+ and DI− values come from MetaTrader's built-in Wilder ADX:

  1. +DM is the part of today's high above yesterday's high, and −DM is the part of today's low below yesterday's low; only the larger of the two counts on each bar.
  2. +DM, −DM and true range are smoothed with Wilder's method over 14 bars. DI+ = 100 × smoothed +DM ÷ smoothed TR, and DI− likewise.
  3. DX = 100 × |DI+ − DI−| ÷ (DI+ + DI−), and ADX is DX smoothed again over 14 bars.

Colouring rules for each bar:

  • ADX below 20: grey.
  • ADX from 20 up to 25: light green if DI+ is at or above DI−, otherwise light red.
  • ADX at or above 25: strong green or strong red by the same DI comparison.

A bullish arrow marks a closed bar where DI+ crosses above DI−; a bearish arrow marks DI− crossing above DI+. With the filter on, crosses while ADX is below 20 are ignored.

How to use it

  • ADX measures strength, not direction. A rising ADX in red means a strengthening downtrend, not a bullish signal.
  • Many traders use grey periods to switch to range tactics or to stand aside, and the strong colours to favour trend-following entries.
  • A DI cross with ADX already rising through the weak level is a stronger trend start than a cross with ADX falling.
  • A falling ADX from high levels often signals that a trend is maturing or pausing, even if DI lines have not crossed.
  • It combines well with a trend tool on the price chart, such as moving averages or a trailing stop.

Settings

InputDefaultWhat it changes
ADX / DI length14Smoothing of all three lines; lower reacts faster
Weak level20Threshold for grey bars and for the cross filter
Strong level25Threshold for the strong colours
DI cross arrows only when ADX >= weak leveltrueTurn off to see every DI cross
Pop-up alert / Push notificationfalse / falseOne alert per closed bar on a new DI cross

Limitations

  • ADX is double-smoothed and therefore slow. It often confirms a trend well after it began.
  • DI lines cross frequently in choppy markets; the ADX filter reduces but does not remove false crosses.
  • The 20 and 25 levels are conventions, and suitable values differ between instruments and timeframes.
  • Values on the live bar update with each tick; arrows and alerts are confirmed on the bar close.
  • Educational tool only. Trading carries substantial risk of loss, so test any approach on a demo account first.

Key inputs

Key inputs of ADX Trend Strength
InputDefaultDescription
ADX / DI length (Wilder smoothing)14Period for the directional movement and ADX calculation.
Weak level20Below this ADX value the histogram is grey (no meaningful trend).
Strong level25At or above this ADX value the histogram uses the strong colours.
DI cross arrows only when ADX >= weak leveltrueHides DI crosses that happen in trendless conditions.
Pop-up alert on new DI crossfalseAlerts once when a closed bar confirms a DI cross.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators