Placing a Grid of Downward Pending Orders Asynchronously
Summary
This MQL5 script places a configurable series of pending orders below the current market price. Inputs set the initial gap, spacing, order type, order count, volume, stop loss, and take profit. The order type can be a buy limit or a sell stop, so the grid can represent different entry approaches as price moves lower. Before sending requests, the script checks that the lot size is positive and valid for the symbol.
The example log shows five sell-stop requests submitted in quick succession, with all five confirmed within roughly 71 milliseconds in that reported run. Asynchronous trading mode allows the script to submit requests without waiting for each response before sending the next. This timing is an example from one account, instrument, and occasion; it does not establish typical latency or execution quality. The document describes order placement mechanics, not a complete trading strategy, and gives no guidance on exposure limits, order cancellation, or how to manage a grid during sustained price moves.
Key ideas
- The script spaces pending orders below the current price using a configurable initial gap and step.
- Users can choose buy-limit or sell-stop orders and set volume, quantity, stop loss, and take profit.
- Asynchronous mode submits several trade requests without waiting for each confirmation.
- The example reports five orders confirmed in about 71 milliseconds, which is a single illustrative run.
- The script validates the requested volume before placing orders.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.