I'm trying to use FindBar with the aiRightDispDateTime value to create a customized data window - but it's returning '-1' when it's too many bars back from the last bar (~100). Can anyone help clarify what might be happening? Should I write a custom findbar function instead of using the built-in one or am i missing something?
Any help would be appreciated - thanks very much.
I'm using 6.0B2.
Code: Select all
variables:
s(symbol),
lbj(0.00), lbd(0), lbt(0), lb(0)
//last bar julian, date & time, last bar (visible)
;
if lastbaronchart then begin
lbj=GetAppInfo(aiRightDispDateTime); //right-most datetime (julian)
lbd=JulianToDate(lbj); //right most date
lbt=datetime2eltime(lbj); //right most time
lb=FindBar(lbd, lbt);
print(s+", lbj: "+numtostr(lbj,4)
+", lbd: "+numtostr(lbd,0)
+", lbt: "+numtostr(lbt,0)
+", lb: "+numtostr(lb,0)
);
end;