Parsing MT4 config files
Parsing MT4 config files
Loading saved threads...
Woody1193 · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Woody1193
Original post: https://stackoverflow.com/questions/75505964
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I'm trying to write an install script for an MT4 expert advisor. Part of the installation process includes adding an allowed WebRequest URL. I assume this is saved as a setting in
C:\Users\{User ID}\AppData\Roaming\MetaQuotes\Terminal\{Terminal ID}\config\experts.ini
as I can see the allowed URLs there, but I cannot parse this data as no editor I have can decode it. Is this file parsed using a proprietary encoding or is it encrypted in some way? Any help here would be appreciated.
Quote
Report
user22527101 · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: user22527101
Original post: https://stackoverflow.com/a/77071615
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
unfortunately, web requests are encrypted
for security reasons
, so the only way it to add them manually via the terminal or use a third-party dll to execute web requests.
Quote
Report
Woody1193 · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: Woody1193
Original post: https://stackoverflow.com/a/77103494
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
The only solution I could think of to address this issue was to create my own HTTP web request library,
here
, and use it to submit HTTP requests.
#include <mql-http/Request.mqh>
#include <mql5-json/Json.mqh>
int SendWebRequest(const object request) {
string body = ConvertToJSON(request); // You'll have to write your own JSON converter
HttpRequest req("POST", m_send_addr, body);
req.AddHeader("Accept", "application/json");
req.AddHeader("Authorization", m_auth_header);
HttpResponse resp;
int errCode = req.Send(resp);
if (errCode != 0) {
return errCode;
} else if (resp.StatusCode != 200) {
return resp.StatusCode;
} else {
return 0;
}
}
At the moment this is pretty bare-bones but it's open-source so feel free to modify and contribute.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: Woody1193 Source score (net votes, not local likes): 1 Original post: https://stackoverflow.com/questions/75505964 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I'm trying to write an install script for an MT4 expert advisor. Part of the installation process includes adding an allowed WebRequest URL. I assume this is saved as a setting in C:\Users\{User ID}\AppData\Roaming\MetaQuotes\Terminal\{Terminal ID}\config\experts.ini as I can see the allowed URLs there, but I cannot parse this data as no editor I have can decode it. Is this file parsed using a proprietary encoding or is it encrypted in some way? Any help here would be appreciated.
Checking account access…