Skip to content
All library documents

Three-Moving-Average Cross EA with Price-Channel Exits

Article MQL5 code base

Summary

This expert advisor combines a three-moving-average crossover signal with a Price Channel indicator. The moving averages expose configurable periods, shifts, and calculation methods, while the crossover component can be configured for current-bar signals and alerts. The document describes three mutually exclusive ways to manage exits: a conventional trailing stop, stop-loss and take-profit levels based on the Price Channel, or moving a profitable position to a break-even level.

Position size can be set as a fixed lot amount or calculated as a percentage of free margin; the EA uses the percentage setting when the fixed lot value is not positive. The supplied defaults were optimized for USDJPY on the hourly chart, but no optimization results or out-of-sample evidence are provided. The description explains configurable mechanics, not a validated trading edge, and gives no detailed crossover entry rules, transaction-cost assumptions, or broader risk controls. Results may differ across instruments, timeframes, and market conditions.

Key ideas

  • The EA combines a three-moving-average crossover indicator with a Price Channel.
  • Only one of trailing stop, channel-based automatic stops and targets, or break-even management should be enabled.
  • Position sizing uses either a fixed lot amount or a free-margin risk percentage.
  • The stated default optimization targets USDJPY on an hourly chart, with no supporting performance evidence presented.

Tags

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