Skip to content
All library documents

Managing Prop Firm Drawdowns with Two-Stage Equity Controls

Article MQL5 code base

Summary

This document describes an expert advisor designed to monitor a trading account against daily loss limits. It uses a two-stage response: at a warning threshold, it partially closes the worst-performing open position to reduce exposure; at the hard daily limit, it attempts to close positions rapidly. Inputs let the user set the maximum daily loss, mitigation threshold, partial-close fraction, and push notifications.

The described implementation calculates the day’s starting balance from account history, including realized profits, commissions, and swaps. It also maintains an on-chart dashboard and recreates it if deleted. The text explains the intended logic and structure, but provides no test results or evidence that panic closing can bypass broker requotes under live market conditions. The method is a risk-control mechanism, not a trading strategy, and its effectiveness depends on broker execution, market liquidity, and correctly configured limits.

Key ideas

  • The advisor uses a warning threshold to trigger a partial close of the worst-performing position.
  • A separate hard threshold triggers an attempt to close positions quickly when the daily loss limit is reached.
  • Daily starting balance is calculated from account history, including realized results, commissions, and swaps.
  • The document describes functionality but offers no empirical evidence of live execution performance.

Tags

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