Skip to content
All library documents

Zero-Lag MACD Forex EA with Martingale Position Scaling

Article MQL5 code base

Summary

This Expert Advisor develops an earlier MACD-based system by replacing standard MACD with Zero-Lag MACD. It can reverse signal direction and manages a series of positions by increasing the spacing between entries, take-profit distance, and trade size as the position count grows. Users can set stop loss, take profit, trailing rules, risk as a share of free margin, and caps on position count and volume. A profit-protection option closes the most profitable position after an aggregate-profit threshold is met, subject to a minimum number of positions remaining.

The document provides H1, every-tick backtest results across multiple forex pairs using a stated initial deposit and default inputs. Outcomes vary widely: several pairs lose money, and reported equity drawdowns are substantial, including values above 100%. These results are limited to the listed test setup and do not establish robustness, live execution performance, or safety of the martingale-like scaling approach.

Key ideas

  • The EA uses Zero-Lag MACD signals in place of standard MACD.
  • It increases position spacing, take-profit distance, and lot size as the position series grows.
  • Trade volume can be based on free-margin risk or a manually specified initial lot, with optional caps.
  • Profit protection can close the most profitable trade while retaining a configured minimum number of positions.
  • Listed forex backtests show inconsistent performance and large drawdowns across instruments.

Tags

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