Sub topic 9
Time in force: how long an order stays active
What this chapter assumes
You should already know how a limit order works: it sets a price cap for a buy or a floor for a sell, and it may not fill. You should also know what the bid, ask and spread are, and what an order ticket looks like. This chapter covers one field on that ticket, the time in force, and what it does to an order after you click submit.
What time in force means
Time in force (TIF) is an instruction that tells the broker how long an order may stay active before it expires or is canceled. It does not change the price you will pay. It changes the window in which your order is allowed to fill.
This matters most for limit orders. A limit order that cannot fill right away waits for the market to come to it. TIF sets how long it is allowed to wait.
A market order is different. It tries to fill immediately at the best available prices, so TIF rarely changes the outcome. Most brokers still require a TIF on the ticket and default it to DAY.
The common choices
| Code | Name | How long the order lives | Typical use |
|---|---|---|---|
| DAY | Day order | Until the close of the current regular session | Default. A bid you only want today |
| GTC | Good-til-canceled | Until it fills or you cancel it, up to a broker maximum | A price target you will wait weeks for |
| IOC | Immediate-or-cancel | Fills what it can right now, cancels the rest | You want a partial fill now or nothing |
| FOK | Fill-or-kill | Fills the entire quantity right now, or nothing | You need the full size or no trade |
Brokers differ. Some offer only DAY and GTC to retail customers. Others add IOC, FOK, or extended-hours variants. Check what your broker's ticket offers before you plan around a specific option.
DAY orders
A DAY order is active until the regular session closes. For U.S. stocks that is normally 4:00 p.m. Eastern. If it has not filled by then, it expires and its status becomes expired or canceled, depending on the broker's wording.
Two details catch people out:
- If you submit a DAY order while the market is closed, it usually waits and becomes active at the next open. It does not expire before it has had a chance to trade.
- A DAY order placed in regular hours normally does not carry into the after-hours session unless your broker has an extended-hours option and you select it.
GTC orders
A good-til-canceled order stays active across days. It remains until one of these happens:
- It fills completely.
- You cancel it.
- The broker's maximum lifetime passes. Many brokers cap GTC at 60 or 90 days, and some at 180. The cap varies, so read your broker's rules.
- A corporate action or an exchange event causes the broker to cancel it.
That last point is a real gotcha. When a stock goes ex-dividend, splits, or has a similar event, brokers often adjust or cancel open orders. Some cancel all open GTC orders on a stock that has a split, because the old price no longer makes sense. You should not assume a GTC order is still there months later. Check your open orders list.
IOC and FOK
These are for traders who care about immediacy more than patience.
- IOC sends the order, fills whatever is available at your limit price or better, and cancels the unfilled remainder at once.
- FOK is stricter. If the whole quantity cannot fill immediately, nothing fills.
Both are normally paired with a limit price. Without a limit, they behave like a market order and offer little protection.
Why TIF changes your outcome
Say a stock quotes 49.98 bid and 50.02 ask, and you want to buy 20 shares, but only at 49.90 or lower. You enter a limit buy at 49.90.
- With DAY, the order sits on the book until 4:00 p.m. If the price never falls to 49.90 today, it expires with no fill. You have lost nothing, but you also have no position.
- With GTC, the order keeps waiting. A dip next week could fill it. That can be what you want. It can also fill during a drop you did not expect, when you have forgotten the order exists.
The danger of GTC is that the world changes while your order does not. News arrives, your plan changes, and a stale order fills at a price you would no longer choose. A fill is a real trade with real money, even if you submitted the order weeks ago.
The danger of DAY is the opposite. You may need to re-enter the order every morning, and each time you do, you lose your place in the queue at that price.
Time priority and queue position
On most exchanges, orders at the same price fill in the order they arrived. This is price-time priority. A DAY order that expires and is re-entered goes to the back of the line. A GTC order keeps its place on your broker's side, but note that some brokers re-submit GTC orders to the exchange each morning, so your queue position may reset anyway. For liquid stocks this rarely matters. For a thinly traded stock where you are waiting at the bid, it can.
How TIF fits into the order lifecycle
TIF decides which end state an unfilled order reaches. A simplified lifecycle looks like this.
Notice that a partial fill is not an end state. The remaining quantity keeps working until the TIF ends. With IOC, the unfilled remainder is canceled immediately, so a partial fill ends right away. With FOK, a partial fill never occurs.
Modeling TIF in code
This short program simulates a day-long limit buy. It walks through a list of trade prices during the session and reports whether a DAY order filled. It is a simplified model, because a real fill also needs enough shares at your price, but it shows how the window decides the result.
def limit_buy_filled(limit, prices_by_day, tif):
"""Return the day number a limit buy first becomes fillable, or None.
prices_by_day: list of days, each a list of trade prices in order.
tif: 'DAY' only checks day 1; 'GTC' checks every day.
"""
days = prices_by_day[:1] if tif == "DAY" else prices_by_day
for day_number, prices in enumerate(days, start=1):
if any(p <= limit for p in prices):
return day_number
return None
week = [
[50.02, 50.00, 49.97], # day 1
[49.95, 49.91, 49.93], # day 2
[49.88, 49.90, 49.92], # day 3
]
print(limit_buy_filled(49.90, week, "DAY")) # None
print(limit_buy_filled(49.90, week, "GTC")) # 3The DAY order never reaches 49.90 on day 1, so it expires. The GTC order stays alive and becomes fillable on day 3. Note the model is too generous in one way: a trade at exactly your limit price does not guarantee your order fills, because other orders may be ahead of yours in the queue.
Common errors
- Forgetting the order exists. Open GTC orders are easy to lose track of. Keep a list of what you have working.
- Assuming a GTC order lasts forever. Broker caps and corporate actions can cancel it silently or with only a notice.
- Using DAY when you wanted to wait. You enter a low limit buy, it expires at the close, and you assume the market never reached it. Check whether the order simply expired.
- Confusing expired with rejected. Expired means the order was valid and the time ran out. Rejected means the broker refused it, for example for insufficient buying power.
- Expecting IOC or FOK to be available everywhere. Many retail platforms do not offer them.
- Ignoring buying power. A working buy order can reserve cash. A pile of GTC orders can tie up money you thought was free.
Choosing a TIF
Use these questions in order.
- Do you want this trade only if it can happen today? Use DAY.
- Is the price target a plan you will still hold in a week? Use GTC, and note the date you will review it.
- Do you need the trade done now or not at all? Use IOC or FOK with a limit price, if your broker offers them.
A new trader is usually better served by DAY. It cleans itself up. Move to GTC when you have a reason and a habit of checking.
Exercise
You place a limit buy for 100 shares at 24.00 with a GTC order on Monday. The stock trades between 24.40 and 25.10 all week. On the following Tuesday it splits 2-for-1. What are the possible states of your order, and what should you do?
Show answer
Until the split the order stays open and unfilled, because the price never reached 24.00. At the split, your broker may adjust the quantity and price (200 shares at 12.00) or cancel the order. You should not assume which. Check your open orders list after the split. If the order is gone or changed, decide whether you still want it and re-enter it with the correct price and quantity. The order could also have been canceled earlier if it passed your broker's maximum GTC lifetime.
Exercise
You submit a DAY limit sell for 300 shares at 40.00. By 4:00 p.m., 120 shares have sold at 40.00. What is the status of the order, and what happens to the other 180 shares?
Show answer
The order is partially filled while it is working. At the close, the TIF ends, so the order expires with 120 shares filled and 180 unfilled. You still own the 180 shares. Your account shows a completed sale of 120 shares at 40.00, and you must place a new order if you still want to sell the rest.