Market Microstructure: Order Books & Execution Mechanics › Advanced Order Types

Michael BrenndoerferJanuary 9, 20265 min read
Quantitative FinanceAll chapters
Part 12 of 15Market Making and High-Frequency Trading
Chapter 67Market Microstructure: Order Books & Execution Mechanics › Advanced Order Types
Reading section 5 of 13 · Advanced Order Types · 5 minSection 5 of 13 · 5 min

Book contents

Section 5 of 13 · 5 min read

Market Microstructure: Order Books & Execution Mechanics › Advanced Order TypesOne section · Sections in this chapter5 / 13 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Beyond basic market and limit orders, exchanges and brokers offer specialized order types designed for specific trading needs.

Immediate-or-Cancel (IOC)

An IOC order executes whatever quantity is immediately available and cancels the remainder. If you submit an IOC buy for 1,000 shares and only 400 are available at your limit price, you receive 400 shares and the remaining 600-share request is cancelled.

IOC orders are useful when you want to take available liquidity without leaving a footprint in the order book.

Fill-or-Kill (FOK)

A FOK order must execute in its entirety immediately, or it is cancelled completely. Unlike IOC, there are no partial fills. This is used when partial execution would be undesirable, such as when hedging an exact position size.

Good-Till-Cancelled (GTC)

Most orders are day orders; they expire at market close if unfilled. A GTC order remains active until it executes or is explicitly cancelled, potentially staying on the books for weeks or months.

Iceberg Orders (Reserve Orders)

You might face a dilemma when executing large orders: you need to execute substantial orders, but displaying your full size would reveal your intentions and move prices against you. Iceberg orders solve this problem by splitting the order into a visible portion and a hidden reserve.

Iceberg Order

An iceberg order displays only a portion of the total order quantity in the visible order book. As the visible portion executes, more quantity is automatically revealed from the hidden reserve.

Iceberg orders help you minimize market impact by hiding the true size of your interest:

In[17]:
Code
@dataclass
class IcebergOrder:
    """An iceberg order with visible and hidden components."""

    total_quantity: int
    display_quantity: int
    price: float
    side: Side
    filled_quantity: int = 0

    @property
    def visible_quantity(self) -> int:
        remaining = self.total_quantity - self.filled_quantity
        return min(self.display_quantity, remaining)

    @property
    def hidden_quantity(self) -> int:
        return max(
            0,
            self.total_quantity - self.filled_quantity - self.display_quantity,
        )

    def fill(self, quantity: int) -> int:
        """Process a fill. Returns actual filled quantity."""
        fillable = min(quantity, self.total_quantity - self.filled_quantity)
        self.filled_quantity += fillable
        return fillable


# Example iceberg order
iceberg = IcebergOrder(
    total_quantity=10000, display_quantity=500, price=100.00, side=Side.BID
)

# Capture initial state
initial_visible = iceberg.visible_quantity
initial_hidden = iceberg.hidden_quantity

# Simulate execution: 3 fills of 500 shares
fill_size = 500
fills_count = 3
for _ in range(fills_count):
    iceberg.fill(fill_size)

# Capture final state
final_filled = iceberg.filled_quantity
final_visible = iceberg.visible_quantity
final_hidden = iceberg.hidden_quantity
Out[18]:
Console
Iceberg Order Example
========================================
Total Size: 10,000 shares
Display Size: 500 shares

What market participants see in order book:
  Bid: 500 shares @ $100.00

Actual state:
  Visible: 500 shares
  Hidden: 9,500 shares

After 3 fills of 500 shares each:
  Filled: 1,500 shares
  Visible: 500 shares
  Hidden: 8,000 shares

Traders look for "iceberg detection" patterns: repeated fills at the same price level that keep replenishing suggest hidden liquidity.

Key Parameters

The key parameters for Iceberg Orders are:

  • Total Quantity: The full size of the order to be executed. This represents your complete trading interest.
  • Display Quantity: The portion of the order visible in the order book at any given time. This should be set large enough to attract counterparties but small enough to avoid revealing the true order size.
  • Hidden Quantity: The remaining quantity kept off the book, calculated as the difference between total quantity and display quantity. This hidden portion automatically replenishes the visible portion as fills occur.
  • Price: The limit price at which the order is placed. The entire order, both visible and hidden portions, executes only at this price or better.

Pegged Orders

Pegged orders automatically adjust their price relative to a reference point such as the NBBO (National Best Bid/Offer), midpoint, or a benchmark.

The main types of pegged orders include:

  • Primary peg: Pegged to the same-side NBBO (bid for buy orders, ask for sell orders)
  • Midpoint peg: Pegged to the midpoint between bid and ask
  • Market peg: Pegged to the opposite-side NBBO

Midpoint-pegged orders are popular for passive execution strategies because they potentially receive price improvement (better than the visible bid or ask) while still participating when the spread moves.

Algorithmic Order Types

Many brokers offer high-level algorithmic order types that translate into sophisticated execution strategies:

  • VWAP (Volume-Weighted Average Price): Execute throughout the day to match the market's volume pattern, targeting the volume-weighted average price
  • TWAP (Time-Weighted Average Price): Execute evenly over a specified time period
  • Percentage of Volume (POV): Execute as a target percentage of market volume
  • Implementation Shortfall: Minimize the difference between decision price and execution price

As we discussed in the chapter on transaction costs, these algorithms balance the trade-off between market impact and timing risk. We'll explore their implementation in detail in the next chapter on execution algorithms.