What happens to the remainder
Fill or Kill requires the requested volume to be filled in full or the operation is not executed. Immediate or Cancel permits the available part to fill and cancels the rest. With Return, eligible partially filled orders can keep the remaining volume for further processing. Return is unavailable for immediate orders in Market Execution mode. MQL5 · Order Properties ↗
An order-sized example
Consider an order for one lot when only 0.6 lot is available for immediate execution at the eligible prices. Under IOC, 0.6 lot can execute and the remaining 0.4 is cancelled. Under FOK, the available 0.6 lot alone is insufficient. Read the actual executed quantity from the resulting trade records.
What an adapter should inspect
Check execution mode and allowed filling policies for the symbol and treat pending orders according to the documented rules for them. Log the chosen policy with the request. Then reconcile fills and any remaining quantity separately in the order state instead of inferring them from a single acknowledgement.
