Skip to content
All library documents

Session-Range Breakout Trading with ATR Filters and Risk-Based Sizing

Article MQL5 code base

Summary

This document describes an educational MetaTrader 5 expert advisor that trades breakouts of a range formed from the highest high and lowest low over a configured number of completed bars. At a specified server time, it checks whether the range width falls within a band based on the last completed ATR value. A touch of the range boundary or a completed-bar close beyond it can trigger an entry, with the opposite boundary used as the stop. Optional trade management includes an R-multiple target, break-even adjustment, partial close, and a tick-driven end-of-day close attempt. Position size is tied to stop distance and broker constraints.

The text explains configuration, installation, and a basic testing path, but offers no historical profitability results. It explicitly cautions that shared chart coordination is not an atomic risk reservation, the day-end close can fail, restart behavior does not ensure a daily entry lock in every case, and netting partial closes are unsupported. Reported regression and compilation checks do not establish live execution quality or strategy performance; broker costs and restrictions need separate evaluation.

Key ideas

  • The EA derives a trailing-bar high-low range at a configured start time and filters its width using an ATR band.
  • A boundary touch or bar close beyond the range can trigger an order, with the opposite edge serving as the stop.
  • Optional management includes an R-based target, break-even stop, partial close, and an end-time close attempt.
  • Position sizing accounts for stop distance and broker minimum-volume constraints.
  • The author reports no historical performance evidence and identifies limits in coordination, restart recovery, and forced closing.

Tags

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