Tomasz, I have reviewed your posts explaining how to create an array that extends beyond the last bar and then plot it using xshift. I succeeded with line arrays but am having no success with time retracements into the future. In my test reported x1 as 309, x110 reported bar index as 313 and xshift reported 4. X100 does not appear on the chart. What am I doing wrong? Thanks,
David K. pct = Param( "Pivot %",1.0,0.10,60,0.01); SetBarsRequired( 999999,999999); pk=PeakBars(H,pct)==0; tr=TroughBars(L,pct)==0; zHi=Zig(H,pct); zLo=Zig(L,pct); HLAvg=(zHi+zLo)/2; zp=IIf(pk,zHi,IIf(tr,zLo,IIf(HLAvg>Ref(HLAvg,-1),H,L))); za=Zig(zp,pct); pR=Ref(za,-1)<za AND za>Ref(za,1); pS=Ref(za,-1)>za AND za<Ref(za,1); bi=BarIndex(); x1=BarCount-1; xr1=SelectedValue(ValueWhen(pR,bi,1)); xs1=SelectedValue(ValueWhen(pS,bi,1)); xe = IIf(xr1>xs1,xr1,xs1); xb=IIf(xr1<xs1,xr1,xs1); d= xe-xb; x100 = xe + round(d*1.0); barsfromlast=x100-x1; xshift = IIf(barsfromlast>0,barsfromlast,0); Plot(bi==xr1,"",32,2|4|65536|32768|4096); Plot(bi==xs1,"",43,2|4|65536|32768|4096); Plot(bi==x100,"",42,2|4|65536|32768|4096,0,0,xshift);
