How to get rid of unprofitable positions in the grid by covering them with profitable positions?
For example, we have a grid consisting of Buy positions:

We see that the trend is downward, and the likelihood of the price reversing upward is low. How can we reduce the drawdown in the order grid in this situation and get rid of losing positions?
In this case, you can close the furthest positions, for which the profit + loss will be equal to zero:

This way, we reduced the size of the order grid (the load on the deposit), getting rid of the most distant unprofitable position.
Next, we can open a pending order in place of the closed position, and if the price rolls back, we can close the most unprofitable position again.

But how can you avoid missing the moment when the price rolls back? You can use TradePanel for this. Set it up and enable this feature. TradePanel will track your position profits, and as soon as an opportunity arises to close a losing position with a profitable one, it will do so.
How to set up this functionality:
Go to the "Grids" tab and select the order grid to which you want to apply this functionality:
If you don't have an order grid, you can create one from existing orders and positions by clicking this button and selecting the desired orders and positions:
Go to the AutoCl tab:
Configure the following settings:

1️⃣ Set the minimum loss for the position to which the function should be applied.
2️⃣ Set the profit that should remain after the function closes positions.
3️⃣ Set the number of profitable positions the function can use to close a losing position.
4️⃣ Enable the checkbox.
For example, the following parameters were set:
Minimum loss -$30,
Additional profit $10,
Maximum number of profitable positions used 3.
According to these settings, the function will search for positions with a loss of at least -$30. As soon as such a position appears, TradePanel will begin matching it with profitable positions.
Profitable positions will be selected such that the profit from profitable positions offsets the loss from an unprofitable position, with a residual profit of at least $10. One to three profitable positions can be used to cover the loss.
As soon as profitable positions are found that offset the unprofitable position, the function will immediately close these positions and continue searching for new unprofitable positions.




