Not whether to buy or sell, but whether the market is worth trading right now.
What is the ADX indicator?
Measures the STRENGTH of a trend regardless of direction — the indicator for deciding whether to trade at all.
What is Average Directional Index?
Measures trend strength (regardless of direction) with the +DI and −DI lines showing which side controls the market.
Illustrative signals of the rule on simulated data — not a trading recommendation.
Rule: ADX(14) above 25 and +DI crosses above −DI: buy; crosses below: sell. Entry = close of the signal candle; SL = entry ∓ 1.5 × ATR(14); TP1/TP2/TP3 = 1R/2R/3R.
Where this indicator is strong
Three reasons Average Directional Index is still used after decades.
Put in front of a trend system, it removes most sideways phases.
The +DI and −DI lines show which side has the upper hand.
How to read Average Directional Index signals
How Average Directional Index (ADX) produces its number, and what each shape on the chart means.
Formula and how it works
+DI and −DI are calculated from directional movement (+DM, −DM) and the True Range, smoothed with Wilder's method. DX = 100 × |+DI − −DI| / (+DI + −DI); ADX is the smoothed average of DX. ADX above 25 usually shows a trend strong enough to trade in its direction.
Use ADX as a filter: only follow the trend when ADX > 25; +DI crossing above −DI suggests buying, the reverse suggests selling. A low ADX warns of a sideways market.
As a gate for another system, placed before the entry decision.
Using it alone to find entries. ADX is a lagging indicator that does not show direction, so it cannot produce a complete signal on its own.
Reading a high ADX as a rising market. ADX only says the trend is strong — which direction it is strong in comes from +DI and −DI.
Recommended MT5 parameters for Average Directional Index
Default values of the sample file; test them for your market and timeframe.
| Parameter | Description |
|---|---|
| InpPeriod | Wilder smoothing period for DI and ADX (default 14). |
Put the indicator into MetaTrader 5
Four steps, no software needed besides MT5.
Click the download button above; the file saves to your computer under the indicator's name.
In MetaTrader 5 choose File → Open Data Folder, then go to MQL5/Indicators.
Open the file in MetaEditor and click Compile. No errors means the indicator is ready.
Go back to MT5, refresh the Navigator and drag the indicator onto the price chart.
DinexSpace wrote this file from the indicator's public formula, not from any commercial source. You are free to edit and reuse it.
How it differs from MetaTrader 5's built-in indicator
The short answer: the formula is not different. What differs is what you can do with it.
Average Directional Index here gives exactly the same number as MetaTrader 5's built-in version — on purpose. The four points below are what differs, and all four can be read from the very adx.mq5 you download.
- Calls a built-in indicator
- No — the calculation sits in
OnCalculateand can be copied straight into an EA - External libraries
- Not a single #import declaration
- Code length
- 82 lines · 1
inputparameters - How it draws
- A separate window below the price chart · calculated incrementally, does not redraw the past
Why this library promises no secret formula — read the full explanation on the library page.
Which indicators to pair Average Directional Index with, and what you gain
Each indicator only answers one question. Pairing well means covering the right weakness, not stacking more.
- What you gain
- A two-tier system: ADX decides whether the system is switched on, the MA decides the direction.
- Note
- This is ADX's most common pairing and also the one truest to what it is.
- What you gain
- Switch systems by market state. With a high ADX run a trend system; with a low ADX switch to an oscillator system.
- Note
- You need a clear numerical switching rule; otherwise it becomes switching systems on a feeling after every losing trade.
- What you gain
- Cuts noisy crossovers. MACD produces many signals, ADX keeps the ones that fall in phases with momentum.
- Note
- Both are lagging, so this pair enters late and accepts missing the start of the trend.
Frequently asked questions about Average Directional Index
What ADX level means a strong trend?
Above 25 is usually considered a strong enough trend, below 20 sideways. These are common conventions, not constants: each currency pair and timeframe has a different baseline, so observe it on the market you actually trade.
Does a rising ADX mean price will rise?
No. ADX only measures the STRENGTH of the trend, not its direction. A rising ADX in a downtrend means price is falling harder. To know the direction, look at the +DI and -DI lines.
Does Average Directional Index on this page use real or simulated data?
The chart on this page uses a deterministic simulated candle series; it is not market prices or trading results.
Using Average Directional Index in an EA, and further reading
State the candle-close condition, parameters and server time clearly when you put the rule into an EA. See the EAs available on the marketplace to compare options, or read how to read MT5 backtest results before judging any EA.
Other trend indicators
Indicators in the same trend group, often used instead of or alongside Average Directional Index.
An indicator draws signals, but when to enter, where to stop out and how much to risk are still your set of rules. Send those rules and DinexSpace builds them into an EA.