Skip to content
All library documents

A 20-Period Moving Average Forex EA with Trailing Stops and Lot Scaling

Article MQL5 code base

Summary

This description outlines a forex expert advisor built around a single 20-period moving average. It is presented for major currency pairs and multiple chart time frames, and the text says its decisions use the open price of the current candle. The listed controls include fixed stop loss and take profit settings, optional trailing stops, candle-based trailing, and moving a stop to break even. It also provides switches for take profit measured in money or percentage terms and for equity-based drawdown control.

The EA can allow position sizes to increase after losses through an increase factor and an exponent setting; both are configurable, and the description suggests setting the increase factor to zero to disable loss-based scaling. It also lists a maximum trade count and parameters for managing several trades. These are product settings, not a tested strategy specification: no entry rules beyond the moving-average basis, exit logic details, backtest, or live results are supplied. The recommendation to try a demo account does not establish profitability or safety.

Key ideas

  • The EA is described as using one 20-period moving average on major forex pairs.
  • The description says decisions use the open price of the current candle.
  • Stop loss, take profit, trailing, and break-even controls are configurable.
  • An increase factor can scale position size after losing trades, or be disabled.
  • No backtest, performance evidence, or complete trading rules are provided.

Tags

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