What if you added a max trade setting to limit the amount of trades. That would prevent it from adding too many trades which might blow an account.
I wasn't so concerned about an account blowing, but rather the EA getting stuck without ever reaching profit.
If the tp was 5 pips and the step was 5 pips it would eventually get profit and close all trades in profit.
If the TP is 5 and the step is 5 and if the intended modification is so trades are made as the price goes in favor of the trades, then as soon as a step is ever reached, the trade would hit TP. So there would never be a basket of trades. So it wouldn't be able to close "all" trades in profit since there would only ever be 1 trade open.
If it gets caught in a range maybe with a max trade of 3 or so would cut down on drawdown.
The drawdown would get locked up though. Let's use my example. The EA makes 3 buy trades and before hitting TP, the market reverses down. Price then reaches the point where sell trades should start being placed. Price keeps going down some so that there are now 5 sell trades. So now there are 3 buy trades in a lot of loss and 5 sell trades in profit. The sell trades profit doesn't overcome the loss from the buy side. So all trades stay open. Then price reverses up again. As long as the price stays within this range (from the highest buy order to the lowest sell order) the EA will never able to close trades since profit will never be reached. The drawdown would also be confined to a certain range too.
Unless your max trades input can be used to sort of reset the EA and start over, I just don't think it will work. Or maybe I'm missing something about the strategy.