Yes, but open the log folder before MQL4... ....\uniquenumber\log NOT the one on ...\uniquenumber\MQL4\Logs
qjol... the code doesnt work at this time...
the function FindWindows doesn't allow string , request order type
'i' - variable of the same type expected
This code works fine.
#import "user32.dll"
int GetAncestor(int hWnd, int gaFlags);
#import
void updatelog()
{
int hwnd = GetAncestor(WindowHandle(Symbol(),Period()),2); // find the Terminal handle no.
PostMessageW(hwnd,WM_COMMAND ,33101,0); // open the folder contains the log files
//-----
bool find=false;
for(int i=0;i<20;i++)
{
Sleep(100);
int LogHandle= FindIfDirOpened();
if(LogHandle!=0)
{
find=true;
PostMessageW(FindIfDirOpened(), WM_CLOSE, 0, 0); //close the folder
}
else if(find)
{
break;
}
}
}
int FindIfDirOpened()
{
// string log = "logs";
string classname="CabinetWClass";
int handle = FindWindowW(classname ,NULL);
return(handle);
}
void OnTick()
{
//---
if (Seconds()<3){ if (Minute()<20 ) updatelog(); if (Minute()>40 ) updatelog();/*Print(Seconds());*/}
}
Hi carlos.rav, Does your code work in mql4? if not, what modifications does it need to work as it does in mql5?
This solution does not work, log cache does not get dumped to the log files.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
unfortunately I have not found yet the right way how to do this but at least i found a detour if anyone has a direct way to do that i would be grateful
the way i found is by forcing the terminal to save the data through opening the folder that contains the log files