涨停:=C/REF(C,1)>1.0970 AND C=H AND C/REF(C,1)<1.11;
STICKLINE(涨停,O,C,2,0),COLORYELLOW;
跌停:=C/REF(C,1)<0.913 AND C=L;
STICKLINE(跌停,O,C,2,0),COLORGREEN;
周期:=BArslAST(REF(涨停,1) AND NOT(涨停));
支撑:=REF(L,周期+2);
压力:=MAX(HHV(O,周期),HHV(C,周期));
进攻线:=MAX(MAX(REF(C,周期),REF(C,周期+1)),MAX(REF(O,周期),REF(O,周期+1)));
不破:=LLV(O,周期)>支撑 AND LLV(C,周期)>支撑;
能破:=C*1.11>压力;
强势:=HHV(HIGH,15)*1.1>HHV(HIGH,30);
低位:=HHV(C,10)/LLV(C,10)<1.5;
DRAWSL(周期<30 AND NOT(涨停),支撑,0,1,2),LINETHICK2,COLORYELLOW;
DRAWTEXT(周期=0,REF(C,周期+2)*0.99,'防守线');
DRAWSL(周期<30 AND NOT(涨停),进攻线,0,1,0),LINETHICK2,COLORRED;
DRAWTEXT(周期=0,进攻线*1.01,'进攻线');
买入信号:=周期>0 AND 周期<=30 AND 不破 AND 低位 AND 强势 AND 能破
AND C>进攻线 AND REF(C,1)<=进攻线;
DRAWICON(买入信号 AND COUNT(买入信号,周期)<=2,LOW*0.995,38),COLORRED;
DRAWTEXT(买入信号 AND COUNT(买入信号,周期)<=2,LOW*0.988,'买突破'),COLORYELLOW;