DMI

Directional Movement Index
Description
The Directional movement system is a system for providing trading signals to be used for price breaks from a trading range. The system involves 5 indicators which are the Directional Movement Index (DX), the plus Directional Indicator (+DI), the minus Directional Indicator (-DI), the average Directional Movement (ADX) and the Directional movement rating (ADXR). The system was developed J. Welles Wilder and is explained thoroughly in his book, New Concepts in Technical Trading Systems . The basic Directional Movement Trading system involves plotting the 14 period +DI and the 14 period -DI on top of each other. When the +DI rises above the -DI, it is a bullish signal. A bearish signal occurs when the +DI falls below the -DI. To avoid whipsaws, Wilder identifies a trigger point to be the extreme price on the day the lines cross. If you have received a buy signal, you would wait for the security to rise above the extreme price (the high price on the day the lines crossed). If you are waiting for a sell signal the extreme point is then defined as the low price on the days the lines cross.
Category
Directional Movement Index
Parameters
N ( Default: 14 Min: 2 Max: 100 )
Chart Script

HiDiff := H - Ref(H, 1);
LoDiff := Ref(L, 1) - L;
PlusDM := IF((HiDiff > LoDiff) & (HiDiff > 0), HiDiff, 0);
MinusDM := IF((LoDiff > HiDiff) & (LoDiff > 0), LoDiff, 0);
LC := Ref(C, 1);
TR := MAX((H - L), ABS(LC - H), ABS(LC - L));
ATR := WMA(TR, N);
PlusDI : 100 * WMA(PlusDM, N) / ATR;
MinusDI : 100 * WMA(MinusDM, N) / ATR;
@SetName(PlusDI,'+DI');
@SetName(MinusDI,'-DI');
DX := IF((PlusDI + MinusDI) > 0, 100 * ABS((PlusDI - MinusDI) / (PlusDI + MinusDI)), 0);
ADX : WMA(DX, N),Width2;