Skip to content
All library documents

Pending-Order Range Trading with Lot Limits and Multiple Trailing Stops

Article MQL5 code base

Summary

This Expert Advisor places Buy Stop and Sell Stop orders around a recent price range, either at its edges or near its center. It can manage open Buy and Sell positions with classic trailing stops, prior-bar high/low levels, or a moving average. The moving-average and classic methods update stops after price has moved sufficiently in favor of a position; the high/low method uses the previous bar’s extreme when that level is profitable.

The settings include caps on total lots and the number of positions and pending orders, plus fixed-lot or risk-based money management. Users can set take-profit and stop-loss levels, a lot increase multiplier, minimum free margin, trading hours, and the range lookback. The description explains the rules and constraints but gives no backtest or performance evidence. It also does not specify execution safeguards for gaps, slippage, or changing market conditions; lot increases and risk-based sizing therefore require careful evaluation.

Key ideas

  • The EA places pending orders around a recent high-low range, at its edges or center.
  • It offers classic, prior-bar high/low, and moving-average stop-trailing methods.
  • Limits on aggregate volume and order count constrain the number and size of exposures.
  • Position sizing can use fixed lots, free-margin-based sizing, or risk-based sizing.
  • The document describes configuration behavior but provides no performance evaluation.

Tags

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