Code: Select all
// data1 is 1min bars and data2 is daily
var closeopen(0);
if time = 1559 then
begin
// some calculation on daily bars..
CloseOpen=(Open data2/Close data2-1)*100;
// lets write to file for debugging...
Print(File("C:\test.txt")," closeopen=",closeopen*100, " closeopen[1]=",closeopen[1]*100, " closeopen[2]=",closeopen[2]*100);
end;
closeopen= -6.59 closeopen[1]= 80.67 closeopen[2]= 80.67
closeopen[1] is always the previous value of closeopen (as it should be) but closeopen[2] is always equal to closeopen[1] (this should not be -- it should be equal to closeopen two bars back of course ).
What could be causing this? Is there always only one previous bar stored for the data series other than data1?