Skip to content
All library documents

Session-Timed Breakout EA Using Recent Highs and Lows

Article MQL5 code base

Summary

This Expert Advisor waits for a control bar whose opening hour matches a configured start hour, then searches a specified number of bars for the highest and lowest prices. Based on the chosen order type, it places pending limit orders or stop orders around those levels. A trading-session setting can be used to choose when the control bar occurs.

Pending orders expire at the end of the trading day, or the EA removes remaining pending orders after any one order is activated. The description says activation is detected through a trade-transaction event. This outlines a time-based range-order mechanism and its order cleanup behavior, but provides no entry-price offsets, position sizing, exit rules for filled orders, backtest results, or evidence that the approach is profitable.

Key ideas

  • The EA identifies a control bar by its opening hour.
  • It searches recent bars for maximum and minimum prices before placing pending orders.
  • The selected order type determines whether the EA uses limit orders or stop orders.
  • Unfilled orders expire at day end, and activation of one order cancels the others.
  • The description does not specify risk controls or provide performance results.

Tags

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