Download MetaTrader 5

OnTester().. How to use?

To add comments, please log in or register
Carl Schreiber
6688
Carl Schreiber  

Hi,

My second try to use OnTester().

I have seen from 'Make-A-New-EA' that OnTester() should be a 'root-function' and seems not to be meant to be called from within OnTick() - as I said example-code would be so easy and helpful.

Well OnTester() is a function that returns a double. To the genetic optimizer as this suggests:

"In the genetic optimization descending sorting is applied to results within one generation. I.e. from the point of view of the optimization criterion, the best results are those with largest values (for the Custom max optimization criterion values returned by the OnTester function are taken into account). In such a sorting, the worst values are positioned at the end and further thrown off and do not participate in the forming of the next generation."

But for what is there this ENUM_STATISTICS - ID: STAT_CUSTOM_ONTESTER?

"The value of the calculated custom optimization criterion returned by the OnTester() function"

The use of 'Make-A-New-EA' looks this way:

double OnTester()  {
//---
   double ret=0.0;
   
   return(ret);
}

Add. Question: I think STAT_PROFIT is either positive or negative but e.g. STAT_BALANCE_DD is it always positive or alwys negative - or zero in case of the holy grail ;)

It would help if the reference would inform us about the range of each variable!

Gooly

To add comments, please log in or register