Debugging

 

Very open question but I'm hoping to start a discussion and learn some new tricks from you.

I find debugging in mql5 particularly cumbersome after spending some time with Pine Script (please take it easy on me, I'm just learning...)

What are your methods for debugging? Do you use any tricks and want to share? 

 
salvatoreone: Very open question but I'm hoping to start a discussion and learn some new tricks from you. I find debugging in mql5 particularly cumbersome after spending some time with Pine Script (please take it easy on me, I'm just learning...) What are your methods for debugging? Do you use any tricks and want to share? 

Personally, I've never used the MQL debugger not even once. I've never had a need for it. I've always relied on simply "printing" details out to the log during runs in the Strategy Tester.

It also helps that I compartmentalise things and test them separately, making sure of functionality before building on them.

Even in my hay days of major software development in C++ for Windows projects, I followed the same approach and relied very little on the use a debugger.

 
Fernando Carreiro #:

Personally, I've never used the MQL debugger not even once. I've never had a need for it. I've always relied on simply "printing" details out to the log during runs in the Strategy Tester.

It also helps that I compartmentalise things and test them separately, making sure of functionality before building on them.

Even in my hay days of major software development in C++ for Windows projects, I followed the same approach and relied very little on the use a debugger.

Thanks Fernando... I see compartmentalising is the key, can't argue with that. Is there a way to display condition values in the "Data Window" where the other indicator values are shown? I'm guessing I'd need to create an "artificilal" indicator within the EA to be able to see it while debugging on the chart? The indicator would store the condition values as a series such that it can be easily viewed on the chart history... Not sure how to tackle it though.
 
salvatoreone #: Thanks Fernando... I see compartmentalising is the key, can't argue with that. Is there a way to display condition values in the "Data Window" where the other indicator values are shown? I'm guessing I'd need to create an "artificilal" indicator within the EA to be able to see it while debugging on the chart? The indicator would store the condition values as a series such that it can be easily viewed on the chart history... Not sure how to tackle it though.

Yes, you could do that with a "debug indicator". That seems like an interesting approach.

As for the MQL5 debugger itself, as far as I remember seeing in posts by those users that do use it often, the consensus did seem to be that the debugger and profiler can be quite powerful and useful for them. However, I cannot offer you any help with it as I don't use it.