P1:=28;P2:=32;P3:=35;N:=3;M:=20;
ma5:ma(close,5);
ma10:ma(close,10);
ma20:ma(close,20);
ma30:ma(close,30);
ma60:ma(close,60);
VAR1:=IF(DATE<1500830 AND DATE>900101,1,0);
VAR2:=LLV(LOW,10);
VAR3:=HHV(HIGH,25);
K1:=(P1/10)*VAR1*100;
K2:=(P2/10)*VAR1*100;
K3:=(P3/10)*VAR1*100;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:SMA(RSV,3,1),COLORFFFFFF;
D:SMA(K,3,1),COLOR00FFFF;
J:3*K-2*D,COLORFF00FF;
X:=LLV(J,2)=LLV(J,8);
Y:IF(crOSS(J,REF(J+0.01,1)) AND X AND J<20,30,0),COLOR00FF00;
主力:=EMA( (CLOSE-MA(CLOSE,n))/MA(CLOSE,n)*4800,2);
散户:=EMA( (CLOSE-MA(CLOSE,m))/MA(CLOSE,m)*4800,7);
动能趋势线:100*EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*VAR1,COLORA0A0FF;
DRAWTEXT(CROSS(动能趋势线,K1),HIGH*1.02,'风险'),COLORGREEN;
DRAWTEXT(CROSS(动能趋势线,K2),HIGH*1.02,'减仓'),COLOR00FF00;
DRAWTEXT(CROSS(动能趋势线,K3),HIGH*1.02,'出局'),COLORWHITE;
DRAWTEXT(CROSS(J,REF(J+0.01,1)) AND X AND J<20,LOW,'短进'),COLORFF00FF;
DRAWTEXT(CROSS(主力,散户) AND 主力<0 AND 散户<0,LOW,'见 底'),COLORRED;
DRAWICON(CROSS(主力,散户) AND 主力<0 AND 散户<0,LOW,1);
{选股}
见底选股:if(CROSS(主力,散户) AND 主力<0 AND 散户<0,1,0),COLORRED;
短进选股:if(CROSS(J,REF(J+0.01,1)) AND X AND J<20,1,0),COLORFF00FF;