Skip to content
All library documents

Implementing a Bollinger Bands Mean-Reversion EA in MQL5

Article MQL5 articles

Summary

The article explains how to build an MQL5 Expert Advisor around Bollinger Bands. It describes the bands as a moving average with upper and lower boundaries based on standard deviations, then presents a basic reversal approach: buy when price falls below the lower band and sell when it rises above the upper band. The implementation discussion covers indicator handles, configurable period and deviation, trade volume, slippage, stop-loss and take-profit distances, order management, and resource cleanup.

The document reports a strategy-tester run spanning 2016 to 2019 with 1,425 trades, of which 857 were profitable, stated as 20.28% more than losing trades. This is limited evidence: the excerpt does not give the instrument, full settings, costs, drawdown, or enough detail to assess robustness. The author frames the EA as a starting point for further development and parameter adjustment, and notes that the code is educational rather than investment advice.

Key ideas

  • Bollinger Bands combine a simple moving average with boundaries set by standard deviations.
  • The described entry logic buys below the lower band and sells above the upper band, anticipating a reversal.
  • The EA exposes band settings, lot size, and slippage as inputs while stop-loss and take-profit distances are constants.
  • The reported backtest covers 2016 to 2019 but gives limited information for evaluating robustness.

Tags

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