Skip to content
All library documents

Account-Wide Drawdown and Position Loss Protection in MT5

Article MQL5 code base

Summary

This document describes a MetaTrader 5 expert advisor designed to enforce account and trade level risk limits. It monitors daily and overall drawdown, allows a safety buffer before a stated firm limit, and can close open positions and remove pending orders after a limit is reached. It also describes an optional per-position loss cap and the ability to stop trading after a single trade breaches its limit.

The advisor is presented as a monitoring and protection tool, not a signal generator or strategy. It is said to check risk on ticks and at regular intervals, support server-specific trading day rollovers, and retain its status after a terminal restart. The document offers feature descriptions rather than test results, so it does not establish how reliably the tool handles broker or platform edge cases. Its limits must be configured to match the account’s actual rules; the listed defaults are examples, not universal safeguards.

Key ideas

  • The advisor monitors daily and total account drawdown limits.
  • It can close positions and cancel pending orders after a breach.
  • Optional controls cap losses on individual positions and can stop further trading.
  • The document provides feature claims, not performance or reliability evidence.

Tags

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