Skip to content
All library documents

Hidden Stop-Loss and Take-Profit Levels in an Expert Advisor

Article MQL5 code base

Summary

This document describes an expert advisor that monitors trades on a chart symbol and applies stop-loss and take-profit thresholds without placing those levels as visible broker orders. A trader first opens the desired positions, then runs the advisor on a chart for the same symbol and sets the threshold distances in points. The distances can be measured from each trade’s opening price or from the symbol’s current mid price.

The advisor reports the hidden thresholds in the platform’s Experts tab and can optionally draw them as horizontal chart lines. It also posts a message when all trades have closed. The description provides no backtest, execution details, or evidence of performance, and its author says it received little testing and was not tried live. Hidden exits depend on the advisor running and reacting to market prices, so the text does not establish how the system behaves during outages or fast moves.

Key ideas

  • The advisor applies stop-loss and take-profit thresholds to open positions on the chart symbol.
  • Threshold distances can be based on trade entry prices or the current mid price.
  • It can display threshold lines on the chart and report them in the Experts tab.
  • The author cautions that the advisor has not been extensively tested or used live.

Tags

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