Skip to content
All library documents

Managing a Two-Sided Grid of Pending Orders with an Expert Advisor

Article MQL5 code base

Summary

This document describes an Expert Advisor that maintains a grid of pending orders above and below the current market price. Users can configure the number of orders per side, spacing, order types, lot size, slippage allowance, take-profit distance, and a magic number used to identify the EA's orders. It checks the grid on each tick, respects broker minimum-distance rules, and replenishes orders that are filled or canceled. The document says the approach can be used across time frames and currency pairs, with a particular mention of gold.

The method can capture price moves in either direction, but the description gives no entry signal based on market conditions and no backtest or performance evidence. It states that the EA manages pending orders only and does not manage open positions with stop losses or trailing stops. Grid spacing, take-profit settings, execution conditions, and exposure as orders fill therefore matter to risk. The author advises adjusting settings for broker pricing conventions and trying the EA on a demo account before live use.

Key ideas

  • The EA places configurable pending-order grids both above and below the current price.
  • Order spacing, order direction, lot size, slippage, and take-profit distance are user-configurable.
  • The EA tracks its own orders and replenishes the grid when orders are filled or canceled.
  • The described EA does not manage open positions with stop losses or trailing stops.
  • The document provides no performance data and recommends demo testing before live trading.

Tags

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