How to exit/end backtesting/optimization ealry (MT5)

 

Hi,

I whant to abort the backtest on a certain condition. E.g. when reached an amount of tests. Has anybody an idea how to realize in MQL5? 


Thx and regards,


Tom

 
TomBuder:

Hi,

I whant to abort the backtest on a certain condition. E.g. when reached an amount of tests. Has anybody an idea how to realize in MQL5? 


Thx and regards,


Tom


if (conditionfilled) ExpertRemove();
 
Icham Aidibe #:

this does not work

it just Stops the Expert Receiving frame, but not the whole testing process.

(I can provide a full working code if necessary to prove what I am telling)


I also wanted some function similar, or EXACTLY as, pressing the "STOP" button on the strategy tester, but found NO way to do it yet.


or am I doing it wrong? 

(tried to call it inside OnTesterPass() = stops the receiving frame, but optimization keeps running)

(tried it on other functions, also by setting a global boolean variable to control it, variable is modified correctly, then I tried to call ExperRemove() on other Tester functions, none worked as desired [ like pressing the STOP button])


if someone knows how to do it, please inform me. 

thanks


 
You can click stop button with dll. This library can do it (and much much more) https://www.mql5.com/ru/code/26132
 
Enrique Dangeroux #:
You can click stop button with dll. This library can do it (and much much more) https://www.mql5.com/ru/code/26132

Thank you very much!

I will try it!

Reason: