N:=20;M:=6;
TYP:=(OPEN+HIGH+LOW+CLOSE)/4;
TRR:=EMA(MAX(MAX(H-L,Abs(H-REF(TYP,1))),ABS(REF(TYP,1)-L)),N);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=EMA(IF(HD>0 && HD>LD,HD,0),N);
DMM:=EMA(IF(LD>0 && LD>HD,LD,0),N);
{ _最新股票指标公式}
ADX:=EMA((DMP-DMM)/(DMP+DMM)*100,M)*10;
ADXR:=EMA(ADX,M);
DRAWBAND(ADX,RGB(144,10,10),ADXR,RGB(0,120,0));
pdi:=DMP/TRR*100,;
mdi:=DMM/TRR*100,;
AAJ:(3*ADX-2*ADXR),COLORMAGENTA;
PP:SMA(PDI,3,1)*10,COLORRED,DOTLINE;
P2:MA(PP,5)COLORRED,LINETHICK2;
DD:SMA(MDI,3,1)*10,DOTLINE,COLORWHITE;
D2:MA(DD,5),COLORGREEN,LINETHICK2;
0,crOSSDOT,COLORLICYAN;