{ N 2, 9, 14 M 2 60 6}
MTR:=EXPMEMA(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:=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;
抄底:=CROSS(上升(PDI),下降(MDI));
DRAWTEXT(抄底,上升(PDI),30),COLORYELLOW;
DRAWICON(抄底,上升(PDI)*0.68,5);
趋势(ADX): EXPMEMA(ABS(下降(MDI)-上升(PDI))/(下降(MDI)+上升(PDI))*100,M);
ADXR:EXPMEMA(趋势(ADX),M),COLORRED;
底背离:=REF(CLOSE,1)>CLOSE AND ADXR>=REF(ADXR,1);
不底背离:=REF(CLOSE,1)<CLOSE AND ADXR<=REF(ADXR,1);
STICKLINE(底背离,0,3,6,0),COLORRED,LINETHICK2;
{DRAWBAND(底背离,RGB(0,224,224),不底背离,DRAWNULL);}
IF(ADXR<=REF(ADXR,1),ADXR,DRAWNULL),LINETHICK2,COLORGREEN;
{小新底部确认: DMM*100/TR;}
50,POINTDOT,LINETHICK2;
20,POINTDOT,LINETHICK2;
10,POINTDOT,LINETHICK2;