K1:=IF(CLOSE>=REF(CLOSE,1),HIGH-OPEN+CLOSE-LOW+CLOSE-REF(CLOSE,1),HIGH-OPEN+CLOSE-LOW);
K2:=IF(CLOSE<=REF(CLOSE,1),OPEN-LOW+HIGH-CLOSE+REF(CLOSE,1)-CLOSE,OPEN-LOW+HIGH-CLOSE);
DT:=VOL*K1/(K1+K2);
KT:=VOL-DT;
买量:=SUM(DT,1);
卖量:=SUM(KT,1);
DDX:EMA(买量-卖量,5)*VOL/CAPITAL*100,COLORSTICK,LINETHICK2;
STICKLINE(DDX>0,0,DDX,3,0),COLOR000088;
STICKLINE(DDX>0,0,DDX,2.5,0),COLOR0000AA;
STICKLINE(DDX>0,0,DDX,1.5,0),COLOR0000CC;
STICKLINE(DDX>0,0,DDX,1,0),COLOR0000EE;
STICKLINE(DDX<0,0,DDX,3,0),COLOR008800;
STICKLINE(DDX<0,0,DDX,2.5,0),COLOR00AA00;
STICKLINE(DDX<0,0,DDX,1.5,0),COLOR00CC00;
STICKLINE(DDX<0,0,DDX,1,0),COLOR00EE00;
DDX1:SMA(DDX,3,1),COLORFFFFFF;
DDX2:SMA(DDX1,3,1),COLOR00FFFF;
DDX3:EMA(DDX2,5),COLORFF00FF;
预警:DDX>0 AND MA(V,5)>MA(MA(V,5),5) AND CROSS(DDX1,DDX2),LINETHICK;
天:=COUNT(DDX>0,5),colorred;
DRAWTEXT(预警,DDX*1.06,'★'),LINETHICK3,COLOR00FFFF;