![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Added to OnInit():
int counter=1;
do
{
ResetLastError();
EventSetMillisecondTimer(Timer);
error=GetLastError();
Print("EventSetMillisecondTimer. Attempt=",counter," Error=",error);
if(error!=0) Sleep(1000);
counter++;
}
while(error!=0 && !IsStopped());
And observed the following. Five failed attempts. At the same time I close the adjacent terminal, which has no charts, but only copying trades stands. Immediately I have good luck. The timer initialized.
Thank you. This is a really working idea. I will take it on board.
By the way, recently updated mt5 - there are less brakes. maybe the timer will stop glitching on UPU ? - not checked, my timer works fine - not working for clients.
the error is always the same 4024
I have,"cannot set millisecond timer (500)" message.
Dear Admin,
today the timer error appears on almost all clients, what can it be ? why all this and what to do ?
error 1158
Maybe this will help ?
But, on my latest build from Feb 3, Intel Windows 64 processor - everything is ok.
I.e. the problem is only with others. :-(
a little more information, the error does not appear immediately, about an hour or two later:
0 09:10:37.921 Exp MASTER for MT4 EURGBPpro,H1: Balance =34876-34876
0 09:10:37.947 Exp MASTER for MT4 EURGBPpro,H1: initialized
0 09:10:37.970 Exp MASTER for MT4 EURCADpro,H1: RUN 2017.02.06 04:11
0 09:10:37.970 Exp MASTER for MT4 EURCADpro,H1: Balance =34876-34876
0 09:10:37.971 Exp MASTER for MT4 EURCADpro,H1: initialized
1 11:52:23.877 Exp MASTER for MT4 EURGBPpro,H1: EventSetTimer(700) error 1158
0 11:52:23.887 Exp MASTER for MT4 EURGBPpro,H1: Error with timer 0
I just looked on my second computer, the same error popped up. The timer stopped working, the Advisor drained :-(
Dear Admin,
today the timer error appears on almost all clients, what can it be ? why all this and what to do ?
error 1158
Maybe this will help ?
But, on my latest build from Feb 3, Intel Windows 64 processor - everything is ok.
I.e. the problem is only with others. :-(
ERROR_NO_MORE_USER_HANDLES 1158 (0x486)
The current process has used all of its system allowance of handles for Window Manager objects.
Error 1158 is a system error saying that the timer cannot be set
ERROR_NO_MORE_USER_HANDLES 1158 (0x486)
The current process has used all of its system allowance of handles for Window Manager objects.
Yes, but it started to appear quite recently, after the December build.
And not for all, not always. And on different Expert Advisors.
How can it be solved, what are the options?
I had it in the initialization function. - The error was showing and the EA did not work.
I have also put it in Tick - in case the timer is not set, the EA will work by ticks (even though this is a large crutch).
what other options?
And most importantly: Why does this happen? how to prevent it? not enough space? not enough memory? processor?
I really hope for help, or at least solutions. I'm not the only one who suffers.
Open and close charts. Run Expert Advisors and indicators. And watch how the number of handles changes
First, observe in task manager how many handles the client terminal is using.
Open and close charts. Run experts and indicators. And watch how the number of handles changes
After restarting everything is OK, but after 1-2 hours the timer goes off again
Right-click on the row with column headers - "Select columns". Check the "Descriptors" box