Order Types and Time-in-Force: A Practitioner's Map
Every order type is a point on the same tradeoff: certainty of execution versus certainty of price. This is the field guide — the math, the use cases, and the specific way each one bites.
Most retail traders know market and limit. A few know stop. Almost nobody knows the rest, and almost everybody gets burned at some point by not knowing them.
The beginner article covered the basic tradeoff: you can have certainty of execution or certainty of price, not both. This is the deep version: every order type you’re likely to meet in equities, futures, options, and crypto spot, each with its contract semantics, its math, and its specific way of biting you. That last part matters most, because each type has a different failure mode — and failure modes have a habit of showing up exactly when you’re most fragile.
The Market Order
The market order’s contract is one sentence: “buy or sell immediately at the best available price(s).” Use it when you need the fill now and don’t care about a few cents.
Its fill price is not one price. It’s the volume-weighted average of the levels your order sweeps. Send a market buy for 1000 shares into a book showing 300 @ $100.01, 400 @ $100.02, 300 @ $100.03, and your fill is:
One cent of slippage from the touch, about 1 bp. In a calm market, an acceptable price for immediacy.
How it bites: that weighted average has no floor when the book is thin. During a crash the spread blows out to 5–10% and your market sell fills at the worst possible moment — and the more panicked the moment, the thinner the book. Harris devotes substantial space to the flash-crash behavior of stop-market orders (Harris, Trading and Exchanges, Ch. 28); that is the market order’s worst side amplified, and we’ll return to it under stops.
Backtest note: OrderType.MARKET in arithmion.orders simulates the book walk using the current L2 snapshot. Set the volatility regime appropriately — a “calm market” assumption gives you unrealistically tight fills.
The Limit Order
The limit order sits at the other end of the tradeoff: “buy at price or lower; sell at or higher.” Use it when you want price control, you’re willing to wait, and you’re posting liquidity hoping to be hit.
The price is locked; the cost has moved into fill probability. Over a horizon , the expected cost is:
where is your limit, the probability of filling within , and the cost of not filling — missed alpha, missed rebalance, missed hedge. Choosing shuttles cost between the two terms: post further away and you pay less per fill, but drops and the opportunity term grows. This tradeoff can literally be computed; there’s a section at the end that does.
How it bites: the market gaps through your limit, you never fill, and you’re flat when you wanted to be long. “Set and forget” limit orders are how people miss breakouts. And remember the previous article’s conclusion — the moments your limit fills most smoothly are often the moments the price is falling through you.
The Stop Order
The stop looks like a third thing but isn’t. It’s a market order with a fuse: “once the market trades at or through , submit a market order.” The use case is risk management — you have a position and want out if it moves against you by a set amount.
All of its math lives in the words “after the trigger”: the stop price is only the fuse, and the actual exit is minus post-trigger slippage. In a volatility regime , conditional on the stop triggering:
where is the latency between trigger detection and order arrival, and is a rough constant capturing post-trigger slippage: – in calm markets, 5 or more in a flash crash. The formula’s very existence is the warning — a stop price is not a promise that “losses stop here.” It’s a switch that says “from this price, exit at market,” and the switch flips at exactly the moments market orders perform worst.
The 2010 flash crash wrote this into history: stops triggered at prices 30–60% below the pre-crash market, and many filled near the bottom. The SEC post-mortem (Findings Regarding the Market Events of May 6, 2010) found that stop-market orders materially worsened the crash by hitting the market simultaneously.
Backtest note: when testing stop-loss strategies, model the gap risk explicitly. Arithmion’s StopOrderSimulator includes a gap model parameterized by historical intraday volatility.
The Stop-Limit Order
Anyone frightened by the flash crash thinks of a “fix”: trigger, then post a limit instead of a market order. That’s the stop-limit: “once the market trades at or through , submit a limit order at ,” with typically a buffer below (say $0.05).
It fixes one problem by buying another: the price can gap past both and in one move. If it does, your limit never fills and you’re still in the position. On that day in 2010, many traders who had switched from stop-market to stop-limit never exited and rode the whole recovery — which looks lucky in hindsight, but it was luck, not design. Whether that outcome is good depends entirely on whether you needed to be out.
So the practitioner’s rule sorts by one question: can you afford to stay in the position? Stop-market is the mandatory exit — use it when you cannot, and accept the slippage. Stop-limit is exit-with-patience — use it when you can, and accept the chance of not getting out. The order that gives you both doesn’t exist.
The Trailing Stop
The trailing stop puts a ratchet on the stop price: “maintain the stop at from the highest (long) or lowest (short) price seen since entry.” For a long position, the trigger at time :
The trailing amount can be fixed in price ($0.50), in percent (5%), or in ATR units (2× ATR). Trend followers use it to lock in profit as the trade runs.
The cost shows up in chop: a small pullback stops you out, and the move reverses immediately. Tighter locks more and gets whipsawed more; looser rides deeper drawdowns. There is no free parameter.
Hiding Size: Icebergs and Hidden Orders
When your order is big enough to reveal intent, there are two tools. The iceberg order: “display shares at price ; once fills, display the next ,” with total quantity possibly far larger than . Expected completion time is roughly times the fill time of a single -share tranche — a smaller displayed slice leaks less and finishes slower, another sliding tradeoff.
The catch is that icebergs aren’t that hidden. A trader watching the book sees your displayed tranche refill repeatedly and infers the iceberg — “iceberg detection.” Harris Ch. 4 mentions it; the academic results cluster in the 2005–2015 era (see Eisler, Bouchaud, and others).
The hidden order goes further: “rest in the book with zero displayed size.” It can be hit by incoming marketable orders but is invisible on L2 feeds. The price is written into the priority rules: most exchanges rank hidden orders behind all displayed orders at the same price. You can post hidden at the bid and still be last in line — invisibility is purchased with queue position.
The Market Maker’s Tool: Pegged Orders
A pegged order outsources price-tracking to the exchange: “keep my order at best bid + offset / best ask − offset / the midpoint, automatically.” Market makers use it to stay glued to the touch; peg-to-midpoint is the standard choice for liquidity providers seeking midpoint fills.
It bites two ways: in fast markets a crowd of pegs stomps on itself (you’re pegging others who are pegging you), and a wrong offset can make you cross the spread unintentionally, flipping you from maker to taker. Arithmion’s PeggedOrder simulates peg latency — at the millisecond level, that latency is a real effect.
The Marketable Limit Order
The workhorse of execution algos is actually a hybrid: “buy at or lower,” with the current best ask. On arrival it behaves like a market order; once it sweeps to a level its limit can’t reach, the residual rests. You get a market order’s immediacy with a price ceiling attached — protection against runaway fills.
Two boundary cases: set the limit exactly at the touch and it’s indistinguishable from a market order; set it one tick better and you buy a small chance of price improvement along with a real chance of partial fill (some markets) or no fill (others).
Time-in-Force Flags
Every type above also has a time dimension: how long the order lives. Day (DAY) cancels at the close — the retail default. Good-til-cancelled (GTC) rests until filled or pulled, with most brokers capping it at 60–90 days. GTC’s trap is that stale doesn’t mean dead: the order sits at a price that stopped being relevant, and the day the price wanders back, it fills you at a level you don’t remember agreeing to. Audit your GTC stack periodically. Good-til-date (GTD) is GTC with an explicit expiry, more common in institutional systems where compliance demands expiration.
Two taker-side flags are execution-algo tools. Immediate-or-cancel (IOC): fill what you can now, cancel the rest — for taking liquidity without leaving residual exposure sitting on the book. Its fill ratio
lands between 0 and 1, with the expectation set by book depth at your limit. Fill-or-kill (FOK) is stricter: all-or-nothing, immediately — for atomic execution, classically arbitrage, where both legs must fill together or you carry unwanted exposure. FOK gets rejected often in illiquid names (the full size isn’t there), and retail traders essentially never need it.
Finally the auction flags: at-the-opening (OPG) and at-the-close (MOC) execute only in the official auctions — this is how index funds and ETFs rebalance at the close. An MOC fills at the closing auction print, the volume-weighted clearing price of all MOC, LOC, and marketable-on-close orders. The closing print is usually steadier than the last second of continuous trading, but in volatile names it can still land a tick or more from the last quote.
When to Use Each: A Decision Tree
You’re placing an order. Walk it:
- Need the fill right now? Yes → market order, pay the spread. No → continue.
- Risk-managing an existing position? Yes, must exit → stop-market. Yes, with patience → stop-limit. No → continue.
- Have a price target? Yes → limit order; pick time-in-force by horizon. No → continue.
- Order large relative to displayed size? Yes → iceberg, or an execution algo (VWAP, TWAP, implementation shortfall). No → continue.
- Trying to hide? Yes → hidden or iceberg. No → standard limit.
- Need atomic execution? Yes → FOK. No → IOC or standard limit.
Most of the time you end up with the same four: limit DAY, limit GTC, market, stop-market. The exotic types exist for specific problems; if the problem hasn’t shown up, don’t use them.
Computing Limit vs. Market
Back to the most common everyday decision: when to post a limit rather than cross the spread. This one you can calculate.
Let the spread be (in price units) and the current mid . A market buy expects to cost half a spread over mid: . A limit posted at fills with probability by horizon ; if it doesn’t fill and you still want the position, you cross later near with a chase cost . The limit’s expected cost is . Limit beats market exactly when:
The left side is “what you save when you fill” times the fill probability — posting at the bid () saves you a full spread. The right side is “what the chase costs when you don’t” times the non-fill probability. In words: the wider the spread and the higher the fill probability, the better posting looks; the faster the market is leaving and the pricier the chase, the better taking looks.
The comparison in Python:
def limit_vs_market(spread, mid_now, mid_future, fill_prob, chase_cost_bps=2):
"""
Compare expected cost of a limit vs a market order (buy side).
spread: full spread in price units
fill_prob: probability the limit fills before mid_future
chase_cost_bps: extra cost (bps) of crossing later if not filled
Returns 'limit' if the limit order is cheaper, 'market' otherwise.
"""
market_cost = mid_now + spread / 2 # cross the spread now
limit_fill = mid_now - spread / 2 # post at the bid: save a full spread
chase = mid_future * chase_cost_bps / 1e4
limit_cost = fill_prob * limit_fill + (1 - fill_prob) * (mid_future + chase)
return "limit" if limit_cost < market_cost else "market"
# Tight book, high fill probability -> posting wins
print(limit_vs_market(0.01, 100.00, 100.005, 0.9))
# Wide book, low fill probability, expensive chase -> taking wins
print(limit_vs_market(0.10, 100.00, 100.05, 0.3, chase_cost_bps=5))
The first print returns “limit”: at 90% fill probability, the saved spread dominates the occasional chase. The second returns “market”: at 30% fill probability you’ll be chasing at a worse price seven times out of ten, and waiting is itself expensive.
A Note on Payment for Order Flow
When you send a market order through a retail broker that takes payment for order flow (PFOF), the order routes to a market maker who pays the broker. The market maker captures the spread, the broker books revenue, and you typically get a fill fractions of a cent worse than the NBBO. This is not illegal; it’s the open structure of US equity markets. But it means “commission-free” is not “cost-free” — the cost can hide in the fill price. Harris discusses market structure and PFOF in Ch. 25–26. On the same theme, empirical work on broker routing incentives (Battalio, Corwin, Jennings, 2016) found that when brokers route by exchange rebates, limit-order execution quality measurably deteriorates. The incentive distortion is real and quantifiable, and at scale it is real money.
If you use Arithmion to evaluate execution quality, the implementation-shortfall module (article 11) compares your fills against the arrival NBBO and puts a number on this cost.
Order type choice is one of the highest-leverage decisions in execution — the same trading intent, submitted differently, can cost several times more or less. Harris gives order types a full chapter (Ch. 4); it’s worth reading in its entirety.
References
- Harris, L. Trading and Exchanges: Market Microstructure for Practitioners. Oxford University Press, 2003. Ch. 4 (order types), Ch. 25–26 (US equity market structure, PFOF). ISBN: 978-0-19-514470-3.
- SEC. Findings Regarding the Market Events of May 6, 2010. 2010.
- Battalio, R., Corwin, S., Jennings, R. “Can Brokers Have It All? On the Relation between Make-Take Fees and Limit Order Execution Quality.” Journal of Finance, 2016.