Skip to content
All library documents

Daily Loss Limit Controls That Flatten and Lock a Trading Account

Article MQL5 code base

Summary

Equity Guard is described as an account-level risk tool that tracks losses from a daily reference point and reacts when a configured trigger is reached. The reference can be the account’s balance or equity at the daily reset, and the limit can be expressed as a percentage of that value or as a fixed cash amount. A separate trigger percentage can make the tool lock the account before the full daily limit is reached. When activated, it closes open positions and pending orders, then can keep the account flat until the next reset.

The description also covers manual close and lock controls, alerts, persistent panel state, and support for hedging and netting accounts. Monitoring uses periodic checks alongside ticks and trade events, while reset time is based on broker server time. The material documents configurable behavior, not independently tested reliability or execution quality. Closing orders remain subject to slippage and broker conditions, and the stated protections depend on correct configuration and operation.

Key ideas

  • The tool monitors account loss against a configurable daily limit measured from a reset-time balance or equity reference.
  • The lock can trigger at a configurable fraction of the full limit and close positions and pending orders.
  • An option can keep the account flat by closing positions opened while the lock remains active.
  • The reset time uses broker server time, and the tool offers manual controls and alerts.
  • The description provides no independent reliability or execution-performance evidence.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.