Data2 and Arrays  [SOLVED]

Questions about MultiCharts and user contributed studies.
evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Data2 and Arrays

Postby evdl » 18 Sep 2013

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?

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Data2 and Arrays  [SOLVED]

Postby TJ » 22 Sep 2013

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...

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: Data2 and Arrays

Postby evdl » 24 Sep 2013

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.


Return to “MultiCharts”