How to preserve variables values when turns off an EA

 

Hello,

I don´t know if this is the right place to question this, so sorry it is not:

I have an EA that assigns a value to a global variable with every tick, whis is at the start initialized to zero. 

I want to know if it is possible to preserve the value assigned trough a switch off/on of the EA, so that when i initialized again the program the zero value were not assigned to the variable but the last known value. I need that it works like an input type variable and maintain its value when I turns off the EA.

Perhaps is a big silly question, but i haven´t found the answer in the documentation.

Thak you very much in advance,

 
gedavid:

Hello,

I don´t know if this is the right place to question this, so sorry it is not:

I have an EA that assigns a value to a global variable with every tick, whis is at the start initialized to zero. 

I want to know if it is possible to preserve the value assigned trough a switch off/on of the EA, so that when i initialized again the program the zero value were not assigned to the variable but the last known value. I need that it works like an input type variable and maintain its value when I turns off the EA.

Perhaps is a big silly question, but i haven´t found the answer in the documentation.

Thak you very much in advance,

It's the right place and a very common question, don't worry.

You have several choices, the main two are :

Global variables of the Terminal.

Write/Read from a file.

 
angevoyageur:

It's the right place and a very common question, don't worry.

You have several choices, the main two are :

Global variables of the Terminal.

Write/Read from a file.

Thank you very much, I have read it and the use of files is what I was looking for.