PureBytes Links
Trading Reference Links
|
When I run the code below in TS2k with daily bars, it seems to run
twice, once with the true last bar, and once again at last bar minus
the max value of x in the loop(check the barnumbers in the print).
Could we possibly have a bug in TS2k EL? Such a thought might even get
PO to respond. :-)
Any ideas for a work-around?
Thanks,
ztrader
------------------------------
{TS study: TestLastBarChart2
}
Inputs: HLbarBk (20)
;
Variables: init(true), LBinit(true), dd(0),
HiHi(0), LastLBBar(0), EndDate(0), EndTime(0), x(0) ;
if init then begin
EndDate= LastCalcDate ; EndTime= LastCalcTime;
init = false ;
end;
if date=EndDate AND Time = EndTime AND LBinit then begin
LBinit = false;
for x = 0 to 10 begin
if High[x] > HiHi then begin
HiHi = High[x] ;
end ;
print( x, barnumber, date, LastCalcDate, time, LastCalcTime ) ;
end;
end;
If CurrentBar < -999999 Then Begin
Plot1(22, "dummy");
End;
|