I did it as you suggested but it doesn't work properly yet. This the new structure now:
https://fxdreema.com/shared/oHOYeAtsc
Now all 'pink' things have a 'For Each Trade' above except on blocks 12 and 13. I don't know why but they already work correctly. The problem now is that blocks 48 and 49 are not catching the price levels they should. It is true that no more alien SL levels are taken from other charts. Now they are caught from the current chart, but incorrectly.
I show some examples. As you can see I added a comment block in which I show all relevant SL levels for the EA: the initial one, the one related to the MA and finally the one activated by the trail stop.
First example:

Here the trailing stop value is exactly the same as the MA one. As the trail stop conditions were not met at this point, it should be 0 but I took the wrong value.
Second example:

Similar situation, but in this case the value taken is the initial SL. As in the previous case, it should be 0.
Third example

In this case the trailing stop effectively moves as required (upper red line), but the value caught is still the one corresponding to the MA.
All blocks are functioning correctly except those planned to take the real value of the Trailing stop.






