A static variable stores its value till next run of EA, doesn't it ? - page 2

 
Thanks to everybody for this hot discussion. I'm glad to see much attention :-)
 
onewithzachy:
If you want to retain value of variables - when changing extern input or changing TF or changing symbol - then you can save them in deinit.

On changing TF/symbol, deinit and init will be called. Global and static variables are not reset.

But on BSOD, or power glitch, reboots, etc, deinit will not be called and GVs by GlobalVariableSet() will not be written to disk.

Persistent storage requires you to write a disk file when anything saved has changed, each time (each tick)

 
WHRoeder:

On changing TF/symbol, deinit and init will be called. Global and static variables are not reset.

But on BSOD, or power glitch, reboots, etc, deinit will not be called and GVs by GlobalVariableSet() will not be written to disk.

Persistent storage requires you to write a disk file when anything saved has changed, each time (each tick)


Got it :D
Reason: