Skip to content
All library documents

Account and Per-Trade Loss Limits with a Daily Trailing Stop

Article MQL5 code base

Summary

This Expert Advisor is described as a risk-control tool that limits losses at both the account and individual-deal level. When configured percentage limits are exceeded, it closes open positions using market orders and removes pending orders. A daily balance check occurs when the date changes according to trade-server time, which is inferred from the time of the latest quote. The listed controls are a daily loss percentage, a per-deal loss percentage that can be disabled with zero, and a trailing stop percentage tied to daily profit.

The document says the advisor was tried on a real account for FORTS derivatives and on a demo forex account, but gives no measured results, execution details, or comparison with alternative safeguards. Because checks are event-timed and exits use market orders, actual behavior may depend on quote availability and execution conditions. The description explains the intended controls but does not establish that they prevent losses beyond the configured thresholds in all market conditions.

Key ideas

  • The tool aims to limit both daily account losses and losses on individual deals.
  • Exceeded limits trigger market closure of open positions and cancellation of pending orders.
  • A balance check runs when the trade-server date changes, based on the latest quote time.
  • A daily-profit trailing stop and configurable deal limit are among the available controls.
  • The document reports account testing but provides no quantified results or execution guarantees.

Tags

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