Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Average Directional Index ADX and ADXR
Template (v17+)
Function Version
ADX(d, s, z)
Indicator version
ADXd.s.z
Where d is the DI Period
Where s is the Smoothing Period
Where z is the number of bars ago (optional).
While TC2000 allows you to set d and s separately, most programs will use the same values for d and s . So if are trying to replicate an ADX 14, you need to set both the DI Period and smooth Period to 14.
Examples
The syntax for ADX utilizes a DI Period, a Smooth Period, and a Bars Ago parameter. In most cases you will want to set the DI Period and Smooth Period to the same setting. So a 14 period ADX would be the following.
ADX14.14
And a 10 period ADX would be the following.
ADX10.10
But if you can have different DI Period and Smooth Periods as desired. The built in indicator plotted on the chart allows you to adjust these values separately as well. So an ADX using 14 for most of its calculations but 10 for its final smoothing would be written as follows.
ADX14.10
Past Values
The third parameter for ADX is the number of bars ago for which you wish to calculate ADX.
This is useful in the calculation of ADXR because you average the current value of ADX with the value of ADX from the ADXR period ago in order to calculate ADXR.
This means if the ADXR period is 10 and is applied to a standard 14 period ADX with the DI Period and Smooth Period both set to 14 could be written as follows.
(ADX14.14 + ADX14.14.10) / 2
Relationship to Directional Movement (+DI / -DI)
The following is a basic list of the steps traditionally used to calculate ADX by hand:
d = DI Period
s = smooth Period
r = ADXR Period
TR = MAX(H-L,H-C1,C1-L)
ATRd = (Yesterday_ATRn*(d-1)+TR)/d
+DM = IF H>H1 AND H-H1>L1-L THEN H-H1 ELSE 0
-DM = IF L1>L AND L1-L>H-H1 THEN L1-L ELSE 0
+DMId = (Yesterday_+DMId*(d-1)+(+DM))/d
-DMId = (Yesterday_-DMId*(d-1)+(-DM))/d
+DId = 100*(+DMId)/ATRd
-DId = 100*(-DMId)/ATRd
DXd = 100*ABS((+DId)-(-DId))/((+DId)+(-DId))
ADXds = (Yesterday_ADXs*(s-1)+DXd)/s
ADXRdsr = (ADXds + ADXds of r bars ago) / 2
You may alternately calculate ATRd, +DMId, -DMId and ADXs as follows:
ATRd = XAVG(TR,(2*d-1))
+DMId = XAVG(+DM,(2*d-1))
-DMId = XAVG(-DM,(2*d-1))
ADXds = XAVG(DXd,(2*s-1))
Related Topics
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 4/3/2014 Posts: 22
|
Hey Bruce, first of all thanks for all that you do.
I need help, I need an indictor which has the ADX and directional movement in one. Please don't think I am lazy, I have searched all over the website and was not able to find it.
It would look something like the picture I have attached, once again thanks for everything.
https://i.imgur.com/2KqoHf1.png
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try adding the Directional Movement (+DI -DI) and ADX indicators to the chart separately. Then overlay one of the indicators into the same pane and scale as the other indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|