Skip to content
All library documents

Automating Drawdown Limits and Position Checks in an MT5 Risk Manager

Article MQL5 articles

Summary

The article describes an include-file risk manager for MetaTrader 5 expert advisors. It outlines conservative, moderate, aggressive, and custom modes, with limits for daily, total, and per-trade risk. It also compares balance-based and equity-based drawdown calculations, then describes an adaptive option that uses equity when open positions are losing and balance in other conditions.

The proposed class checks risk as prices update, warns as daily loss limits approach, blocks new trades, and can close open positions after a breach. It also offers a position-opening method that checks limits and calculates an acceptable size, while saving state across terminal restarts. The article says the system was tried with a martingale grid, but the supplied text omits the test details and supporting results. Its claims of safety and effectiveness are therefore not independently substantiated here; automated controls cannot make an aggressive strategy safe or guarantee profitability.

Key ideas

  • The proposed manager sets daily, total, and per-trade limits through selectable risk modes.
  • It offers balance, equity, combined, and adaptive approaches to measuring drawdown.
  • The system can warn near a limit, block trading, and close positions after a breach.
  • It is designed to preserve settings and account state across terminal restarts.
  • The martingale-grid test is described without enough detail to assess its evidence.

Tags

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