How to read the GVARABLIES.DAT file?

 

Hi,

in order to debug I would like to periodically save the file gvariables.dat and read its contents to verify the behavior of the EA.

Does anyone know how to read the file? if I open it with Notepad+ or other programs it's not readable..

Thanks!


 
Davide Abate: in order to debug I would like to periodically save the file gvariables.dat and read its contents to verify the behavior of the EA. Does anyone know how to read the file? if I open it with Notepad+ or other programs it's not readable..Thanks!

You can't edit it in a text editor. It's a binary file, not textual. It's format is not documented but with some effort it can probably be deciphered since it will most likely be an array of a structure consisting of a string, a double and a datetime, with an initial file header. It might have a few extras too.

 
@Davide Abate perhaps it's easier to dump from time to time all of the variable into readable file.
https://www.mql5.com/en/articles/1210 here are some examples.
MQL5 Programming Basics: Global Variables of the Terminal
MQL5 Programming Basics: Global Variables of the Terminal
  • www.mql5.com
This article highlights object-oriented capabilities of the MQL5 language for creating objects facilitating work with global variables of the terminal. As a practical example I consider a case when global variables are used as control points for implementation of program stages.
Reason: