N:=9;M:=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)
{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;