DMI - "Directional Movement Index"
DMI is an indicator which determines the rate of price change, if an instrument is moving in a trend.
Parameters:
- N - averaging period
Calculation:
- First the positive and the negative derectional movement is calculated - +DMj and -DMj
if Highj > Highj-1, then +DMj = Highj - Highj-1, otherwise +DMj = 0
if Lowj < Lowj-1, then -DMj = Lowj-1 - Lowj, otherwise -DMj = 0
The lesser of +DMj and -DMj is set to zero; if they are equal, both are set to zero.
- True range is calculated - TRj
TRj = max( |Lowj - Closej-1|, |Highj - Closej-1|, |Highj - Lowj| )
- A positive and negative directional index is calculated - + and -DIj
if TRj = 0, then +SDIj = 0,
-SDIj = 0,
if TRj ≠ 0, then +SDIj = +DMj / TRj; -SDIj = -DMj / TRj
By smoothing +SDI and -SDI with exponential moving average (EMAve), get
+DIj and -DIj
+DIj = EMAvej(+SDI, N) -DIj = EMAvej(-SDI, N)
- Calculate average directional movement - ADXj. First calculate directional movement DXj:
DXj = (|+DIj - -DIj| / |+DIj + -DIj|) × 100
By averaging DX find ADX:
ADXj = EMAvej(DX, N)
|