Skip to content
All library documents

Percentage Channel and Midline Crossover Trading Rules

Article MQL5 code base

Summary

This swing trading Expert Advisor uses a Percentage_Crossover_Channel indicator to generate signals in one of two ways. In channel mode, a bar’s low crossing or touching the lower boundary triggers a buy, while its high crossing or touching the upper boundary triggers a sell. In midline mode, a close crossing the center line downward triggers a buy, and an upward crossing triggers a sell. A reverse setting swaps these directions.

The EA holds at most one position, closing and reversing it when an opposite signal appears. It accepts stop-loss and take-profit distances, lot size, and slippage inputs, and adjusts invalid stop distances or oversized lots to broker constraints; it skips a trade if the minimum lot cannot be funded. The document describes two EURUSD hourly tests over January 2017 to January 2018, one for each signal mode, but provides no numerical performance results in the text. It frames the EA as a training and strategy-testing tool, so the described tests do not establish robustness or live-trading profitability.

Key ideas

  • The EA can trade either channel-boundary crossings or midline crossings.
  • A reverse option swaps the buy and sell directions for either signal mode.
  • The system allows one open position and reverses it when an opposite signal arrives.
  • Stop distances and trade size are adjusted to symbol constraints, and unaffordable trades are skipped.
  • The document reports two historical EURUSD hourly tests but gives no performance figures in the text.

Tags

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