MTR:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),3);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),3);
DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),3);
PDI:=EMA(DMP*100/MTR,13);
MDI:=EMA(DMM*100/MTR,13);
快线:=PDI-MDI,COLORSTICK;
慢线:=EMA(FORCAST(快线,8),3),colorwhite,LINETHICK1;
短多:(快线-慢线)*4, LINESTICK,colorred;
短空:-(快线-慢线)*4, LINESTICK,colorcyan;
短多线:(快线-慢线)*4,colorred;
短空线:-(快线-慢线)*4,colorcyan;
趋势:EMA(快线/(MDI+PDI)*100,2),COLORLIGRAY;
平均趋势:EMA(趋势,3),colorgray;
零轴:0,DOTLINE,colorwhite;