N=14;
M=6;
TRR:=EMA(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(REF(C,1)-L)),N);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=EMA(IF(HD>0 && HD>LD,HD,0),N);
DMM:=EMA(IF(LD>0 && LD>HD,LD,0),N);
ADX0:=EMA((DMP-DMM)/(DMP+DMM)*100,M);
ADXR0:=EMA(ADX0,M);
DRAWBAND(ADX0,RGB(155,10,10),ADXR0,RGB(0,155,0));
多:DMP/TRR*100,COLORWHITE;
空:DMM/TRR*100,COLORYELLOW;
ADX:ADX0,NODRAW,COLORMAGENTA;
ADXR:ADXR0,NODRAW,COLORGREEN;
AAJ:(3*ADX-2*ADXR),COLORMAGENTA;
MAAD:ADX-ADXR,COLORLIMAGENTA,COLORSTICK;
STICKLINE(MAAD>=REF(MAAD,1) && MAAD<=0,0,MAAD,1,0),COLORCYAN;
STICKLINE(MAAD>=REF(MAAD,1) && MAAD>0,0,MAAD,1,0),COLORLIMAGENTA;
PDIL:=IF(多<=11,多,DRAWNULL);{超跌}
MDIL:=IF(空<=11,空,DRAWNULL);{超涨}
AAJT:=IF(多<REF(多,1) && AAJ>REF(AAJ,1) && MAAD>0,AAJ,DRAWNULL);{明日可能回调}
DRAWBAND(PDIL,RGB(150,150,0),PDIL,RGB(150,150,0)),POINTDOT,LINETHICK4,COLORWHITE;
DRAWBAND(MDIL,RGB(150,150,0),MDIL,RGB(150,150,0)),POINTDOT,LINETHICK4,COLORYELLOW;
DRAWBAND(AAJT,RGB(150,150,0),AAJT,RGB(150,150,0)),POINTDOT,LINETHICK4,COLORGREEN;
金叉:DRAWICON(CROSS(AAJ,ADXR),ADXR,1);
死叉:DRAWICON(CROSS(ADXR,AAJ),AAJ,2);