Preserving variable values upon script

 
I want to know what is the best way to preserve the values of variables in a running script so as when I close the program and re-open it after the weekend, I retreive those values?

Shall I just write them to a file every few minutes or is there a way in the program to do that?

Thanks
 
In that case there is excellent opportunity - https://docs.mql4.com/cn/globals
 
In that case there is excellent opportunity - https://docs.mql4.com/cn/globals


Would anyone have an example of how to save indicator values into a global variables? I can save individual values but not sure how to do arrays.
Reason: