When Welles Wilder created his ADX indicator (and the Directional Movement idea) he was doing all the math by hand. You can still see the worksheets he used in his book. His way to make the Average of some numbers was just to take yesterday’s value, divide it by the period, multiply this number times period minus 1 and add today’s value divided the period. Over time this became the Wilder’s average. Since he used normally a 14-period average he was making only 4 operations instead of 15 …. and that was a lot of time saved!!
Needless to say that his average was not the most precise (I could write a lot more on averages) but it was the quickest to calculate and good enough to make his indicators to work fine.
Today with the help of computers we can get much more. I wrote the directional movement code with the possibility to change the type of moving average used. I personally use a weighted moving average and the performance of Wilder’s indicator is, in my opinion and experience, much better.
//computation of Directional Movement indicators
if up>dw and up>=0 then
if dw>up and dw>=0 then
//computation of TR
//computation of DI
//computation of ADX e ADXR
//return of data
return dip coloured (0,205,0) as "DI+", dim coloured (205,0,0) as"DI-", miodi style (histogram) as "DI",mioadx as "ADX", mioadxr coloured (204,0,204) as "ADXR",0
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :