Guides MT5
How to close all MT5 trades automatically at a loss limit
The problem: stop losses work per trade, not per day
Every MT5 position can have its own stop loss, and that is useful. But a stop loss only knows about its own trade. It does not know that you already lost three times today, or that you have four positions open in correlated pairs that are all moving against you at once.
A daily loss limit works at the account level. It says: if my account is down by a set amount since the start of the day, close everything and stop. MetaTrader 5 has no setting for that. Your broker's stop-out level is the only account-wide close, and it is designed to protect the broker, not your plan. By the time it triggers, most of the margin is gone.
Step 1: decide the number and where it is measured from
Before you can close at a limit, you need the limit in money. Pick an amount or a percentage, and decide whether it is measured from your balance or your equity at the start of the day. The difference matters when you hold trades overnight, because equity includes open profit and loss and balance does not.
Write down the equity level at which you stop. For example, if you start the day with $10,000 of equity and your limit is 2%, your stop level is $9,800.
To work out the stop level for your own account, use the daily drawdown calculator.
Step 2: closing everything by hand in MT5
If you watch the screen, MT5 gives you a fast way to flatten the account once you reach your number.
- Open the Toolbox window (Ctrl+T) and select the Trade tab.
- Right-click any position and open the bulk operations menu.
- Choose the option to close all positions. Then delete any pending orders, so nothing reopens later.
- Close the platform, or at least close the chart, and do not trade again until the next day.
Why the manual method often fails
The manual close is only as good as the person pressing it. You may be away from the desk when a news release moves the market. You may be in the middle of a losing streak and decide to give it ten more minutes. An Expert Advisor may keep opening trades after you closed the last batch. And nothing stops you from opening a new trade a minute after you closed everything.
A limit that relies on you acting at your worst moment is a hope rather than a rule. That is why many traders want the close to happen automatically.
Automatic option 1: an Expert Advisor on your terminal
An Expert Advisor (EA) is a program that runs inside MT5. An equity-protection EA watches account equity and closes all positions when it falls below a level you set. It reacts quickly because it sits inside the terminal.
The catch is that an EA only runs while that terminal is open and connected. If your computer sleeps, loses internet or restarts for an update, the protection stops with it. Many traders solve this by running MT5 on a virtual private server (VPS). Also check that the EA blocks new trades after it fires, not only closes the ones that are open.
Automatic option 2: a cloud service
A cloud service connects to your MT5 account from its own servers and watches it continuously, so it keeps working with your computer off. There is nothing to install in MT5. The trade-off is that you give the service your MT5 trading password so it can close positions, and the account is reached from a different location than your own computer.
Where LossGuard helps
LossGuard is a cloud service of that kind. You set a daily loss limit as a percentage or a fixed amount. When the account reaches it, LossGuard closes all open positions, cancels pending orders and blocks new trades until your daily reset. Any trade opened while the day is locked is closed, including trades from an EA. You cannot unlock the day early.
Closes fill at market, so in fast or gapping markets the final loss can be a little beyond your limit. LossGuard cannot guarantee an exact exit price or any trading result. If you trade a prop firm account, check your firm's rules on third-party tools and remote logins before connecting.
You can try it on one account with a 7-day free trial, no card required: start your free trial.
FAQ
Can MT5 close all trades at a loss limit on its own?
Not as a built-in daily rule. You can close everything by hand through the bulk operations menu, or use an EA or an outside service to do it automatically.
Will closing everything stop my losses at exactly my number?
Not always. Close orders fill at the market price, which can move between the moment the limit is reached and the moment the order fills. Build a small buffer into your limit.
What about pending orders?
Cancel them too. A pending order left in place can open a new position after you have stopped for the day, which defeats the point of the limit.
Try LossGuard
7-day free trial on your first account, no card required. $20 per account per 30 days after that.
This guide is general information, not investment advice, and no tool can guarantee any trading result. LossGuard is not affiliated with any prop firm. Check your firm's rules before connecting a challenge account.