Directional movement index

dmitrendForge API 1

Trend direction as two lines, with the strength of the trend.

Inputs

NameTypeDefaultRange
periodint141 to 500
methodchoicemt5

Outputs

NameTypeRequiredDescription
plus_divalueOptionalcolor theme.up, style line, width 1
minus_divalueOptionalcolor theme.down, style line, width 1
adxvalueOptionalcolor theme.accent, style line, width 1
Warm-up
pick(method, {'mt5': period, 'wilder': 2 * period - 1}) bars (14 at the defaults)
Repaints
No
Parity
MetaTrader 5, within 1e-12

Formula

TR = the true range, +DM and -DM = the larger of the two directional moves, the other is 0

+DI = 100 * smoothed(+DM) / smoothed(TR), -DI = 100 * smoothed(-DM) / smoothed(TR)

DX = 100 * |+DI - -DI| / (+DI + -DI), ADX = smoothed(DX)

mt5: smoothing with 2 / (period + 1), starting from zero. wilder: smoothing with 1 / period, starting from the mean of the first period values. Where the true range is zero the lines read 0.