Hi guys,
I need your help. I am new to developing EAs and I have troubles debugging my code.
If I use the debugging tool, after defining my breakpoints and start the tool, the application doesn't do anything: it runs (I can pause it or stop it), but it doesn't go to the any breakpoint or finish by itself (the step into, over and out are disabled).
And if I try to debug it using Print and Alert messages running the code through the Strategy Tester, the messages displayed in the journal are inconsistent: not all messages are displayed (even if I put one after another, the second can print but not the first one), and there are runs where the messages displayed differ from the previous run, even without changing the code, symbol or period (the only change is an extra compilation).
Additionally, during the run, the system opened a position without displaying the message I put before the code requests it (same issue specified above), and what is even worse is that the opened position didn't have the stop loss value I specified (it is 0 and therefore it stays open for longer), so it would seem it is opening by itself without running my code.
What can I do? I am getting frustrated.
Thanks in advance,
Cesar
I have the same issue regarding debugging and print in testing, so can't help there :(.
Regarding SL and TP, MT5 does not accept (and therefore will not execute) SL and TP. So, instead SL and TP, use opposite pending orders as TP and SL, for example, if we open buy 1 lot, then also open 1 lot sell limit as TP and 1 lot sell stop as SL.
Hi guys,
I need your help. I am new to developing EAs and I have troubles debugging my code.
If I use the debugging tool, after defining my breakpoints and start the tool, the application doesn't do anything: it runs (I can pause it or stop it), but it doesn't go to the any breakpoint or finish by itself (the step into, over and out are disabled).
And if I try to debug it using Print and Alert messages running the code through the Strategy Tester, the messages displayed in the journal are inconsistent: not all messages are displayed (even if I put one after another, the second can print but not the first one), and there are runs where the messages displayed differ from the previous run, even without changing the code, symbol or period (the only change is an extra compilation).
Additionally, during the run, the system opened a position without displaying the message I put before the code requests it (same issue specified above), and what is even worse is that the opened position didn't have the stop loss value I specified (it is 0 and therefore it stays open for longer), so it would seem it is opening by itself without running my code.
What can I do? I am getting frustrated.
Thanks in advance,
Cesar