LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),21,1)/SMA(ABS(CLOSE-LC),21,1)*100;
JW1:=EMA(RSI,8)-EMA(RSI,17);
G1:JW1*1.5;
G2:JW1*1.5,COLORSTICK;
VAR1:=(C-EMA(C,6))/EMA(C,6)*100;
VAR2:=(C-MA(C,24))/MA(C,24)*100;
VAR3:=(C-MA(C,32))/MA(C,32)*100;
VAR4:=(VAR1+VAR2+VAR3)/3;
KX:=MEMA(VAR4,3),NODRAW,COLORWHITE;
DX:=MEMA(KX,3),NODRAW,COLORYELLOW;
飘红:=(KX-DX)>0;
零上:=KX>0 AND DX>0;
源头:=(CROSS(JW1,0) AND 飘红) OR (CROSS(JW1,0) AND 零上);
DRAWTEXT(FILTER(JW1>0,20),HHV(JW1,120),'山川'),COLORLIRED;
DRAWTEXT(FILTER(JW1<0,20),LLV(JW1,120),'河流'),COLOR00F080;
{DRAWTEXT(CROSS(JW1,0),0,'源头'),COLORDD22DD;}
DRAWTEXT(源头,-3,'源头'),COLORDD22DD;
DRAWICON(源头,-2,1);
风险:4,COLORGREEN;
{STICKLINE(进出量<0,0,进出量,3,0),COLORFF6600;
STICKLINE(进出量<0,0,进出量,2,0),COLORFF9900;
STICKLINE(进出量<0,0,进出量,1.5,0),COLORFFCC00;
STICKLINE(进出量<0,0,进出量,0.5,0),COLORCYAN;
STICKLINE(进出量>0,0,进出量,3,0),COLOR000099;
STICKLINE(进出量>0,0,进出量,2,0),COLOR0000CC;
STICKLINE(进出量>0,0,进出量,1.5,0),COLOR0000FF;
STICKLINE(进出量>0,0,进出量,0.5,0),COLORCC66FF;
N:=5;
M:=13;
N日内净流入:SUM(进出量,N),LINETHICK2,COLORGREEN;
流入:IF(N日内净流入>REF(N日内净流入,1),N日内净流入,DRAWNULL),COLORRED,LINETHICK2;
连红天:BARSLASTCOUNT(进出量>0);
M日内翻红天:COUNT(进出量>0,M),COLORRED;
走熊天:BARSLASTCOUNT(N日内净流入<0),COLORCYAN;
走牛天:BARSLASTCOUNT(N日内净流入>0),COLORRED;}