Equity Guard protects the whole account, not a single strategy. Attach it to any one chart and it watches account equity every second.
When a limit is hit, it:
- closes open positions (optional),
- deletes pending orders (optional),
- keeps the account flat until the next trading day: any position opened while locked (manually or by another EA) is closed again,
- sends a popup alert and/or push notification to MetaTrader mobile.
Limits (each one can be turned off with 0):
- Max daily loss, % of the day-start base. Base can be equity, balance or the higher of the two (the way most prop firms calculate it).
- Max daily loss, money in account currency.
- Daily profit lock, % to stop trading after a good day.
- Max drawdown from equity peak, %. Optionally stays locked until you reset it manually.
Details:
- Day boundary is broker server midnight.
- Day-start base, equity peak and lock state are stored in terminal Global Variables, so they survive EA restart, timeframe change and terminal reboot. Tester runs use separate variables and never touch the live state.
- Filling mode (IOC/FOK/RETURN) is detected per symbol, so closing works on any broker.
- Magic filter: -1 = all trades, 0 = manual trades only, or a specific EA's magic number. Note: limits are always calculated on account equity.
- To unlock manually: set "Reset lock and peak now" to true, press OK, then set it back to false.
Limitations:
- The guard reacts after equity crosses the limit. A price gap or fast market can make the final loss larger than the limit (in testing on gold with a 1.5% limit, the worst lock happened at 2.6% because of a market gap).
- Positions cannot be closed while the market is closed. The guard keeps retrying until the session opens.
- Algo Trading must be enabled in the terminal.