Skip to content
All library documents

Daily High-Low Breakout EA with Pending Orders and Trailing Stops

Article MQL5 code base

Summary

The described expert advisor places a Buy Stop above the previous day’s high and a Sell Stop below its low, with a configurable minimum distance from each level. At the start of a new day, it removes pending orders left over from the prior day and submits a fresh pair. If one side triggers, the remaining pending order is deleted. The code description says this cancellation is handled when a trade transaction reports a market entry. A trailing stop is applied once an opened position is profitable.

Inputs include stop loss, take profit, trailing distance and step, entry offset, risk as a percentage of free margin, and a magic number for identifying the EA’s trades. The listing identifies EURUSD on a fifteen-minute chart as an example context, but provides no backtest, execution assumptions, spread or slippage analysis, or profitability evidence. The entry logic is a straightforward daily range breakout; its effectiveness and risk depend on the instrument, parameters and market conditions.

Key ideas

  • The EA brackets the prior day’s high and low with pending stop orders.
  • Untriggered orders from the previous day are cleared when a new day begins.
  • After one entry triggers, the opposite pending order is removed.
  • A trailing stop is used after a position becomes profitable.
  • The description provides no evidence of returns or robustness across market conditions.

Tags

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