I need to store my GVs more than 4 weeks. Possible?

 

Hello there,
Hope you are all well.

I noticed my GVs disappeared after 4 weeks.
So is there any way to extend the GVs to exist more than 4 weeks? If no, what would be the simplest alternative(s)?
I'm not a coder originally, so please explain a little more <3

Your advice is greatly appreciated!

 
HosseinKOGO:

Hello there,
Hope you are all well.

I noticed my GVs disappeared after 4 weeks.
So is there any way to extend the GVs to exist more than 4 weeks? If no, what would be the simplest alternative(s)?
I'm not a coder originally, so please explain a little more <3

Your advice is greatly appreciated!

Hi

If you want to use them for more than 4 weeks, the only thing you need to do is to use them in any way.

They won't be deleted 4 weeks after their creation, but 4 weeks after the last time you use them.

I believe GVs are very unsafe because any other indicator/EA/script can read, modify or delete them. even they can be read, modified, or deleted manually just by pressing F3 on MetaTrader.

if you run another indicator/EA that was written by a lazy programmer, it can easily delete all of your GVs.


Alternatively, you can use a file to store the necessary values.

 
Salih Yasar #:

Hi

If you want to use them for more than 4 weeks, the only thing you need to do is to use them in any way.

They won't be deleted 4 weeks after their creation, but 4 weeks after the last time you use them.

I believe GVs are very unsafe because any other indicator/EA/script can read, modify or delete them. even they can be read, modified, or deleted manually just by pressing F3 on MetaTrader.

if you run another indicator/EA that was written by a lazy programmer, it can easily delete all of your GVs.


Alternatively, you can use a file to store the necessary values.

Thank you very much!
Is GlobalVariableGet() considered as use?
Because I use GlobalVariableGet() for all of my GVs at start of the new week. But they have disappeared...

 
HosseinKOGO: I noticed my GVs disappeared after 4 weeks.
HosseinKOGO #: Is GlobalVariableGet() considered as use?

Perhaps you should read the manual. Global Variables of the Terminal - MQL4 Reference
   How To Ask Questions The Smart Way. (2004)
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

Global variables are kept in the client terminal for 4 weeks since the last access, then they will be deleted automatically. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well.
 
Thank you William for your information <3
Reason: