N:=14;
MM:=6;
MTR:=EXPMEMA(MAX(MAX(Abs(HIGH-LOW),ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);
pdi:=DMP*100/MTR;
mdi:=DMM*100/MTR;
多头线:PDI,COLORRED,LINETHICK4;
空头线:MDI,COLORCYAN,LINETHICK3;
DRAWBAND(多头线,RGB(155,50,50),空头线,RGB(256,96,96));
注意线_多或空:EXPMEMA(ABS(PDI-MDI)/(MDI+PDI)*100,MM),COLORFF00FF,LINETHICK1;
顺势线M:EXPMEMA(注意线_多或空,MM),COLOR00FF00,LINETHICK1;