Here is a variation of my favorite indicator.
code based on Gabri ADX:
- the regular ADX (smoothed)
- A non smoothed ADX (ie almost no lag): the idea is to use it as a cycle oscillator to confirm the strength of the trend when the regular ADX and the non smoothed ADX goes the same way (ie cycle convergence).
- The non smoothed ADX is faster than the regular ADX : it will show each change in the strength way before the regular ADX.
- OB and OS level of the non smoothed ADX can also be useful…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
period=14 mm=3 //computation of Directional Movement indicators up=high-high[1] dw=low[1]-low if up>dw and up>=0 then plusdm=up else plusdm=0 endif if dw>up and dw>=0 then mindm=dw else mindm=0 endif //computation of TR mioTR=max(abs(high-close[1]),max(abs(low-close[1]),range)) mioATR=average[period,MM](mioTR) //computation of DI dip=100*average[period,MM](plusdm)/mioATR dim=100*average[period,MM](mindm)/mioATR //computation of smoothed ADX & non smoothed ADX mioADXn=100*average[period,MM](abs(dip-dim)/(dip+dim)) mioADXnonSmoothed=100*(abs(dip-dim)/(dip+dim)) //return of data return mioadxn as "ADX Normal",20 as "20",mioADXnonSmoothed as "ADX Fast",0 as "Zero reversal",50 as "50 Reversal" |
Share this
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 :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
I’ve always wondered how to make the ADX faster, thank you!
You welcome !
Another variation that may be more accurate : we calculate the average of normalized DI’s instead of normalizing the average…
period=14
mm=3
//computation of Directional Movement indicators
up=high-high[1]
dw=low[1]-low
if up>dw and up>=0 then
plusdm=up/tr(close)
else
plusdm=0
endif
if dw>up and dw>=0 then
mindm=dw/tr(close)
else
mindm=0
endif
//computation of DI
dip=100*average[period,MM](plusdm)
dim=100*average[period,MM](mindm)
//computation of smoothed ADX & non smoothed ADX
mioADXn=100*average[period,MM](abs(dip-dim)/(dip+dim))
mioADXnonSmoothed=100*(abs(dip-dim)/(dip+dim))
//return of data
return mioadxn as “ADX Normal”,20 as “20”,mioADXnonSmoothed as “ADX Fast”,0 as “Zero reversal”,50 as “50 Reversal”