Skip to content
All library documents

MACD Trading EA with Martingale Position Scaling and Profit Protection

Article MQL5 code base

Summary

This trading robot uses MACD signals to open positions and increases lot size as the number of positions grows, applying a martingale-style scaling rule. The description recommends higher chart timeframes and provides controls for initial position sizing, including a risk percentage of free margin, as well as limits on position count and maximum volume. Stop loss, take profit, trailing stop, spacing between positions, and optional signal reversal are also configurable.

An account protection feature can close the most profitable position once aggregate profit passes a threshold, provided a minimum number of positions is maintained. The document explains these settings but gives no entry-signal details beyond MACD, no tested results, and no evidence of profitability. Increasing exposure as positions accumulate can amplify losses, while closing winning positions does not by itself control the risk in remaining positions.

Key ideas

  • The EA uses MACD signals and scales position size upward as the number of open trades increases.
  • Users can set risk-based or fixed initial volume and cap position count and maximum lot size.
  • Stop, target, trailing, and spacing parameters govern trade management.
  • Profit protection closes the most profitable position after an aggregate profit threshold while preserving a configured minimum position count.
  • The description includes no backtest or performance evidence.

Tags

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