bu:=cross(high,SAR(3,1,20));
sel:=cross(sar(3,1,20),low);
var1:=last(high
drawflagtext(bu,high,'买入');
drawflagtext(sel,low,'卖出');
drawtext(bu,LOW,'B'),valign0,align1,coloryellow,linethick2;
drawtext(sel,HIGH,'S'),valign2,align1,colorgreen,linethick2;
STICKLINE(low>SAR(3,1,20) and isdown,high,open,0.5,1),colorred;
STICKLINE(low>SAR(3,1,20) and isdown,close,open,7.5,1),colorred;
STICKLINE(low>SAR(3,1,20) and isdown,close,low,0.5,1),colorred;
STICKLINE(high
drawflagtext(high
drawflagtext(low>SAR(3,1,20) and low>ref(low,1),low,'继续持股');
HHJSJDA:=(3*CLOSE+OPEN+LOW+HIGH)/6;
牛线:(20*HHJSJDA+19*REF(HHJSJDA,1)+18*REF(HHJSJDA,2)+17*REF(HHJSJDA,3)+16*REF(HHJSJDA,4)+15*REF(HHJSJDA,5)+14*REF(HHJSJDA,6)
+13*REF(HHJSJDA,7)+12*REF(HHJSJDA,8)+11*REF(HHJSJDA,9)+10*REF(HHJSJDA,10)+9*REF(HHJSJDA,11)+8*REF(HHJSJDA,12)
+7*REF(HHJSJDA,13)+6*REF(HHJSJDA,14)+5*REF(HHJSJDA,15)+4*REF(HHJSJDA,16)+3*REF(HHJSJDA,17)+2*REF(HHJSJDA,18)+
REF(HHJSJDA,20))/211,COLORYELLOW;
马线:MA(牛线,5),COLORRED;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,3,0),COLORMAGENTA;
STICKLINE(涨停,H,L,0,0),COLORMAGENTA;