geraked / metatrader5

Implementation of Trading Strategies for Backtesting in MetaTrader 5
MIT License
102 stars 35 forks source link

Using the header file WinINet.mqh in MT4 #3

Open SakshamSolanki09 opened 7 months ago

SakshamSolanki09 commented 7 months ago

Hi Is there any way this would work if I just used "WinINet/1.6" for user agent as I am using this in mt4 and the only part not working is:

TerminalInfoString(TERMINAL_OS_VERSION)," TerminalInfoString(TERMINAL_CPU_NAME), Since MQL4 does not support those constants. I tried changing it to following but to no avail.

string GetUserAgent() { return StringFormat( "%s/%d (%s; %s; %s %d Cores; %dMB RAM) WinINet/1.6", TerminalInfoString(TERMINAL_NAME), TerminalInfoInteger(TERMINAL_BUILD), "Windows NT 10.0; Win64", TerminalInfoInteger(TERMINAL_X64) ? "x64" : "x32", "amd64", TerminalInfoInteger(TERMINAL_CPU_CORES), TerminalInfoInteger(TERMINAL_MEMORY_PHYSICAL) ); }

any help is highly appreciated thanks alot.

DevLucem commented 3 weeks ago

Did you manage to solve this @SakshamSolanki09?