Debugging an EA

 

Hello,

I need some advice on debugging MQL code. I've written an EA based on a system I formulated, but it needs to be debugged and I can't figure out how to do that in MT4. Any suggestions on how to debug an MA?

 

I suggest you post the code here and someone will surely help u out.

 

debugging in MT4 is a painful process, as there is no internal step/break/watches, like most debuggers. I came up with a debug indicator that essentially does the watch part. I'll be unavailable for about a week, but when I'm back, I'll post what I've got here.

 

...that you were going to post?

 

Print messages and variables to journal or file

 

when you totally forget... oops. Anyways, here is the prog. A sample call is in the title section. When callled, it will scroll the data up the screen. No it does not do break points, and watches, but have fun with the code and make it dance.

Hope this helps.

Files:
Debug.mq4  9 kb
 
flexie:
when you totally forget... oops. Anyways, here is the prog. A sample call is in the title section. When callled, it will scroll the data up the screen. No it does not do break points, and watches, but have fun with the code and make it dance.Hope this helps.

Hi All,

Just joined the forum. I am looking for help debuging MQ4 code. Is there an application that I can use to insert breakpoints and watch variable values? Freeware or Shareware?

Thanks in advance.

 
smokey:
Hi All,Just joined the forum. I am looking for help debuging MQ4 code. Is there an application that I can use to insert breakpoints and watch variable values? Freeware or Shareware?Thanks in advance.

no there is not any tool for MT4 which can do that so far...

 

MT4 doesn't have a debugger. The best you can do is using a lot of comment() here and there to display the info.

 
flexie:
when you totally forget... oops. Anyways, here is the prog. A sample call is in the title section. When callled, it will scroll the data up the screen. No it does not do break points, and watches, but have fun with the code and make it dance.Hope this helps.

hey, sorry for the dumb question, but how exactly do you use this debugger? I see the "sample call, but I still don't get it.

 
daminescu:
hey, sorry for the dumb question, but how exactly do you use this debugger? I see the "sample call, but I still don't get it.

Same here! I assumed if I stored your program in Experts/Indicators and attach to chart, it will start "just like that" - that is me doing Tommy Cooper!. Where do you set the "debug" flag? Now, I am showing my ignorance! Never mind. Thanks flexie for sharing!

Reason: