Incorporating stop out info into ontester function

 

Hi,


I am running some optimisations, and with some more aggressive settings, the algorithm performs very good, but when I do a single run, it turns out that stop out occurs.

What would be good, is not to include the original score of how good the algorithm performed, but in case it was terminated by stop out then return 0 as score.

Is there a way or function to query at the end of every pass if stop out happened?

 
pcdeni:

Hi,


I am running some optimisations, and with some more aggressive settings, the algorithm performs very good, but when I do a single run, it turns out that stop out occurs.

What would be good, is not to include the original score of how good the algorithm performed, but in case it was terminated by stop out then return 0 as score.

Is there a way or function to query at the end of every pass if stop out happened?

Yes, you have to use custom criterion in tester, and support it with your code.

This https://www.mql5.com/en/articles/286 article will give you an example which you can adapt to your needs.

 
Enrique Dangeroux:

Yes, you have to use custom criterion in tester, and support it with your code.

This https://www.mql5.com/en/articles/286 article will give you an example which you can adapt to your needs.

Yes, I got that far, but how do I check if it was terminated by a stop out event?

 
pcdeni:

Yes, I got that far, but how do I check if it was terminated by a stop out event?

DEAL_REASON_SO, look it up in the history.

 
Enrique Dangeroux:

DEAL_REASON_SO, look it up in the history.

Thank you!

Reason: