How to find bug in mql5 code that caouse chart to frezze

 
Hi guys,
I have around 10.000 lines of code. Indicator frezze randomly in MT5. Same code in MT4 have no problems. Is there any way to find out which line of mql5 code causing indicator and chart to frezze?
It usualy frezze after an half of hour. Is any tool in mql5 to show code where indicator stops?
 
  1. There is no “randomly.” It is your loop(s) in OnCalculate, that are not exiting.
  2. Add file lines (with flush), when you enter and exit functions, until you isolate which function is hanging. And then go from there.
 
Igor Zizek:
Hi guys,
I have around 10.000 lines of code. Indicator frezze randomly in MT5. Same code in MT4 have no problems. Is there any way to find out which line of mql5 code causing indicator and chart to frezze?
It usualy frezze after an half of hour. Is any tool in mql5 to show code where indicator stops?
https://www.metatrader5.com/en/metaeditor/help/development/profiling
Code profiling - Developing programs - MetaEditor Help
Code profiling - Developing programs - MetaEditor Help
  • www.metatrader5.com
Profiling means collecting program parameters during its execution. During a profiling, the execution time and the number of calls of individual...
 
William Roeder #:
  1. There is no “randomly.” It is your loop(s) in OnCalculate, that are not exiting.
  2. Add file lines (with flush), when you enter and exit functions, until you isolate which function is hanging. And then go from there.

Thank you @William Roeder for great idea!

Reason: