The function from the Indicator "Period conventer Optimized" that update is this:
intUpdateChartWindow(){staticinthwnd = 0;
if(FileHandle < 0){//no HST file opened, no need updating.return(-1);
}if(hwnd == 0){//trying to detect the chart window for updatinghwnd = WindowHandle(Symbol(), NewPeriod);
}if(hwnd!= 0){if(IsDllsAllowed() == false){//DLL calls must be allowedDebugMsg("Dll calls must be allowed");
return(-1);
}if(PostMessageA(hwnd,WM_COMMAND,CHART_CMD_UPDATE_DATA,0) == 0){//PostMessage failed, chart window closedhwnd = 0;
}else{//PostMessage succeedreturn(0);
}}//window not found or PostMessage failedreturn(-1);
}
That looks like the return(-1) statement does a update, maybe I must trie and put a normal Script with a while() loop and the Sleep() statement and in it a update statement return(-1), but then the Script will be finished or not, how woud you do it?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello phy, you are very good in MQL4 programming!
How can I send a update message to a indicator script, I dont do something else before :-) ?
The "Period Converter Optimized" has "update" code in it.
The update is aimed at the window, not the indicator.
The function from the Indicator "Period conventer Optimized" that update is this:
That looks like the return(-1) statement does a update, maybe I must trie and put a normal Script with a while() loop and the Sleep() statement and in it a update statement return(-1), but then the Script will be finished or not, how woud you do it?Its the function PostMessageA(hwnd,WM_COMMAND,CHART_CMD_UPDATE_DATA,0)
that makes the update not retun(-1).