Skip to content
All library documents

Automating Take-Profit and Stop-Loss Levels for Open Positions

Article MQL5 code base

Summary

The document explains an automatic take-profit and stop-loss feature that attaches predefined exit levels to each newly opened position. The trader can set thresholds using a fixed pip distance, a percentage of account balance, or technical price levels. When a threshold is reached, the position is intended to close to realize gains or limit losses, reducing the need for constant manual monitoring.

The page presents automation as a way to enforce planned exits and reduce emotionally driven decisions, and says the feature can be used for XAUUSD. It does not specify how levels are calculated, whether orders are guaranteed to execute at the chosen price, or how position sizing and market gaps affect realized risk. No strategy rules, test results, or evidence for the claimed benefits are provided, so the feature description should not be read as proof that automated exits ensure protection or profitability.

Key ideas

  • An automatic exit feature can attach take-profit and stop-loss levels to each new position.
  • Levels may be set using pip distances, account-balance percentages, or technical prices.
  • The feature aims to reduce manual monitoring and support consistent exit decisions.
  • The page does not explain execution behavior, gap risk, or evidence of trading performance.

Tags

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