runmode:1;
nn:=barslast(date<>ref(date,1));
n:=mod(nn,5)+1;
o5:=if(n=1,open,ref(open,n-1));
h5:=hhv(h,n);
l5:=llv(l,n);
c5:=close;
kred:STICKLINE( c5>o5,c5 ,o5, 10,1 ,COLORRED);//空心实体
kred1:STICKLINE( c5>o5,h5 ,max(c5,o5), 0,1 ,COLORRED);//上引线
kred2:STICKLINE( c5>o5,min(c5,o5) ,l5, 0,1 ,COLORRED);//下引线
kgreen:STICKLINE( c5<=o5,c5 ,o5, 10,1 ,COLORGREEN);//实心实体
kgreen1:STICKLINE( c5<=o5,h5 ,max(c5,o5), 0,1 ,COLORGREEN);
kgreen2:STICKLINE( c5<=o5,min(c5,o5) ,l5, 0,1 ,COLORGREEN);