Margin shortfall and forced square-off
No indicator warns you that the broker is about to close your trades. The margin screen does, and few people look at it.
When you hold a leveraged position, the broker needs you to keep enough balance to cover the margin. If losses eat into your balance and it falls below what is required, you face a margin shortfall.
The broker may ask you to add funds, or may close some or all of your positions without asking. The close happens at whatever price is available then, often after the worst of the move.
The best protection is to avoid using all your available margin. Keeping a large part of the account unused means a bad move is a loss, not an emergency.
In this simulator you cannot place an order that needs more margin than you have, so notice how much headroom the ticket shows before you trade.