Market Order

An order to buy or sell immediately at the best available price. Market orders guarantee execution but not price, making them susceptible to slippage, especially in volatile or illiquid markets.

A market order is an instruction to buy or sell a financial instrument immediately at the best available price. It is the simplest order type and guarantees execution, but it does not guarantee the price at which the execution occurs. Market orders are the default choice when speed of execution matters more than the exact fill price.

How market orders work

When a trader submits a market buy order, the order is matched against the best available sell orders on the exchange. The order fills at the current ask price for the first available shares, then at the next ask price if the first level is exhausted, and so on until the entire order is filled. This process is called walking the book.

For small orders in liquid markets, the difference between the expected price and the actual fill price is minimal. The entire order fills at or very near the best ask price. For larger orders or less liquid instruments, the order may consume multiple price levels, resulting in an average fill price that is significantly worse than the displayed best price.

Market orders versus limit orders

Market orders and limit orders represent the fundamental tradeoff between execution certainty and price certainty. A market order guarantees you will get your trade done, but you accept whatever price the market offers. A limit order guarantees your price but risks not being filled at all.

For strategies that generate time-sensitive signals, such as momentum breakouts or news-driven trades, market orders are often appropriate because the cost of missing the trade exceeds the cost of slightly worse execution. For strategies that are price-sensitive, such as mean reversion strategies buying at specific support levels, limit orders make more sense.

Slippage and market impact

Market orders are the primary source of slippage in live trading. The slippage has two components. First, the bid-ask spread: a market buy fills at the ask, not the mid price. Second, market impact: for orders larger than the available quantity at the best price, the order pushes the price against the trader as it fills at progressively worse levels.

The magnitude of slippage depends on the instrument's liquidity, the order size relative to available volume, and market conditions at the time of execution. During volatile periods or around news events, order book depth can thin out dramatically, causing even modest-sized market orders to experience significant slippage.

Market orders in backtesting

Backtesting engines model market orders with varying degrees of realism. The simplest approach fills at the last traded price, which ignores the spread entirely. A better approach fills at the ask for buys and the bid for sells. The most realistic approach simulates the walk-the-book process using actual order book depth data, calculating the average fill price based on available liquidity at each level.

Practical example

A breakout strategy detects that a stock has broken above resistance at $100 and submits a market buy order for 5,000 shares. The order book shows 1,000 shares at $100.02, 2,000 at $100.05, and 3,000 at $100.08. The order fills 1,000 at $100.02, 2,000 at $100.05, and 2,000 at $100.08, for an average fill price of $100.054. The expected price was $100.02, so the slippage is $0.034 per share, or 3.4 basis points.

How Tektii helps

Tektii's execution model simulates market orders against actual historical tick data, accounting for available volume at each price level. Rather than assuming fills at the last price or mid price, the engine calculates realistic fill prices based on the liquidity that existed at the moment of execution. This prevents traders from overestimating returns from strategies that rely on market orders for entries and exits.

See market order in action

Test your trading strategies with professional backtesting tools and real market data.

Start for free