Skip to content
All library documents

Moving Average Divergence Signals with Position and Basket Controls

Article MQL5 code base

Summary

This Expert Advisor uses two moving averages of opening prices, comparing their values across the current and prior bars. The difference between the fast and slow averages is evaluated against separate thresholds to generate buy and sell signals, with the sell conditions reversing the buy conditions. The described inputs allow users to set average periods and price sources, divergence thresholds, trade size, and whether positions may be enlarged.

For open trades, the system can use stop-loss and take-profit levels, trailing stops, and a breakeven adjustment. Optional account-wide controls close positions across symbols when an aggregate profit or loss threshold is reached, which the description suggests may suit accounts running multiple instances. A strategy tester visualization is mentioned, but no numerical performance results or test methodology are supplied. The page documents configurable mechanics rather than evidence of profitability; threshold selection, market regime sensitivity, and the risks of adding exposure remain unassessed.

Key ideas

  • The signal compares fast and slow moving averages of opening prices across adjacent bars.
  • Separate divergence thresholds define buy and sell conditions in opposite directions.
  • Position size and optional volume additions can be limited through configuration.
  • Trade management includes stops, trailing protection, and breakeven adjustment.
  • Account-wide profit or loss thresholds can trigger closure across symbols.
  • The description provides no quantified evidence that the strategy is profitable.

Tags

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