store array externally

 

Hello,

If someone could tell me how to store arrays externally / globally I would appreciate it. At the moment I have an array that is written to in the OnCalculate section, but I can't see how to save the results from tick to tick. It is declared outside of the functions with the input variables ex -

input int parameter_1;
input int parameter_2;

double array[];

 

then in the main function I'm trying to write to it in a loop ex -

for(int i = 8; i >= 0; i--){ array[i] = variable;)
 
mt5dev:

Hello,

If someone could tell me how to store arrays externally / globally I would appreciate it. At the moment I have an array that is written to in the OnCalculate section, but I can't see how to save the results from tick to tick. It is declared outside of the functions with the input variables ex -

then in the main function I'm trying to write to it in a loop ex -

Hi mt5dev,

I don't think any global declared array will lose it's values unless it's property windows gets opened. However you may want to try FileWriteArray() and FileReadArray() 

:D 

 

Thanks, filewrite should work.