If positions get sold with loss in your trading bot while you haven't configured this, you are using trading signals or you're trading illiquid trading pairs:
Trading signals
In the trading signal configuration, there are options for "Signaler config" and "Sell signals"; turn these off to prevent positions from being sold at a loss.
Example of the trading signals config:
Liquidity of trading pair
When markets are illiquid (experiencing low trading volumes), they often have a thin order book. In such scenarios, if a trader places a large sell order, it may result in a percentage loss greater than expected, as the position's value could significantly drop below your set sell parameters.
Market order
In combination with illiquid markets, market orders execute immediately when the stop-loss triggers a sell. They use various order values from the order book to fulfill the trade.
Consequently, the actual sell rate can be much lower than your configured Take profit, Stop-loss or other sell setting.
Have you considered using limit orders instead? This approach may help avoid selling positions with bigger losses than intended, but could result in partial fills of orders, resulting in bags.