PPU:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),8);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=SUM(IF(HD>0&&HD>LD,HD,0),8);
DMM:=SUM(IF(LD>0&&LD>HD,LD,0),8);
PDI:= DMP*100/PPU;
MDI:= DMM*100/PPU;
ADX:= MA(ABS(MDI-PDI)/(MDI+PDI)*100,5);
ADXR:=(ADX+REF(ADX,5))/2;
DI:=PDI<=3;
A:FILTER(DI,5);
DRAWTEXT(A,0.8,'DI零以下'),COLORYELLOW;