N:=13;
M:=5;
TR:=SUM(MAX(MAX(HIGH-LOW,Abs(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=SUM(IF(HD>0 and HD>LD,HD,0),N);
DMM:=SUM(IF(LD>0 and LD>HD,LD,0),N);
pdi:= DMP*100/TR;
mdi:= DMM*100/TR;
ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,M),COLORBLUE,LINETHICK2;
拐点:ADX,COLORRED,LINETHICK0;
涨:ADX,COLORYELLOW,LINETHICK0;
泥沼:ADX,COLORGREEN,LINETHICK0;
{-股票公式网站 }
PARTLINE(adx,adx>60,RGB(255,0,0),adx<20,RGB(0,255,0),(ADX>20 AND ADX>REF(ADX,1) AND REF(ADX,1)>REF(ADX,2) AND ADX<60),RGB(241,225,22)),LINETHICK2;