Monday, 25 March 2013

Volume Weighted ADX




_SECTION_BEGIN("volume adx 1");
TP= Param("Time Periods",14,1,50);
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);
Vdiplus = Sum( V * DIPlus,TP) / Sum( V,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);
Vdiminus = Sum( V * DIMinus,TP) / Sum( V,TP ); 
Diff= abs(DIPlus - DIMinus);
DISum= DIPlus + DIMinus;
ADXRaw= 100 * Wilders(Diff/DISum, TP);
Vadx = Sum( V * ADXRaw,TP) / Sum( V,TP ); 
Plot (Vadx ,"Volume Weighted ADX",colorWhite,styleThick);
Plot (Vdiplus ,"DI+", colorLime,1);
Plot (Vdiminus ,"DI-",4,1);
GraphXSpace=4;
_SECTION_END();

No comments:

Post a Comment

/* begin page number */