The debugger works fine.
Use DebugBreak();.Debugger works only for scripts
Fore more info read
The Debugger – a Novelty of MT5
For a mq5 file with .mqh includes, make sure your source files and .exe are located within the Metatrader directories. That is, move your development code into these directories, and then open these files within the editor and start debugging...
I tried to debug a Custom Indicator and nothing happened. Searching the Help topics was not too helpful. The Meta Editor User Guide says that
"In order to start debugging, the window of the main file of the project must be active (*.MQ5)."
Then I wanted to find out what the "main file" really means and found this:
"The main file of a project is the MQ5 file that contains the so-called entry points, the set of predefined functions that initialize the working of application (for example, OnInit(), OnStart(), OnChartEvent(), etc.)."
Then I looked at some of the Custom Indicators (AMA, Envelopes) which came with the installation and found that they do have OnInit() functions, just like some of the Expert Advisors I looked at (MACD Sample, Moving Average).
So what is the real definition of the "main file"? Or why can't Custom Indicators be debugged?
Taking this a step further, could Custom Indicators be debugged by using "Step Into" if I called them from a (dummy) expert advisor?
I find it hard to believe that no debugging would be available for Custom Indicators.
Thanks in advance...
- 2009.11.23
- Андрей
- www.mql5.com
I tried to debug a Custom Indicator and nothing happened. Searching the Help topics was not too helpful. The Meta Editor User Guide says that
"In order to start debugging, the window of the main file of the project must be active (*.MQ5)."
Then I wanted to find out what the "main file" really means and found this:
"The main file of a project is the MQ5 file that contains the so-called entry points, the set of predefined functions that initialize the working of application (for example, OnInit(), OnStart(), OnChartEvent(), etc.)."
Then I looked at some of the Custom Indicators (AMA, Envelopes) which came with the installation and found that they do have OnInit() functions, just like some of the Expert Advisors I looked at (MACD Sample, Moving Average).
So what is the real definition of the "main file"? Or why can't Custom Indicators be debugged?
Taking this a step further, could Custom Indicators be debugged by using "Step Into" if I called them from a (dummy) expert advisor?
I find it hard to believe that no debugging would be available for Custom Indicators.
Thanks in advance...

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can anyone confirm if the debugging option in the meta editor is working?
I followed the steps in the help topics. I set my Symbol in the Options to EURUSD, my period to 1M. Added a couple of break points, started debugging and nothing happens.
I'm running windows XP 64bit
please let me know if anybody require more info.