N:=20;M:=30;
XZ1:=(C/REF(C,1)-1)*100;
XZ2:=CONST(HHV(XZ1,N));
XZ3:=CONST(LLV(XZ1,N));
TRTR:=EXPMEMA(MAX(MAX(H-L,Abs(H-REF(C,1))),ABS(REF(C,1)-L)),M);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=EXPMEMA(IF(HD>0 AND HD>LD,HD,0),M);
DMM:=EXPMEMA(IF(LD>0 AND LD>HD,LD,0),M);
VAR1:=DMP/TRTR;
VAR2:=DMM/TRTR;
VAR3:=EXPMEMA(VAR1,M);
VAR4:=EXPMEMA(VAR2,M);
VAR5:=IF(VAR3>VAR4,XZ2,XZ3);
VAR6:=REF(VAR5,2)>0 AND LAST(VAR5<0,1,1);
VAR7:=REF(VAR5,3)>0 AND LAST(VAR5<0,2,1);
{ _最新股票指标公式}
DRAWBAND(VAR5,RGB(150,50,50),0,RGB(0,130,50));
黄金:IF(VAR1>VAR3 AND VAR2<VAR3,XZ2/2,0),COLORYELLOW;
DRAWBAND(黄金,RGB(250,150,50),0,RGB(250,150,50));
黄金坑:(VAR6 OR VAR7) AND VAR5>0,NODRAW,COLORYELLOW;
DRAWTEXT(黄金坑,XZ3/2,黄金坑),COLORYELLOW;
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))*10,COLORWHITE;
DEA:EMA(DIF,9),COLORYELLOW;