Topic: "wrong server name" if trying to import data from offline MT4
Hi Dr. Popov,
here is another bug: if exporting data from an offline (not connected) MT4 instance via the "EA Studio Data Export script.mq4" and then trying to import the JSON files into EA Studio (drag & drop), EA Studio says "wrong server name" and won´t import the files. The problem (already investigated), is that in the resulting JSON files, there is no server name, they read:
..... ,"server":"","symbol":"AUDUSD", ........
If I change this to something like:
..... ,"server":"My Broker","symbol":"AUDUSD", ......
EA Studio imports the data just fine.
Reason: if MT4 is offline, the:
string server = AccountInfoString(ACCOUNT_SERVER);
that you are using in the "EA Studio Data Export script.mq4" will return an empty string if MT4 is not connected to the brokers server.
I´d suggest that you either change the MQ4 code like this:
string server = AccountInfoString(ACCOUNT_SERVER); if (server=="") server="Unknown";
Or that you change it in EA Studio, so that if the string is empty, it will still add the data into EA Studio but under "Unknown" (or whatever).