The four quantities to read
MT5 exposes the minimum and maximum volumes for individual operations and a volume step for the permitted grid. The symbol also has a directional aggregate limit covering open positions and pending orders in one direction. Read these values from the instrument configuration rather than assuming standard settings across accounts. MQL5 · Permitted volumes ↗
A simple pre-trade example
Suppose the buy-side limit is five lots. An open buy position uses three and existing buy-side pending orders use 1.5, leaving 0.5 lot of headroom. A one-lot buy order could meet the minimum, maximum and step checks and still breach that aggregate limit. The sell side is evaluated separately.
What to log on rejection
Capture the requested lot size, applicable step, existing position and pending volumes, and symbol settings at the time of the request. Where available, preserve the server’s result code alongside the local estimate. Position and order state can change between the local check and server processing.
