Noon Barbari
Registrati
Tutti gli articoli
concettoPubblicato ·8 min di lettura

Order types, explained: market, limit, stop, stop-limit, OCO

The choice of order type is half the trade. Pick wrong and you'll pay 30 bps in slippage on what looked like a perfect entry — and you'll never know why your live results trail the backtest.

In questa pagina

Every trade has two halves: the decision (when, what, how much) and the execution (how the order actually hits the book). Retail strategies obsess over the decision and ignore the execution, and then they wonder why the live equity curve trails the backtest by a few percent per month. That gap is almost entirely about order types.

The five you actually need

Modern exchanges support dozens of order types — iceberg, post-only, time-in-force variations, time-weighted average price (TWAP), implementation shortfall, and so on. For retail systematic trading, you only need to deeply understand five.

Market orders

Buy or sell immediately at the best available price. The price isn't fixed — you take whatever the order book gives you. Fast and certain to fill, but you pay the spread and, for larger sizes, slippage into deeper levels of the book.

Use a market order when: you must be in or out right now (a stop-loss being triggered; news-driven exits) and the size is small relative to the book's depth. Avoid when: precision matters or your size is comparable to the visible bid/ask.

Limit orders

Specify a price; the order fills only if the market reaches that price. A buy limit at $40,000 means "I'll pay up to $40,000 — fill me at that price or better." The order sits in the book until filled or cancelled.

Use a limit when: you want a specific price and you're willing to risk not filling at all. Most exchanges pay you for posting limit orders (the maker rebate) instead of charging you (the taker fee), so limits are cheaper if you can wait.

Stop orders

A stop order is dormant until a trigger price is touched, then it converts into a market order. A sell stop at $39,000 means "if the market trades at $39,000 or lower, immediately sell at market." Used almost exclusively for stop-losses (limit downside) and breakout entries (buy on the breakout).

The catch: once triggered, the order becomes a market order. In fast markets or thin books, you can be filled significantly below your trigger price. A stop-loss at $39,000 in a flash crash might fill at $37,500 — your worst-case loss is the trigger plus slippage, not the trigger itself.

Stop-limit orders

Combines a stop trigger with a limit order. "Sell stop-limit, stop $39,000, limit $38,800" means: when price hits $39,000, place a sell limit at $38,800. Fills only if the market reaches $38,800 or higher.

Solves the slippage problem of plain stop orders, but introduces a new failure: in a fast crash, price can skip past your limit entirely and never come back. You wanted protection at $39,000, you set a limit at $38,800, and price went straight to $35,000 — you're still in the trade with no stop having filled.

OCO (one-cancels-other)

Two orders submitted together; when one fills, the other is automatically cancelled. The classic use: simultaneously place a take-profit limit above the current price and a stop-loss below. Whichever fills first, the other goes away — so you never end up with both legs accidentally executing.

Most exchanges support OCO natively. If yours doesn't, replicate it in code: monitor both orders and cancel the survivor as soon as the other fills. Don't try to manage TP and SL as independent orders — the race condition will eventually bite you.

Maker vs taker (and why it matters)

When you post a limit order that sits in the book waiting, you're a maker — you're providing liquidity. When you cross the spread (market order, or a limit at or beyond the current best price), you're a taker — you're consuming liquidity. Exchanges charge takers more (because they want liquidity in the book) and often pay makers a small rebate.

For a strategy that trades 50 times a month, the maker/taker spread can be 30-60% of total costs. The classic switch: instead of placing a market buy at the current ask, place a limit buy one tick inside the bid and wait a few seconds. If it fills, you saved a basis point or two. If it doesn't, you cross the spread.

How order types affect backtest realism

Most retail backtesters fill every order at the close of the signal bar with no spread, no slippage, no fee. That's effectively assuming every trade is a free market order. Real execution adds three costs: the spread (paid on entry and exit), the fee (per trade), and slippage (for size or in fast markets). A naive backtest that ignores all three can show a 20% edge on a strategy that lives at -2% in production.

Match the simulator to the order type your live strategy will actually use. The platform's backtester supports market-at-close, limit-on-trigger, and stop-on-trigger fills, each with configurable slippage and fee. The defaults are calibrated to be slightly pessimistic, which is the safer side of the trade-off.

rules.yaml — execution model for a strategy
strategy:
  name: rsi_mean_reversion
  rules:
    entry:  # ...rule tree...
    exit:   # ...rule tree...
  execution:
    entry_order: { kind: limit,  offset_bps: 5,  timeout_bars: 2, fallback: market }
    exit_order:  { kind: market }                                 # priority on filling
    stop_loss:   { kind: stop,   slippage_bps: 8 }                # plain stop, model slip
    take_profit: { kind: stop_limit, stop_offset_bps: 3 }         # safer for TP
  risk:
    size_pct: 1.0
    fees_bps: 10                                                    # 5 each way round-trip

Next steps

Order types are most expensive when they're modelled wrong in a backtest — see the slippage and trading-costs post for the maths of how execution eats edge. The paper trading post covers the step between backtest and live, which is where order-type misalignment usually surfaces first.

Provalo con i tuoi dati

Ogni concetto visto sopra è implementato nella piattaforma. Backtest, walk-forward, paper trading, poi passa al live — stesso set di regole in ogni fase.

Letture correlate