I think I can use For each closed trade -- Check how it was closed (stop loss) -- once per position -- sell now

I think I can use For each closed trade -- Check how it was closed (stop loss) -- once per position -- sell now

I think only one reversed trade is opened because "Check Type (last loser)" block only loads one trade. The last loser.
Is there a way I can make "For each closed trade" block to only loop trades closed by stop loss
Hi all,
Please I need your help to correctly implement this idea:
If the last closed trade(s) was triggered by stop loss,
open a reversed position.
This works well if just one trade was closed at the same time
But if 2 or more trades were closed at the same time (for example, when 2 or more trades have their stop loss at the same price level) once stop loss is triggered all trades are close but only one trade is re opened in the reversed direction.
I want the number of closed trades by stop loss to be the same number of reverse trades opened
This is easy with Position Close block in the On Trade tab but that is currently not working

Thank you @realjoker, I was aware of that, my groups are defined
Thank you. Using 'For each closed position' worked for the purpose
Position Closed block on MT5 not working on OnTrade tab
Please help.
I found a way that works in MT5
Entered initial balance as a constant then used the above implementation
Regardless, is there a way I can get initial deposit block in MT5 rather than using constant, that way I won't need to manually input the initial balance every time
Thank you @l-andorrà
But I can't find "Trade statistics" on builder
Please direct
I'm using MT5
Hi, please I need your input here
I am trying to make the EA close all trades when my total equity is 10k above the initial opening account balance of 100k.
But with what I have here, the EA does not close trades. Even when my total equity is over 10k from initial opening balance, trades are not being closed

@sktsec
Thanks for reply, I figured it is a problem with the custom indicator. Solved
Please, how do I solve this problem?
Every time I try to download a project, it says there is no connection with website.
I have tried again several times, but the same problem
NOTE: my internet is working perfectly and I have used different browsers
