Skip to content
All library documents

Price-Channel Trading with ATR Stops and a Trailing Exit

Article MQL5 code base

Summary

This Expert Advisor description presents a channel-based trading method. It finds the highest high and lowest low over a chosen lookback period and derives a reference level from those bounds and the close. A close between the reference level and the channel boundary generates a directional entry signal: below the upper boundary for a sell, or above the lower boundary for a buy. It closes positions when a bar touches a channel boundary that has remained unchanged from the prior bar.

Because those channel-based exit conditions are described as rare, the system also uses an ATR-based stop loss anchored to the relevant channel edge, plus a trailing stop to take profit. Parameters cover channel length, ATR period, trailing distance, lot size, and maximum risk based on free funds; a loss-related lot reduction setting is also described. The page provides a strategy tester visual-mode reference but no quantitative performance results. Its rules and risk settings require testing against costs, execution assumptions, and market conditions before use.

Key ideas

  • The method derives a trading channel from the highest high and lowest low over a selected period.
  • Entry direction depends on the close's position relative to a reference level and channel boundary.
  • Channel-boundary touches can close positions when the boundary is unchanged from the prior bar.
  • ATR-based stop losses and an optional trailing stop supplement the rare channel exit signals.
  • Position size can use fixed lots or a maximum-risk share of free funds.

Tags

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