Thanks for the clarification. I thought I could sum all the profits inside the tmf function.

If I need to use a for loop in the run function, then I will lost the global breakeven if it happens inside the barperiod, thats why I'd like to catch it on a tick level, or should I then use 1 minute candles so that the for loop in the run function does the work?