Skip to content
All library documents

Pending Stop-Order Grid with a Money-Based Profit Target

Article MQL5 code base

Summary

This document describes an Expert Advisor that places a grid of pending Buy Stop and Sell Stop orders around the current market price. Users can enable either order type, set the maximum number of pending orders of each type, and choose the distance from the current price. Optional stop-loss and take-profit levels can be specified for orders.

The cycle closes all open positions and deletes pending orders when aggregate profit reaches a configured monetary target, then starts again. Inputs also include the initial lot size and a lot ratio that can increase subsequent order sizes; setting the ratio to 1.0 keeps size unchanged. The document mentions a real-tick EURUSD test example but gives no results, rules for grid spacing adjustments, or risk analysis. A grid can accumulate exposure as price moves, and increasing lot sizes can magnify losses; the description alone does not establish profitability or define safeguards beyond the listed settings.

Key ideas

  • The Expert Advisor maintains a grid of pending Buy Stop and Sell Stop orders.
  • Users can control order direction, grid distance, order limits, and optional stop-loss and take-profit values.
  • The EA closes positions and removes pending orders when profit reaches a monetary target, then repeats the cycle.
  • A lot ratio can increase later order sizes, while a ratio of 1.0 keeps them constant.
  • The document cites a real-tick EURUSD test setup but reports no test results.

Tags

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