ADX Wilder
MetaTrader 5 ships two ADXs. iADXWilder uses Wilder's own smoothing and divides after smoothing; iADX uses an EMA and divides before it. At the same period of 14 the two lines differ by about 10 points, and the familiar 'ADX above 25' filter fires roughly twice as often on one as on the other.
- Default
- 14
- Trend threshold
- 25 (convention)
- vs iADX at 14
- ≈ 10 points apart
Ilustrativo — dados sintéticos, não uma cotação em tempo real.
What ADX Wilder tells you
ADX Wilder measures how much of a market's movement is going one way, without saying which way. It compares how far today's high exceeded yesterday's against how far today's low fell below yesterday's, smooths both, expresses them as a share of the average true range, and then measures the gap between them. A large gap means one side is doing most of the work; a small gap means the market is going nowhere in particular. The important thing on this page is not that definition — the ADX page has the same one — but that MetaTrader implements it twice. iADXWilder smooths the way Wilder did, with 1/N, and divides by ATR after smoothing. iADX smooths with an EMA at 2/(N+1) and divides each bar by its own true range before smoothing. Measured on three synthetic series at the same period of 14, the two main lines differ by 9.7 to 10.2 points on average, and iADX reads higher essentially all the time.
- A built-in, but not the built-in — iADX is a different function with different output
- It reads about 10 points lower than iADX at the same period
- So a fixed threshold like 25 is not portable between the two
- 1 Directional movement: +DM and −DM from today's high and low against yesterday's
- 2 Smooth both, and true range, with Wilder's 1/N — then divide to get +DI and −DI
- 3 Smooth the normalised gap between them; that is ADX
Mostrar a fórmula e detalhes de cálculo
MetaTrader 5 ships this indicator twice, so the calculation below is worth reading against the one on the ADX page. Both sources are bundled with the terminal, under Indicators/Examples.
The directional movement is chosen identically in both:
up = high[i] - high[i-1], dn = low[i-1] - low[i]
clip both at zero; keep only the larger; if equal, both become zero
tr = max(|high-low|, |high-prevClose|, |low-prevClose|)
From here they part. ADXW.mq5 (this page) smooths first and divides afterwards:
atr = SmoothedMA(tr), pds = SmoothedMA(+DM), nds = SmoothedMA(-DM)
+DI = 100 * pds / atr
-DI = 100 * nds / atr
DX = 100 * |+DI - -DI| / (+DI + -DI)
ADX = SmoothedMA(DX)
SmoothedMA(price, prev, N) = (prev*(N-1) + price) / N <- weight 1/N
ADX.mq5 divides each bar first and smooths the percentages:
pd = 100 * (+DM) / tr, nd = 100 * (-DM) / tr <- per bar, before smoothing
+DI = ExponentialMA(pd), -DI = ExponentialMA(nd)
ADX = ExponentialMA(DX)
ExponentialMA(price, prev, N) = price*2/(N+1) + prev*(1 - 2/(N+1)) <- weight 2/(N+1)
At period 14 the weights are 1/14 = 0.0714 and 2/15 = 0.1333. Measured over 2,700 bars on each of three synthetic series, the two main lines are 9.93, 10.19 and 9.66 points apart on average, with iADX higher throughout (34.67, 34.51, 37.20 against 26.74, 26.24, 31.20).
Splitting the causes apart by swapping one factor at a time:
smoothing only (same order): 9.96 / 10.30 / 9.36 points
order only (same smoothing): 3.96 / 4.07 / 4.38 points
both (the real difference): 9.93 / 10.19 / 9.66 points
So the smoothing constant is about two and a half times the larger effect, and the order is not negligible. Solving 2/(N+1) = 1/14 predicts that iADX at 27 should match this at 14 — but sweeping the period, the closest was 26 (mean difference 3.90, against 3.96 at 27), and the difference bottoms out around 3.9 rather than at zero. That floor is the normalisation order; no period removes it.
The consequence lands on the threshold rather than on the line. Counting upward crossings of 25 over the same window:
iADX(14) ADXW(14) paired, mean lag iADX-only
walk-low 497 250 13.5 bars 276
walk-high 458 258 12.6 bars 248
trending 385 213 12.5 bars 210
Wilder’s smoothing is also slower to forget where it started. Recomputing from a truncated history and comparing the final value with a full-history baseline: 50 bars was off by 5.53 points, 100 by 0.35, 200 by 0.0003, and 300 matched exactly — while iADX was inside 0.0002 by 100 bars.
This page exists because two functions share a name and not a formula. It is not the only place that happens: the Detrended Price Oscillator that ships with MetaTrader shortens its moving average instead of shifting the price, where the textbook does the opposite. Measured, those two correlate at −0.44 — worse than a disagreement about smoothing, since the current price moves them in opposite directions. In both cases the name on the indicator does not tell you which formula is running.
Sinais
Os sinais distintos e testáveis que ADXW oferece — e o regime adequado para cada um.
Strength Gate
Pronto no BuilderDI Cross with a Strength Gate
Pronto no BuilderRising ADX with a falling price
Interpretação manualImplementação no MT5
O que o MetaTrader 5 realmente calcula e desenha — a referência para cada regra desta página.
Buffers
| Índice | Buffer | Desenhado no MT5 como | O que contém |
|---|---|---|---|
| 0 | MAIN_LINE | Line | ADX itself — how strongly price is moving in one direction, 0–100, with no sign. It is the smoothed DX, and the smoothing here is Wilder's: each new bar contributes 1/N. That is roughly half the weight iADX gives it, which is why this line is slower and, measured on synthetic series, sits about 10 points lower on average. |
| 1 | PLUSDI_LINE | Line | +DI — smoothed upward directional movement as a percentage of smoothed true range. Note the order: the smoothing happens first and the division by ATR second. iADX divides each bar by that bar's true range before smoothing, which is why its +DI is a different series rather than the same one shifted. |
| 2 | MINUSDI_LINE | Line | −DI — the mirror of +DI for downward movement. The cross of +DI and −DI is the entry in Wilder's original system, and it is what this page's template trades. |
Notas da plataforma
Funciona melhor / use com cuidado
Nenhum indicador tem vantagem universal. Veja onde ADXW ajuda — e onde ele engana.
Funciona melhor
- As a gate on a rule that already has a direction
- Higher timeframes, where 1/N smoothing is not too slow to be usable
- Strategies ported from Wilder's own writing, where 1/N is what was meant
- Thresholds you have measured on this line rather than borrowed from iADX
Use com cuidado
- Reusing a 25 threshold tuned on iADX — measured, that fires about twice as often
- Assuming the period means the same thing in both; 1/14 and 2/15 are not the same weight
- Trading the DI cross bare, without the strength gate
- Comparing charts across platforms without checking which ADX is drawn
Criar uma estratégia ADXW
Conecte o sinal às regras de entrada e saída, depois exporte um EA MT5 compilável — sem código.
- Three ADX Wilder nodes at 14 — +DI, −DI and the main line, all on the last closed bar
- +DI crossed against −DI, once upward and once downward
- The main line compared against 25, feeding both sides
- Cross up and above 25 → Close short, then Open Buy · SL 60 / TP 180
- Cross down and above 25 → Close long, then Open Sell, mirrored
Combinar ADXW com outros indicadores
Um indicador raramente funciona sozinho. Essas combinações cobrem os pontos cegos do ADXW.
ADXW + ADX
- ADX Wilder main line
- Compare against 25
No template holds both, and there is rarely a reason to. Pick the one your threshold was measured on.
Abrir o Builder →ADXW + ATR
- ADX Wilder above 25
- ATR
- And gate
Add an ATR node beside the ADX Wilder nodes and gate the entry on both.
Abrir o Builder →ADXW + Parabolic SAR
- ADX Wilder above 25
- Parabolic SAR flip
- And gate
Add a Parabolic SAR node and compare it against price, gated by the ADX Wilder main line.
Abrir o Builder →Parâmetros
Valores iniciais para validar no seu próprio par e timeframe — não são configurações garantidas.
| Parâmetro | Padrão | Faixa de teste sugerida | O que faz |
|---|---|---|---|
| Period | 14 | 1–999 | The Wilder smoothing length, used for true range, for both directional movements and for the final DX smoothing. Here it means a weight of 1/14 per bar. On iADX the same number means 2/15, so the two are not interchangeable: measured, the iADX period that comes closest to this one is 26, not 14 — and even there about 3.9 points of difference remain, because the smoothing constant is only half of what separates them. |
| Line | Main | Main / +DI / −DI | Which of the three buffers this node publishes. Main is the strength with no sign, +DI and −DI are the two sides whose cross is the entry. One node emits one line, so the template uses three of them; they share a handle in the terminal, so the cost is not three indicators. |
| Shift | 1 | 0–100 | Which bar the node reports. The template uses 1 so decisions are made on a closed bar. With shift 0 the DI cross can appear and disappear within the same bar, which is the usual way a backtest and a live account stop agreeing. |
| Timeframe | Current | Current / M1–MN1 | Which series the handle is created on. Wilder's smoothing is slow — measured, it needs about 200 bars before the value stops depending on where the calculation started, against roughly 100 for iADX — so on a low timeframe the first part of any session is warm-up rather than signal. |
Predefinições iniciais
Exemplos de mercado
Onde ADXW funciona, onde falha e como um filtro muda o resultado.
The DI cross inside a strong trend
+DI crosses above −DI while the main line is already above 25 and rising. The strength gate is doing its job here: the same cross earlier in the range would have been refused.
The DI cross while the market goes nowhere
The two DI lines cross repeatedly around each other with the main line under 25. This is the case the gate exists for, and it is also where the choice of ADX matters most — the iADX line would already be above the threshold here.
The crossing that only the other ADX would have taken
The main line approaches 25 without reaching it, while iADX at the same period is comfortably above. Measured, about half of the iADX crossings of 25 have no counterpart on this line at all.
Indicadores relacionados
FAQ
- Is ADX Wilder a built-in MetaTrader 5 indicator?
- Yes — iADXWilder, alongside iADX. Both are built in, both return a handle to three buffers (main, +DI, −DI), and neither takes an applied price. The Builder's node creates one handle and reads whichever buffer you select.
- What is the difference between ADX and ADX Wilder?
- Two things, both visible in the bundled sources. The smoothing: this one uses Wilder's 1/N, iADX uses an EMA at 2/(N+1). And the order of operations: this one smooths true range and directional movement and then divides, iADX divides each bar first and smooths the percentages. Measured at period 14 the lines are 9.7 to 10.2 points apart, with iADX higher.
- Which one should I use?
- Whichever your threshold was measured on. If you are following Wilder's own description — the DMI system, the 25 level, the pairing with Parabolic SAR — this one is the faithful implementation. If you tuned a number on a chart drawn with iADX, keep using iADX. The mistake is mixing them, because the trade count roughly doubles or halves without any error appearing.
- Can I just change the period to make them match?
- Not exactly. Solving 2/(N+1) = 1/14 suggests iADX at 27, and measurement puts the closest match at 26 — but about 3.9 points of difference remain at the best setting. The smoothing constant accounts for roughly 10 points of the gap and the normalisation order for about 4, and no period can absorb the second part.
- Why does it read lower than ADX?
- Both effects push the same way. Dividing each bar's directional movement by that bar's true range, as iADX does, lets quiet bars contribute large percentages before any averaging happens, which lifts the DI values and with them the gap the main line measures. And the faster EMA lets those spikes through more readily. Measured averages were 34.5–37.2 for iADX against 26.2–31.2 here.
- How long is the warm-up?
- About 200 bars. Recomputing from a truncated history and comparing the last value with a full-history baseline: 50 bars was off by 5.53 points, 100 bars by 0.35, 200 bars by 0.0003, and 300 bars matched exactly. iADX converges roughly twice as fast because its smoothing is roughly twice as fast.
- Does the DI cross happen at the same time on both?
- No. +DI and −DI differ by 3.4 to 5.0 points on average between the two implementations, and although a cross is a comparison between them — so some of the difference cancels — the crossings still land on different bars. The main line's crossings of 25, which are easier to count, paired up an average of 12.5 to 13.5 bars apart.
- Can I build this without coding?
- Yes. The template is three ADX Wilder nodes at period 14 — one on +DI, one on −DI, one on the main line — two Cross nodes for the DI crossings, one Compare against 25 feeding both sides, two And gates, two Close nodes wired ahead of the entries, and Open Buy / Open Sell on a fixed lot. The period and the threshold are set in the Builder; the compiled EA exposes the stop distances, lot size and maximum spread as inputs.
Artigos relacionados
Glossary