Hi Zheka,
I am fine with the For() approach I can filter and selecting the trades I need.
Did you already tried for(closed_trades)with version 1.78 and discovered a bug using break_trades ?

I guess that a specific exit from the loop is required in order to proper reset pointers and other stuff or the following for(closed_trades) will not work properly.

Please report your findings.

Thank You