Download MetaTrader 5

Timer Problem

To add comments, please log in or register
Write your articles using our editor. It is convenient!
sahlih2000
88
sahlih2000 2015.04.01 22:43 

hello

please help me i used timer function EventSetTimer EventSetMillisecondTimer ... my code works fine but after hours Timer stops and it can not works, it stops before 24 hours of work , i use some externel function CopyFileW CreateDirectoryW , i has asked my friend and he have like same problem


thank you

Drazen Penic
2544
Drazen Penic 2015.04.01 22:53  

Did you check log files?

If there is no error in the log file, you will have to show code.

sahlih2000
88
sahlih2000 2015.04.01 23:56  
drazen64:

Did you check log files?

If there is no error in the log file, you will have to show code.

hello

i have no error in the log and in my code timer stoped but OnTick has not stoped

Drazen Penic
2544
Drazen Penic 2015.04.02 00:01  

Why would OnTick() stop?

You should declare OnTimer() function. That function will be called when Timer event occures.

What exactly is happening and what do you expect to happen? 

Stuart Browne
5816
Stuart Browne 2015.04.02 00:14  
sahlih2000:

hello

please help me i used timer function EventSetTimer EventSetMillisecondTimer ... my code works fine but after hours Timer stops and it can not works, it stops before 24 hours of work , i use some externel function CopyFileW CreateDirectoryW , i has asked my friend and he have like same problem


thank you

It's not documented anywhere but I wonder if the millisecond timer is keeping an internal count somewhere and eventually overflows the upper limit of int (2 147 483 647). Would be pretty easy to put a counter on it and see if that is the case.

The easiest way to try to get around it would be to destroy the timer say once an hour and then recreate it. Might even be enough just to change the timer interval and then change it back?

Either way, I'd suggest sending a bug report to Service Desk. And please report back here so others can learn from the problem :)

Cheers

sahlih2000
88
sahlih2000 2015.04.02 00:16  
drazen64:

Why would OnTick() stop?

You should declare OnTimer() function. That function will be called when Timer event occures.

What exactly is happening and what do you expect to happen? 

hello

OnTick() did not stop ,

but i tested no this

 

EventKillTimer();

if(!EventSetTimer(1)){Print("Time Pr.."+GetLastError());return(0);} ,

i has get error 4024  but after some hours i will get only 4024 error and timer will stop

Drazen Penic
2544
Drazen Penic 2015.04.02 00:44  

Error 4024 is internal error:

#define ERR_INTERNAL_ERROR                         4024   // new MQL4

 You should contact Service desk and send them description of the error.

You will find Service Desk link on your profile page.

sahlih2000
88
sahlih2000 2015.04.02 00:44  
Filter:

It's not documented anywhere but I wonder if the millisecond timer is keeping an internal count somewhere and eventually overflows the upper limit of int (2 147 483 647). Would be pretty easy to put a counter on it and see if that is the case.

The easiest way to try to get around it would be to destroy the timer say once an hour and then recreate it. Might even be enough just to change the timer interval and then change it back?

Either way, I'd suggest sending a bug report to Service Desk. And please report back here so others can learn from the problem :)

Cheers

thank you very much , we will compte we have mny vps and we started the test , i think the problem from metatrader , i has maked destroy every 1 second , but it stoped too , i will contact the support

thank you

sahlih2000
88
sahlih2000 2015.04.02 01:00  
drazen64:

Error 4024 is internal error:

 You should contact Service desk and send them description of the error.

You will find Service Desk link on your profile page.

thank you my friend
To add comments, please log in or register