DEV Community

pickuma
pickuma

Posted on • Originally published at pickuma.com

Order Types Explained for Retail Algorithmic Traders

When you automate trading, the order type your code submits is as consequential as the signal that triggered it. A correct prediction executed with the wrong order type can still lose money — filling far from the price you expected, or not filling at all when it mattered. Most retail algo traders learn the order types just well enough to place a trade and never internalize the trade-offs, which is exactly where slippage and missed fills come from. This is the practical breakdown. None of this is investment advice.

Market vs limit: the fundamental choice

Every order is, at heart, a choice between certainty of execution and certainty of price. You rarely get both.

A market order says "fill me now, at whatever the best available price is." It prioritizes execution — it will almost certainly fill — but you don't control the price, and in a fast-moving or thinly-traded market the price you get can be meaningfully worse than the one you saw. That gap is slippage, and market orders are where it lives.

A limit order says "fill me only at this price or better." It gives you price control — you'll never pay more than your limit on a buy — but it surrenders certainty of execution. If the market never reaches your price, or moves through it too fast, your order sits unfilled while the opportunity passes. For an automated strategy, an unfilled limit order means your position differs from what your backtest assumed, which is its own kind of risk.

In a deep, liquid market (a large-cap stock, a major ETF), a market order's slippage is usually tiny and the market-vs-limit choice is minor. In a thin or volatile market — small-caps, illiquid options, off-hours — a market order can fill far from the quote. The less liquid the instrument, the more the order type matters.

Stop orders: triggers, not guarantees

A stop order sits dormant until the price crosses a trigger level, then activates. A stop-loss to limit downside is the classic use. But there's a crucial distinction in what it becomes when triggered.

A stop-market order becomes a market order at the trigger — guaranteeing execution but not price, so in a gap or a crash it can fill well below your stop level. A stop-limit order becomes a limit order at the trigger — guaranteeing you won't fill worse than your limit, but risking no fill at all if the price gaps straight through it. That difference is exactly the wrong thing to discover during a sharp move: a stop-loss meant to protect you can fail to fill (stop-limit) or fill at a brutal price (stop-market), depending on which you chose.

Stops trigger on price crossing a level, but what happens next depends on the type — and neither variant guarantees both a fill and a good price during a fast move or an overnight gap. Don't assume a stop-loss caps your loss at the stop level; understand whether yours is stop-market or stop-limit and how it behaves when the market jumps.

Time-in-force: how long an order lives

The last piece automated traders often overlook is time-in-force, which controls an order's lifespan. Day orders expire at the close of the trading day. GTC (good-til-canceled) orders persist across sessions until filled or canceled — useful, but easy to forget about until an old order fills unexpectedly. IOC (immediate-or-cancel) fills whatever it can right away and cancels the rest, and FOK (fill-or-kill) requires the entire order to fill immediately or none of it does.

These flags matter more in automation than in manual trading because your code places orders without a human watching. A GTC order your strategy forgot about can fill days later in conditions your logic never intended; an IOC or FOK is the right tool when you only want a fill under specific immediate conditions. Set time-in-force deliberately, log every order, and make sure your system reconciles what it intended against what actually filled.

The throughline: order type and time-in-force are part of your strategy's risk profile, not boilerplate. The same signal can be a good trade or a bad one depending on how you instruct the exchange to act on it. Choose deliberately based on the instrument's liquidity and the urgency of the trade, and your live results will track your intentions far more closely.

Order types are unglamorous plumbing that quietly determine whether your strategy behaves as designed. Learn what each one trades away — price for certainty, or certainty for price — and your automated trades will stop springing the expensive surprises that catch traders who treated the order type as an afterthought.


Originally published at pickuma.com. Subscribe to the RSS or follow @pickuma.bsky.social for new reviews.

Top comments (0)