Wilder adx

#1
Wilder's Smoothing
As seen in the ADX calculation, there is a lot of smoothing involved and it is important to understand the effects. Because of Wilder's smoothing techniques, it can take around 150 periods of data to get true ADX values. Wilder uses similar smoothing techniques with his RSI and Average True Range calculations. ADX values using only 30 periods of historical data will not match ADX values using 150 periods of historical data. ADX values with 150 days or more of data will remain consistent.

The first technique is used to smooth each period's +DM1, -DM1 and TR1 values over 14 periods. As with an exponential moving average, the calculation has to start somewhere so the first value is simply the sum of the first 14 periods. As shown below, smoothing starts with the second 14-period calculation and continues throughout.

First TR14 = Sum of first 14 periods of TR1
Second TR14 = First TR14 - (First TR14/14) + Current TR1
Subsequent Values = Prior TR14 - (Prior TR14/14) + Current TR14

The second technique is used to smooth each period's DX value to finish with the Average Directional Index (ADX). First, calculate an average for the first 14 days as a starting point. The second and subsequent calculations use the smoothing technique below:

First ADX14 = 14 period Average of DX
Second ADX14 = (First ADX14 x 13) + Current DX Value
Subsequent ADX14 = (Prior ADX14 x 13) + Current DX Value





SENIORS PLZ HELP TO MAKE THIS TYPE OF ADX.
 
#2
Hi

Here is afl by Prakash Shenoi for WilderADX.

You can modify as you need.
change periods from 14 to 150 in parameters and see how it goes as for your expecxtation or not.
change the line TP= Param("Time Periods",14,1,50); to TP= Param("Time Periods",150,1,150);



-----------------------------

/*
Formula Name: Raw ADX
Author/Uploader: Prakash Shenoi - (email hidden)
Date/Time added: 2006-09-19 08:18:17
Origin: MS formula conversion - Source: TASC Oct 1999 issue
Keywords: Trend Trading System
Level: basic
Flags: indicator

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users AND are provided here
on an "as is" AND "as available" basis. AmiBroker.com makes no representations OR warranties of any kind
to the contents OR the operation of material presented here. We do NOT maintain nor provide technical support for 3rd party formulas.
Description:

This ADX formula uses input variable for the periods AND
uses Wilders AND ATR in its calculation.

Formula:
*/
SetChartBkColor(64);
/* ADX Raw WITH 150 PERIODS */
//Afl code - Prakash Shenoi //

//TP= Param("Time Periods",14,1,50);

TP= Param("Time Periods",150,1,150);
PlusDM= IIf(High>Ref(High,-1) AND
Low>=Ref(Low,-1), High-Ref(High,-1),
IIf(High>Ref(High,-1) AND Low<Ref(Low,-1)
AND High-Ref(High,-1)>Ref(Low,-1)-Low,
High-Ref(High,-1), 0));
DIPlus= 100 * Wilders(PlusDM,TP) /ATR(TP);

MinusDM= IIf(Low<Ref(Low,-1) AND
High<=Ref(High,-1), Ref(Low,-1)-Low,
IIf(High>Ref(High,-1) AND Low<Ref(Low,-1)
AND High-Ref(High,-1)<Ref(Low,-1)-Low,
Ref(Low,-1)-Low, 0));
DIMinus = 100 * Wilders(MinusDM,TP) /ATR(TP);

Diff= abs(DIPlus - DIMinus);
DISum= DIPlus + DIMinus;
ADXRaw= 100 * Wilders(Diff/DISum, TP);

Plot (ADXRaw,"ADXRaw",1,styleThick);
//Plot (DiPlus,"DI+", 3,1);
//Plot (DiMinus,"DI-",4,1);
GraphXSpace=4;
/*
Comments:
Crash
crashandburn59 [at] hotmail.com
2006-09-23 20:13:26 Add a bit of Colour AND a Histogram - AND you can tell if the ADX is rising OR falling - AND which direction things are moving.
Regards Crash.
*/

Plot (ADXRaw,"ADXRaw",1,4);
Cc = IIf(ADXRaw<Ref(ADXRaw,-1),41,IIf(DiPlus>DiMinus,27,32));
Plot (ADXRaw,"ADXRaw",Cc,2);
Plot (DiPlus,"DI+", 27,4);
Plot (DiMinus,"DI-",32,4);

-------------------------------------------------------------------------

Point
The more complicated the more smoothing you apply, you will be missing something that is real.There is a sensible limit how far you can go on smothing.
 
Last edited:

Similar threads