input: count(3); var: x(0), oldest(0), recycle(0), size(199); array: id[199,3](0); // 0=id, 1=price, 2=count, 3=age once for x=0 to size begin id[x,0]=tl_new(d,t,0,d,t,0); tl_setextright (id[x,0], True); end; if barstatus(1)=2 then begin oldest=0; for x=0 to size begin if L<=id[x,1] and H>=id[x,1] then begin id[x,2]=id[x,2]+1; TL_SetColor(id[x,0],red); tl_setstyle(id[x,0],1); if id[x,2] = count-1 then begin TL_SetColor(id[x,0],blue); tl_setstyle(id[x,0],3); end; if id[x,2]=count then begin id[x,1]=0; id[x,2]=0; id[x,3]=9999999; tl_setend(id[x,0],d,t,0); tl_setbegin(id[x,0],d,t,0); // reset price, count and age end; end; if id[x,1]>0 then tl_setend(id[x,0],d,t,id[x,1]); id[x,3]=id[x,3]+1; if id[x,3]>oldest then begin if id[x,2]= count-1 then TL_SetColor(id[x,0],blue); oldest=id[x,3]; recycle=x; end; end; id[recycle,1]=c; id[recycle,2]=0; id[recycle,3]=0; tl_setend(id[recycle,0],d,t,c); tl_setbegin(id[recycle,0],d,t,c); end;
First, I tried to display a horizontal line at each price:
for (int i=1; i<777; i++) { DrawHorizontalLine("tag1"+CurrentBar,Close[i], Color.Red); }
Please advise how I can do it, and how to work with the horizontal line tag, to appeal to her?
Thank.
Comment