Order Fill Policy Explained: FOK, IOC, BOC and Return Orders
An order can be refused for reasons unrelated to price, margin or stop distance. One is the fill policy: a field on the request saying what should happen if the whole volume cannot be filled at once.
Most guides describe three policies. The MetaQuotes documentation defines four, and the fourth is the one that explains several otherwise puzzling rejections.
Key takeaways
- There are four documented fill policies, not three: Fill or Kill, Immediate or Cancel, Book or Cancel and Return.
- Fill or Kill demands the full volume or nothing; Immediate or Cancel takes what is there and drops the rest.
- Book or Cancel is passive only: cancelled if it could fill immediately, and priced worse than the market by design.
- Return is restricted by execution mode, and the restriction differs between market orders and pending orders.
- The permitted policies are a property of the symbol, published by the trade server, not an account preference.
- A fill-policy refusal is trade server return code 10030. Runtime error 4756 is a different thing and is widely misreported as this one.
- MetaTrader 4 has no fill policy at all; its order function carries no such parameter.
Table of contents
- What a Fill Policy Actually Decides
- The Four Policies MetaTrader 5 Documents
- Book or Cancel, the One Most Guides Leave Out
- Why Return Differs for Market and Pending Orders
- Fill Policy Is a Symbol Property, Not a Preference
- What Error 4756 Really Means and the Code That Answers
- When the Choice Changes Nothing for You
- Who This Page Is Not For
- Frequently Asked Questions
What a Fill Policy Actually Decides
A fill policy answers one question, asked at the moment the request reaches the server: if the whole requested volume cannot be matched right now, what should be done with the part that cannot?
In MetaTrader 5 the choice travels in a field named type_filling on the trade request. It is separate from the order type, which is a different decision about how and when the order should trigger.
The two are easy to conflate. Choosing between a market and a limit order is covered under order types; the fill policy answers a question order type never touches.
The Four Policies MetaTrader 5 Documents
MetaQuotes names four constants. Fill or Kill executes only in the specified volume; if the required amount is unavailable the order is not executed at all.
One detail is often lost: under Fill or Kill the volume may be assembled from several offers available at that moment. All of it, but not necessarily from one counterparty.
Immediate or Cancel accepts the maximum volume available within the amount requested; if it cannot fill completely, the available part executes and the remainder is cancelled.
Return leaves the remainder alive: on a partial fill the order is not cancelled, and one carrying the outstanding volume continues to be processed.
Book or Cancel, the fourth, is a different kind of instruction altogether.
| Policy | If the full volume is unavailable | Where it applies |
|---|---|---|
| Fill or Kill | Nothing is executed; the volume may be assembled from several offers if it is there | Where the trade server permits it |
| Immediate or Cancel | The available part fills; the remainder is cancelled | Availability is determined on the trade server |
| Book or Cancel | Never fills on placement; cancelled if it could | Limit and stop limit orders only |
| Return | The available part fills; the remainder keeps working | Depends on execution mode and order type |
Book or Cancel, the One Most Guides Leave Out
Book or Cancel is the policy comparison articles routinely omit, and it behaves unlike the other three. It does not describe how much should fill; it insists that none of it fills on arrival.
Under this policy the order may only be placed in the order book. If it could be executed immediately when placed, it is cancelled instead.
MetaQuotes states the consequence plainly, and it sounds like a fault until the purpose is clear: the policy guarantees the placed order will be priced worse than the current market.
That is the point: Book or Cancel exists for passive trading, resting in the book without consuming the liquidity already there.
Anyone who reads a resting ladder will recognise the behaviour it produces, and the ladder itself is explained under depth of market.
Why Return Differs for Market and Pending Orders
Return is the policy most likely to be unavailable for no obvious reason, and the documentation explains why in terms competitor pages do not carry.
For market orders, Return applies only in the Exchange Execution mode. MetaQuotes states directly that Return orders are not allowed under Market Execution.
For limit and stop limit orders the range is wider: there, Return applies in both Market Execution and Exchange Execution.
So one policy name carries two availability rules on a single account, decided by the kind of order it is attached to. Read without that split, a refusal looks arbitrary.
Execution mode is a symbol setting chosen by the broker, which is why an instrument accepting Return on a pending order may refuse it on a market order.
Fill Policy Is a Symbol Property, Not a Preference
The permitted policies are not an account setting and not a platform option. In the symbol properties MetaQuotes lists SYMBOL_FILLING_MODE, described as flags of allowed order filling modes and typed as an integer. A fill policy settles what happens to an unfilled remainder; which quote side triggers the order in the first place is a separate property again.
Flags, rather than a single value, is the operative part. Each symbol carries its own set of permitted modes, published by the trade server, and different instruments on one account can permit different combinations.
A habit formed on one instrument therefore will not carry over: a policy accepted all week on a major currency pair can be refused on an index the first time it is tried. The documentation says the same of Immediate or Cancel, whose availability is determined on the trade server.
What Error 4756 Really Means and the Code That Answers
Search for a fill-policy problem and the number that comes back is usually 4756, frequently glossed as an unsupported filling mode. The MetaQuotes runtime error list does not define it that way.
In that list, 4756 is ERR_TRADE_SEND_FAILED, described simply as a failed attempt to send the trade request. It reports that the request did not get away, without saying why.
The code that actually identifies this fault sits in a different list. Among the trade server return codes, 10030 is TRADE_RETCODE_INVALID_FILL, an invalid order filling type.
Keeping the two apart is what makes a rejection diagnosable. One reports that the send failed; the other names the condition the request breached.
Neighbouring codes make the point by contrast: invalid volume is 10014, invalid stops 10016, market closed 10018, insufficient money 10019 and no quotes to process the request 10021.
Only 10030 concerns the filling type. A rejection caused by stop distance rather than fill policy is a separate matter, set out under stops level and freeze level.
When the Choice Changes Nothing for You
On many retail accounts the fill policy never visibly does anything, and it is worth being honest about when that is so.
Partial fills need a market deep enough, or an order large enough, for the requested volume to be unavailable at once. Below that size the whole amount is matched, and every policy produces the same outcome.
Where the symbol permits one mode there is likewise no decision to make. The choice starts to matter with size, with thin instruments, with any strategy preferring nothing to a fraction of a position, and for automated code, which must send a permitted value rather than assume one.
What the policy never does is control the price of a fill. That is a separate mechanism, described under slippage, and no fill policy protects against it.
Who This Page Is Not For
This page describes what MetaTrader 5 documents and what a trade server enforces. It recommends no policy, because the right one depends on instrument, size and strategy.
It is also not a MetaTrader 4 guide. That platform has no fill policy: its order function takes a symbol, an operation, a volume, a price, a slippage value, stop and target levels, a comment, an identifier, an expiry and an arrow colour, and nothing describing filling type. The same holds for orders sent without the dialog, where the platform picks the policy from the instrument execution mode rather than from anything you set.
Readers whose question is really about how many positions an instrument can hold at once are looking at a different setting, covered under netting and hedging accounts.
Frequently Asked Questions
What is an order fill policy?
It is a field on a MetaTrader 5 trade request, named type_filling, stating what should happen when the full requested volume cannot be matched immediately. The documented options are to refuse the order, to fill what is available and cancel the rest, to fill it and keep the rest working, or to refuse to execute on placement at all.
What is the difference between Fill or Kill and Immediate or Cancel?
Fill or Kill is all or nothing: if the specified volume is not available the order is not executed, though it may be assembled from several offers available at that moment. Immediate or Cancel accepts a partial result, filling what is available within the amount requested and cancelling the remainder.
Why was my order rejected for an invalid filling type?
Because the policy sent was not among those the symbol permits. Permitted modes are published per symbol as flags of allowed order filling modes, so a value accepted on one instrument can be refused on another. The trade server reports this as return code 10030, an invalid order filling type.
Does MetaTrader 4 have fill policies?
No. The MetaTrader 4 order function has no filling-type parameter at all. It takes a symbol, an operation, a volume, a price, a slippage value, stop loss and take profit levels, a comment, a magic number, an expiry and an arrow colour. Its nearest lever is the slippage value, which answers a different question.
Can I choose any fill policy I want?
Only from the set the symbol allows. The permitted modes are a property of each symbol and are determined on the trade server, and Return carries a further restriction: for market orders it applies only under Exchange Execution, while for limit and stop limit orders it applies under both Market Execution and Exchange Execution.
Sources checked 1 August 2026: MetaQuotes, MQL5 Reference, Order Properties and the ENUM_ORDER_TYPE_FILLING enumeration — for the four constants ORDER_FILLING_FOK, ORDER_FILLING_IOC, ORDER_FILLING_BOC and ORDER_FILLING_RETURN, for the type_filling field of the trade request, and for the statement that Return orders are not allowed in the Market Execution mode. MetaTrader 5 Help, Trading Principles, Fill Policy — for the prose definitions of Fill or Kill, Immediate or Cancel, Book or Cancel and Return, for the volume being assembled from several offers, for Book or Cancel guaranteeing a price worse than the current market and being supported only for limit and stop limit orders, and for Return applying to market orders only in Exchange Execution while applying to limit and stop limit orders in both Market and Exchange Execution. MetaQuotes, MQL5 Reference, Symbol Properties — for SYMBOL_FILLING_MODE, flags of allowed order filling modes. MetaQuotes, MQL5 Reference, Trade Server Return Codes — for 10030 TRADE_RETCODE_INVALID_FILL, and for 10014, 10016, 10018, 10019 and 10021. MetaQuotes, MQL5 Reference, Runtime Errors — for 4756 ERR_TRADE_SEND_FAILED, trade request sending failed. MetaQuotes, MQL4 Reference, OrderSend — for the MetaTrader 4 parameter list, which contains no filling type.
Disclaimer: This article is educational only, is not investment advice, and is not a recommendation to use any order type, fill policy, broker or platform. Execution behaviour varies between brokers and instruments and can change without notice, and only your own broker can confirm what a given symbol permits. Trading leveraged foreign exchange and contracts for difference carries a high risk of losing money rapidly.
