how to avoid the unexpected program freezing

 

Hi my friends,

I faced a problem during checking my written indicator. It sometimes doesn't execute properly , I mean, generally , my indicator execute well but sometimes when I change my input ( the number of my preferred candle) it doesn't do anything but when I change my time frame on the chart (for example from D1 to H4) it again executes normally, even if I afterward change it back to the time frame that it didn't performed well.

And the most interesting thing is that when I remove my indicator from the chart and I attach it again , when I check it on the initial time frame that it had problem, it executes properly and without any necessity to change the time frame!

 I'd appreciate if anyone could help me regarding the matter.

 
parham.trader:

Hi my friends,

I faced a problem during checking my written indicator. It sometimes doesn't execute properly , I mean, generally , my indicator execute well but sometimes when I change my input ( the number of my preferred candle) it doesn't do anything but when I change my time frame on the chart (for example from D1 to H4) it again executes normally, even if I afterward change it back to the time frame that it didn't performed well.

And the most interesting thing is that when I remove my indicator from the chart and I attach it again , when I check it on the initial time frame that it had problem, it executes properly and without any necessity to change the time frame!

 I'd appreciate if anyone could help me regarding the matter.

You have to check your code, it's buggy.
 
angevoyageur:
You have to check your code, it's buggy.

Dear "angevoyageur",

Thank you for your response,

But previously I have written it in mql4 and it didn't have any problem but when I rewrite it in mql5 it has bug, how is it possible.

and the most interesting thing is that, sometimes it executes well but in another time it makes an error with the exact conditions that it had in the previous time!

and other thing is that it performs well in some servers but again makes errors in some other servers. 

Do you still believe that it refers to my code and it has bug or you suppose it might be due to other problems?

thanking in advance for your time. 

 
parham.trader:

Dear "angevoyageur",

Thank you for your response,

But previously I have written it in mql4 and it didn't have any problem but when I rewrite it in mql5 it has bug, how is it possible.

and the most interesting thing is that, sometimes it executes well but in another time it makes an error with the exact conditions that it had in the previous time!

and other thing is that it performs well in some servers but again makes errors in some other servers. 

Do you still believe that it refers to my code and it has bug or you suppose it might be due to other problems?

thanking in advance for your time. 

Yes, I still think your code is buggy. If you need help, please post your code.
Reason: