Skip to content
All library documents

Managing Orders with Trailing Stops and Account Profit Limits

Article MQL5 code base

Summary

This document describes a trading-platform expert advisor for managing open orders. It can apply take-profit, stop-loss, and trailing settings to orders, including orders placed from a mobile device. The described tool is not limited to a particular magic number, so its management actions can affect orders across that identifier boundary. Five separate buttons are mentioned, and later updates add controls to close buy orders and sell orders separately.

It also describes account-level rules that close all orders when aggregate profit reaches a configured amount or when losses reach a configured threshold. Setting either threshold to zero disables that automatic closure rule. The material explains configurable functionality rather than a trading signal or tested strategy; it provides no performance evidence, execution details, or safeguards for distinguishing positions that should be managed. Users would need to understand the scope of the EA before applying it to live orders.

Key ideas

  • The EA can manage stop-loss, take-profit, and trailing settings on open orders.
  • It may modify orders placed from a mobile device and does not filter by magic number.
  • Configured account profit or loss thresholds can trigger closure of all orders.
  • Zero disables either aggregate closure threshold.
  • The description gives no evidence about strategy performance or order-handling edge cases.

Tags

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