Page 1 of 1

Data2 and Arrays

Posted: Sep 18 2013
by evdl
If I use a reference to data2 in my code, then the arrays with calculations on data1 are giving no values or strange values.

Even if I use a variabel that is referenced to data2 and this variabel is not used in any of the calculations in the code (an redundant variabel). The arrays give strange values. It looks like it is not possible to use (dynamic) arrays and references to data2 in the same code.

Example of redundant variabel that is not used for any calculation or what so ever.

Code: Select all

If date <> date[1] then begin
Yesterday_close_fake = close[1] of data2;
end;


Is it not possible to use arrays with references to data2?

Re: Data2 and Arrays  [SOLVED]

Posted: Sep 22 2013
by TJ
If I use a reference to data2 in my code, then the arrays with calculations on data1 are giving no values or strange values.
Even if I use a variabel that is referenced to data2 and this variabel is not used in any of the calculations in the code (an redundant variabel). The arrays give strange values. It looks like it is not possible to use (dynamic) arrays and references to data2 in the same code.
Example of redundant variabel that is not used for any calculation or what so ever.

Code: Select all

If date <> date[1] then begin
Yesterday_close_fake = close[1] of data2;
end;

Is it not possible to use arrays with references to data2?
If you add the following to the code, you can be sure to capture the data2 value timing.

Code: Select all

if barstatus(2)=2 then...

Re: Data2 and Arrays

Posted: Sep 24 2013
by evdl
I changed the barstatus and also rebuild the charts. Although I don't know if it is the added barstatus or that it is the rebuild of the charts.

But problem solved.

Thanks TJ for the hint.