Killing running OnStart function

 

Hi Community!

    Is it possible to kill the running OnStart script if it delays too much to finish? Would it be safe? I want to restart (call) the OnStart () after killing it in the case the work that must be done was not progressing in time as expected.

Regards

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...
 
AnarcoPhysic:

Hi Community!

    Is it possible to kill the running OnStart script if it delays too much to finish? Would it be safe? I want to restart (call) the OnStart () after killing it in the case the work that must be done was not progressing in time as expected.

Regards

You should add a time tracker for each time consuming part of your code, find critical points and optimize the logic.

 
Mohammad Hossein Sadeghi:

You should add a time tracker for each time consuming part of your code, find critical points and optimize the logic.

Thank you for your help! I will do it!