Monday, November 26, 2007

Average Directional Index (ADX):Meaning & Calculation

Introduction
J. Welles Wilder developed the Average Directional Index (ADX) to evaluate the strength of a current trend, be it up or down.

It's important to determine whether the market is trending or trading (moving sideways), because certain indicators give more useful results depending on the market doing one or the other.

The ADX is an oscillator that fluctuates between 0 and 100. Even though the scale is from 0 to 100, readings above 60 are relatively rare. Low readings, below 20, indicate a weak trend and high readings, above 40, indicate a strong trend.

The indicator does not grade the trend as bullish or bearish, but merely assesses the strength of the current trend. A reading above 40 can indicate a strong downtrend as well as a strong uptrend.

ADX can also be used to identify potential changes in a market from trending to non-trending. When ADX begins to strengthen from below 20 and moves above 20, it is a sign that the trading range is ending and a trend is developing.

When ADX begins to weaken from above 40 and moves below 40, it is a sign that the current trend is losing strength and a trading range could develop.

Positive/Negative Directional Indicators
The ADX is derived from two other indicators, also developed by Wilder, called the Positive Directional Indicator (sometimes written +DI) and the Negative Directional Indicator (-DI).

In its most basic form, buy and sell signals can be generated by +DI/-DI crosses.

A buy signal occurs when +DI moves above -DI and a sell signal when -DI moves above the +DI.
As with most technical indicators, +DI/-DI crosses should be used in conjunction with other aspects of technical analysis.

The ADX combines +DI with -DI, and then smooths the data with a moving average to provide a measurement of trend strength. Because it uses both +DI and -DI, ADX does not offer any indication of trend direction, just strength.

The Directional Movement Index, DMI, is an effective and frequently used trend indicator. This system was designed by Welles Wilder Jr. and is made up of three lines:
1. The +DI indicates the up average.
2. The -DI indicates the down average.
3. The ADX, average directional movement index, shows whether a trend is in effect by smoothing the difference between the +DI and -DI.

The time periods most commonly used in the complex formula are 10 or 14 days.

According to Wilder the DMI should be used with the ADX as a filter.
A rising ADX line means the market is trending and a better candidate for a trend-following system.

A falling ADX line indicates a non-trending market.

Some traders also look for an ADX greater than 20 or 25 to confirm that the market is trending. When the ADX line starts to drop from above the 40 level, that is an early sign that the trend is weakening. A rise back above 20 is often a sign of the start of a new trend.

Signals
Generally speaking, the two main buy and sell signals generated by DMI are as follows:
* A buy signal is given when +DI crosses above the -DI line.
* A sell signal is given when +DI crosses below the -DI line.

An ADX below 25 is a strong warning to avoid trading.

Calculation for Average Directional Index
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SUM(IF(HD>0 & HD>LD,HD,0),N);
DMM:= SUM(IF(LD>0 & LD>HD,LD,0),N);
PDI:= DMP*100/TR;
MDI:= DMM*100/TR;
ADX:= MA(ABS(MDI-PDI)/(MDI+PDI)*100,N)

so Calculation for ADX in MS Excel:
A = Company Name/date
B = Open
C = High
D = Low
E = close
F = Volumes

1. Calculate DM+/-:
a.If YH > = TH, and YL < = TL (i.e. if today's trading is totally within yesterday's range), then DM+ = 0;DM- = 0
so formula for (a)= IF(AND(C1>=C2,D1<=D2), "0",0)

b.If TH - YH = YL - TL (i.e. if the differences between highs and lows are the same), then DM+ = 0;DM- = 0
so formula for (b)= IF(AND(C2-C1=D2-D1),"0",0)

c.If TH - YH > YL - TL ( i.e. if the differences between highs and lows are the same), then DM+ = TH - YH;DM- = 0
so formula for (c)=IF(C2-C1>D2-D1), C2-C1, D2-D1)

d.Otherwise (i.e. the difference between lows is more than the difference between highs), DM+ = 0;DM- = YL - TL

Derived DM+/- formula in G2 is =IF(AND(C1>=C2,D1<=D2),0,IF(AND(C2-C1=D2-D1),0,IF(AND(C2-C1>D2-D1),C2-C1,D2-D1)))

for True range in cell H2 =MAXA(C2-D2,C2-E1,E1-C2,E1-D2,D2-E1)

for Plus DM in cell i2 =IF(G2>0,G2,0)
for minus DM in cell J2 =IF(G2<0,ABS(G2),0)

for PLUSDI in cell K2 =(I2*100)/H2
for MINUSDI in cell L2 =(J2*100)/H2

then Average 14day Plus DI,so in cell M14 =SUM(K2:K14)/13 (13 day sma)
in cell M15(14day EMA) =K15*0.133+M14*(1-0.133)

then Average 14day Minus DI,so in cell N14 =SUM(L2:L14)/13 (13 day sma)
in cell N15(14day EMA) =L15* 0.133+N14*(1-0.133)

Then DX in cell O14 =(M14-N14)/(M14+N14)*100
13day ADX in cell P27 =SUM(O14:O27)/13

Then (14)ADX in cell P28 =O28*0.133+P27*(1-0.133)


Pls note: replace "greater than" with symbol ">" and"less than" with symbol "<".if used any where.

since i am not a expert in excel programming,i would like to know,whether my Derived DM+/- formula in G2 is correct or not.

4 comments:

Unknown said...

good and clerly expressed the usage of ADX. Like to know which are the other indicators used well along with ADX, what to do when a trend reverses and again immediately reverse back.

regards,
jshankar_2002@yahoo.com

Unknown said...

good and clerly expressed the usage of ADX
Thanks
god bless you

Uday

vindhya.p.mishra said...

good and clerly expressed the usage of ADX. Like to know which are the other indicators used well along with ADX, what to do when a trend reverses and again immediately reverse back. vindhya.p.mishra
regards

joinrevolution@gmail.com

Sudip Mutt said...

hi

thanx for the formula....do u have any idea about super trend?

Cheers

Sudip