Skip to content
All library documents

Range Breakout Trading with Stop Orders at Narrowest-Range Signals

Article MQL5 code base

Summary

This Expert Advisor describes a range breakout method keyed to a narrowest-range indicator. When a signal appears, it places buy-stop and sell-stop orders beyond the range boundaries, with a take-profit setting and a stop loss at the opposite boundary. If a new signal arrives before either order triggers, it replaces the outstanding orders. Once one side triggers, the other order is canceled; the open position then exits at its stop loss or take profit.

The parameters control the range lookback, detection period, entry offset, and position sizing, with sizing offered as either a fixed lot or a percentage of free margin. The document mentions EURUSD H4 tests over a stated historical span, but provides no numerical results in the text. It describes the EA as an idea-validation tool and notes that it does not verify whether orders belong to it or whether their stop and target settings are valid, limiting its suitability for live trading.

Key ideas

  • The strategy places stop orders on both sides of a detected narrow price range.
  • Entry offsets, range periods, take profit, and position size are configurable.
  • Untriggered orders are replaced when a new signal appears, and the opposite order is canceled after entry.
  • Position sizing can use a fixed lot or a percentage of free margin.
  • The stated tests lack numerical results in the document, and the author identifies order-validation limitations.

Tags

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