Ok, just test the different money management options in an EA that looks like the first example here https://fxdreema.com/examples
It's also possible to use Condition to check the equity vs balance and then use "Close positions" to close.
Or, instead of Condition, use "Check profit (unrealized)".
Or, take a look at these Bucket blocks, they can calculate the total profit/loss from multiple positions.