Hello.
I figure out MT5 delete all saved globals when Windows restart in time when MT5 work.
Is there any way to stop MT5 from deleting global variables at the time of Windows restart?
Or better use another way to save important information?
no it does not, they remain for 4 weeks after last access.
but if you want another way you will need to store data to files.
Want be sure I understand you correct. Is that mean no way get this globals?
I know what happned mainly with globals .
My question is only about this particular problem when MT5 works with saved globals and the system restarts.
And thanks , I know about files, but it's a bit work for recoding :)
So try saved some globals in MT5. Then simulate restart system with running MT5 and you will see clean property globals.
Globals stay if we before simulate restart close MT5.
In MT4 global stay, but in MT5 it clean. It why I sak.
There must be something wrong on your system as that is that is not the general case for most users of MetaTrader 5.
Maybe the directory permissions are incorrect, or some kind of misconfiguration, or there are corrupt files, or your MetaTrader 5 terminal is not shutting down properly and not flushing files correctly. Maybe your shutdown process is causing the terminal to be forced to shutdown prematurely and does not complete its shutdown cycle correctly.
In my own case, the Global Terminal Variables persist between restarts with no issues, on both MT5 and MT4.
EDIT: In your MQL5 code, force flushing the GTVs and see if the data file is updated on the disk. If it does not, then there is a problem at the file level. If it does, then MT5 may not be being shutting down properly.
Forcibly saves contents of all global variables to a disk
So try saved some globals in MT5. Then simulate restart system with running MT5 and you will see clean property globals.
Globals stay if we before simulate restart close MT5.
In MT4 global stay, but in MT5 it clean. It why I sak.
It's possible to lose some global variables on unexpected system restarts:
- www.mql5.com
All i can tell you is this from bad experience which lost me money from EA that i bought that was using MT5 global variables
If you want peace of mind, dont have anything to do with mt5 global variables. IN my case the data only lasted for a month each time and i did not realise this so all my EA was getting lost and positions were not managed.
Nobody including the makers of mt5 seems to have a clue about the lifestyle of global variables, if you intend to trade with real money, dont use any EA that relies on global variables.
Store all your data in files folder if you dont want to loose your data- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello.
I figure out MT5 delete all saved globals when Windows restart in time when MT5 work.
Is there any way to stop MT5 from deleting global variables at the time of Windows restart?
Or better use another way to save important information?