debugging: break code runing on Variable1==true
Hello
Is it possible to set a conditional stop in MQL5? For example if Variable1==true
How?
BR
Joze
I have for example over 100x in code this statement:
PREDICTION=+1
Why must I set breakpoint over 100 times instead "somewhere" set only one condition: if PREDICTION==+1 then stop running my code .....
?!
You did not explain yourself properly in your posts. Please explain in detail.
What is it that you want to "stop"?
- Do you want to halt execution in the debugger?
- Do you want to return from the event handler?
- Do you want to stop and remove the program from the chart?
Hello
Is it possible to set a conditional stop in MQL5? For example if Variable1==true
How?
As explained in post #1 by @Dominik Egert
if( Variable1 ) DebugBreak();
Here is the example code from the documentation: Documentation on MQL5: Common Functions / DebugBreak
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- compile the file using F5 //--- in debugging mode, if i == j, stop at the DebugBreak() string for(int i=0,j=20; i<20; i++,j--) { if(i==j) DebugBreak(); } }
Hello
Is it possible to set a conditional stop in MQL5? For example if Variable1==true
How?
BR
Joze