custom max ontester

 
Hi, 
In mt4 there is a custom optimisation. In mt5 thiere is custom max. How can i reproduce the old optimisation?

With the new optimization,   ontester returns the maximum of the custom function, not the value at the end of the period of simulation. 

I need a custom function without the max info the calculation. 
How can i do it?