How to recover from "shutdown by timeout"?

 

Hello,

I have a script that is contantly running (while (!IsStopped())) and looks at market info and prints the values to the log.

If my intenet is diconnected and than connected again my terminal can recover and reconnect but my script was terminated:

16:06:00 PrintValues GBPUSD,H1: shutdown by timeout
16:06:00 PrintValues GBPUSD,H1: uninit reason 4
16:06:00 PrintValues GBPUSD,H1: removed

How can I automatically start the script again after the connection was established or can I tell the script to ignore timeouts?

Thanks.

 
MosheElisha:

Hello,

I have a script that is contantly running (while (!IsStopped())) and looks at market info and prints the values to the log.

If my intenet is diconnected and than connected again my terminal can recover and reconnect but my script was terminated:

16:06:00 PrintValues GBPUSD,H1: shutdown by timeout
16:06:00 PrintValues GBPUSD,H1: uninit reason 4
16:06:00 PrintValues GBPUSD,H1: removed

How can I automatically start the script again after the connection was established or can I tell the script to ignore timeouts?

Thanks.

Why not just say: while(true) ? U might have to put a sleep in to make sure it doesn't get stuck but I use a while(true) in an ea and it is ok just takes a few seconds to force a deinit when I switch charts or whatever.

 
endo77 wrote >>

Why not just say: while(true) ? U might have to put a sleep in to make sure it doesn't get stuck but I use a while(true) in an ea and it is ok just takes a few seconds to force a deinit when I switch charts or whatever.

I am not using while (true) because I read that IsStopped is better - '"shutdown by timeout" message??'

 
MosheElisha:

I am not using while (true) because I read that IsStopped is better - '"shutdown by timeout" message??'

Well, it's obviously causing a problem for you. A timeout will trigger the condition IsStopped so....

Reason: