N:=230;
M:=60;
MTR:=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/MTR;
mdi:= DMM*100/MTR;
ADX:= MA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
ADXR:=(ADX+REF(ADX,M))/2;
PD:=ABS(PDI-REF(PDI,1));
MD:=ABS(MDI-REF(MDI,1));
倍数:IF(MD>PD,-(MD+0.01)/(PD+0.01),(PD+0.01)/(MD+0.01));
NOTEXT小买:IF(倍数>10 AND 倍数<30,倍数,0),LINETHICK2,COLOR0066BB;
NOTEXT大买:IF(倍数>30,50,0),LINETHICK2,COLORRED;
NOTEXT小卖:IF(倍数<-10 AND 倍数>-20,倍数,0),LINETHICK2,COLORYELLOW;
NOTEXT超卖:IF(倍数<-80,-100,0),LINETHICK2,COLORRED;
NOTEXT大卖:IF(倍数<-20 AND 倍数>-80,-50,0),LINETHICK2,COLORFF8800;