Glossary · Orders & execution

Fill policy in gold trading

A fill policy sets what happens if a gold order cannot fill in full: fill or kill cancels it; immediate or cancel fills what it can and cancels the rest.

Also called Filling mode, FOK, IOC, Fill or kill, Immediate or cancel

A fill policy (filling mode) sets how an order is handled when the full volume is not available at the requested price. The common policies are fill or kill (FOK), where the order fills completely or not at all; immediate or cancel (IOC), where any available volume fills at once and the remainder is cancelled; and return, where unfilled volume stays as a working order.

How it applies to gold trading

Most retail gold trades are small enough to fill in full, so the policy rarely matters. It becomes visible on MT5 as the error “unsupported filling mode,” which appears when an expert advisor or script requests a policy the symbol does not allow. The symbol specification shows which filling modes are permitted, and code has to request one of them.

For larger orders and futures, the policy decides whether you can end up with a partial position. IOC can leave you holding 0.6 lots of a 1-lot order; FOK avoids that but may leave you with nothing on a fast move.

Worked example

Example (hypothetical numbers): you send a 5-lot buy at 4,000.50. Only 3 lots are available there. With FOK nothing fills. With IOC 3 lots fill at 4,000.50 and 2 lots are cancelled, so your risk on a $5 stop is $1,500 rather than the planned $2,500.

A common mistake

Ignoring the filling mode in an expert advisor and then finding every order rejected on a new account. Read the symbol’s allowed modes first.

See also: Market order, Expert advisor, Slippage, Limit order.

Frequently asked questions

What does unsupported filling mode mean on MT5?

The order asked for a fill policy the symbol does not allow. Check the allowed filling modes in the symbol specification and set the order or expert advisor to match.

Which fill policy is best for gold?

For small retail sizes it rarely matters. Use whichever the symbol supports; for large orders, choose FOK if a partial fill would break your risk plan.