Order Duration (GTC / IOC / FOK)
Also known as: time in force, tif, gtc, ioc, fok, good-till-cancelled, fill-or-kill, immediate-or-cancel
What is it?
Order duration, also called time-in-force, is the instruction that tells the broker how long a pending order is allowed to stay alive before it either fills or is cancelled. There are three workhorse types you will meet most often. A GTC order, short for Good-Till-Cancelled, simply rests in the market until it either fills or you manually pull it, which is handy when you want to wait days for price to reach your level without re-entering the order every session.
| Duration | How long it lives | Partial fills? | Your 10-contract order, only 4 offered | Use when |
|---|---|---|---|---|
| GTC | Rests until it fills or you cancel it | Yes — over time | Keeps sitting until all 10 fill or you pull it | Patience: wait days for your price |
| IOC | Fills instantly, cancels the rest | Yes — right now | Takes the 4, cancels the other 6 | Speed: grab the liquidity that is there |
| FOK | Fills the whole size at once or cancels | No — all or nothing | Rejects all 10, fills nothing | Completeness: need the full size |
An IOC order, Immediate-Or-Cancel, fills whatever quantity it can grab at the moment it arrives and instantly cancels any unfilled remainder, so you take what liquidity is there right now and walk away from the rest. A FOK order, Fill-Or-Kill, is the strictest of the three: it must fill the entire size in one go immediately or it cancels completely, leaving you with nothing rather than a partial fill. As a concrete example, say you want to buy 10 contracts of a CME futures market and only 4 are available at your price: an IOC takes those 4 and cancels the other 6, a FOK rejects the whole order because all 10 could not fill at once, and a GTC simply keeps sitting until all 10 are reachable or you remove it.
The common pitfall is leaving GTC orders resting and forgetting them, so a stale buy limit you set last week suddenly triggers on a gap you no longer want to trade. Picking the right duration is about controlling whether you prioritise certainty of price, speed of fill, or completeness of size.
Why it matters: Order duration decides whether you wait patiently for your price, grab whatever fills instantly, or refuse anything less than the full size, so it directly shapes how and when you actually get into a trade.
Order duration governs whether and how a pending order fills, directly affecting entry certainty, partial fills, and missed or unwanted executions.
Real-world example
You send an IOC to buy 10 contracts but only 4 are offered at your price, so 4 fill instantly and the remaining 6 cancel; a FOK in the same spot would have rejected all 10 because the full size could not fill at once.
How SignalBots handles it
When SignalBots fires an entry through the MT4/MT5 Connector, TradingView webhooks, or browser extensions, the time-in-force you choose determines how the order behaves on arrival, and the sub-10ms delivery edge means an IOC or FOK reaches the book before the liquidity it was aiming for disappears.
Pro tip
Use IOC when partial fills are acceptable and you just want immediate liquidity, FOK when you need all-or-nothing, and GTC only with a calendar reminder so resting orders never trigger on a setup you have moved on from.
Common pitfalls
Leaving a GTC order resting and forgetting it, so a stale limit fires days later on a price move you no longer want to trade.
Frequently asked questions
What is the difference between GTC, IOC, and FOK?
GTC rests in the market until it fills or you cancel it, IOC fills whatever it can immediately and cancels the rest, and FOK must fill the entire order at once or cancel completely. They differ in how long the order lives and whether partial fills are allowed.
When should I use a GTC order?
Use GTC when you want a limit order to wait at your chosen price over hours or days without re-entering it each session. Just track it, because a forgotten GTC can fire on a price move you no longer want.
Does an IOC order guarantee my whole order fills?
No. IOC fills only the quantity available at the moment it arrives and instantly cancels any unfilled remainder, so partial fills are normal with this duration.
Why did my FOK order get rejected with nothing filled?
FOK is all-or-nothing, so if the full size could not be filled instantly at your price, the entire order is cancelled rather than partially filled. This is the expected behaviour, not an error.
Which order duration is best for automated trading?
It depends on your goal: IOC suits fast entries where partial fills are fine, FOK suits cases that need the complete size, and GTC suits resting limit orders. Match the duration to whether you prioritise speed, completeness, or patience.