Shutdown by timeout

 

Hi everyone,

I'm new to the forum so excuse me if this is not the right place to ask this question. I have written a script for MT4 and basically it waits until the start of a new daily bar to perform it's calculations. The problem I have is that after a short while the script seems to hang up and, when I go to remove it, I get 'shutdown by timeout' in the experts tab of the terminal window. The beginning code goes like this:

timeold=TimeDay(Time[0]);

timenow=timeold;

while(timeold == timenow)

{

timenow=TimeDay(Time[0]);

}

Does anyone know why this would be occurring? Is there a time limit on a script executed on a chart?

Also I have been testing with FXDD because they are one of the few companies who incorporate the odd Sunday data and thus allow me to create automated pivot points without Monday always being messed up. However they are not supporting MT4 in a live environment. Does anyone know a company that supports MT4 and does not add the three or four bars of Sunday night data?

Thanks for all your help.

 

According to your code, this will run everytime.

timeold=TimeDay(Time[0]);

timenow=timeold;

while(timeold == timenow)

{

timenow=TimeDay(Time[0]);

}

You have set both timeold and timenow to the same thing before the while statement. Now assuming this is what you want to do, how do you exit this while until the day changes. It will stay in this loop all day.

 

It will only stay in the loop until the day changes (ie next daily bar). It will then perform it's task once and exit. That's what I want. Basically I want to start it running before going to bed and know that it'll do it's job as soon as a new daily bar starts. Note this is a script not an EA.

 

i have the same problem too

hi RObM....do you have to solve the "shutdown by timeout"? problem...

cause i don't fix my script.