How to store data on Virtual Host?

 

Dear experts,

I'm a quite new here and it's my first question. I wrote an EA wich works fine on a PC terminal but has some problems when I move it to the MT4 Virtual Host (not plain vanilla VPS). The problem is the following: if the EA terminates on whatever reason I need to have a possibility to restart it from the last state. The state is defined by a set of constantly changing variables which I'd like to use as external input parameters during an EA launch. On a PC it's not a problem, I can store them in a file or as Terminal Global Variables but it doesn't work on Virtual Host. Files as well as global variables disappear as soon as the EA terminates. The only way I see to "store" data on a Virtual Host is to write variable values with Print() and then read them back from the Virtual Host log file. I wonder if there is a more elegant way to keep some data on the Virtual Host?

Thanks in advance for your input.

 
YuTS:

Dear experts,

I'm a quite new here and it's my first question. I wrote an EA wich works fine on a PC terminal but has some problems when I move it to the MT4 Virtual Host (not plain vanilla VPS). The problem is the following: if the EA terminates on whatever reason I need to have a possibility to restart it from the last state. The state is defined by a set of constantly changing variables which I'd like to use as external input parameters during an EA launch. On a PC it's not a problem, I can store them in a file or as Terminal Global Variables but it doesn't work on Virtual Host. Files as well as global variables disappear as soon as the EA terminates. The only way I see to "store" data on a Virtual Host is to write variable values with Print() and then read them back from the Virtual Host log file. I wonder if there is a more elegant way to keep some data on the Virtual Host?

Thanks in advance for your input.

Use Global Variables - 

MQL4 Reference / Global Variables of the Terminal / GlobalVariableSet
 

Same problem here.

Files and Global Variables were deleted when the EA  terminates on VPS and after synchronization of Experts.


My Workaround: 

Instead of using FileOpen(...) use FileOpenHistory(...) for saving and loading. I assume files get preserved 'cause they are stored in the history folder which will not be cleared after EA-Restart.