Basic Prerequisites: Probability & Measure Theory and Calculus & Optimization. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)
1. Intuition & Practical Objective
Before any algorithm can trade, it has to answer two questions that have nothing to do with forecasting: what instructions can I send to a market, and where do those instructions actually go? This folder is the entry point of Pillar 2. It maps the trading landscape - the order types an engine may submit, the venues (exchanges, dark pools, OTC) that accept them, the auction and continuous mechanisms that match them, and the fee and regulatory structure that surrounds them - and it is the shared vocabulary every later folder in this pillar assumes.
It is a hub. It gives you (a) the fast order-type lookup table below (job #1), (b) the core microstructure quantities (spread, micro-price, effective spread, adverse-selection measures) in one place, and (c) routes to six sub-pages that climb from zero-knowledge intuition to the HFT strategy taxonomy.
The one-sentence essence. “A market is a mechanism, not a place: you submit a typed instruction - market, limit, stop, IOC/FOK, hidden, pegged - into a matching engine (or dark pool, or dealer quote) that fills it under explicit price-time (or pro-rata) priority, and every fee, rebate, and regulation is a constraint on how that instruction is routed and priced.”
Scope note (avoid duplication). This folder is the order-and-venue view - what you can send, and where. The deep limit-order-book mechanics (L2/L3 book reconstruction, matching-engine internals, queue dynamics) live in Pillar 6, Limit Order Book Mechanics; the fill-probability perspective lives in Queue Position & Fill Probability. This folder cross-links them rather than repeating them.
2. Mathematical Ground Truth & Derivations
Quick-Reference Lookup (job #1) - the order-type menu.
| Order type | Instruction | Adds / takes liquidity | Fill rule | Typical use | Primary risk |
|---|---|---|---|---|---|
| Market | execute now, any price | takes | sweeps book, walks the levels | immediate exit; urgency | slippage vs quoted price |
| Limit | execute at price or better | adds (if passive) | rests until crossed | patient entry/exit; earn spread | non-execution / adverse selection |
| Stop / stop-limit | trigger when crosses stop , then market/limit | becomes taker at trigger | latent until trigger | protective stop, momentum entry | gaps & trigger cascades |
| IOC | fill what you can now, cancel rest | takes | partial ok, no rest | aggressive stat-arb sniping | partial fill leaves residual |
| FOK | fill entire size now or cancel | takes | all-or-nothing | arbitrage legs, block sweeps | rejection rate |
| AON | all-or-nothing, may rest | either | no partial fills | large blocks | longer queue wait |
| Hidden | limit, invisible in book | adds | fills, but usually loses priority to visible | size concealment | worse queue position, detection |
| Iceberg / reserve | show tip , keep hidden | adds | tip fills, then reload at back of queue | large passive size | reload forfeits FIFO |
| Pegged | price tracks mid/best bid/best ask ± offset | adds or takes | re-priced as reference moves | relative-value quotes | adverse selection on stale peg |
| Post-only | only adds; cancel if it would cross | adds | reject on cross | rebate capture, no take | missed fills |
| Midpoint peg / dark | trade at the NBBO midpoint | adds (no display) | matches inside spread | minimize footprint | low hit-rate, adverse selection |
| Discretionary | visible price, hidden willingness behind it | adds | leaks into price improvement | competitive quoting | information leakage |
Notation. best ask/bid; mid ; spread ; sizes ; direction for buy/sell; transaction price ; efficient (latent) price ; half-spread components.
Core microstructure quantities (cross-checked against Hasbrouck, Foucault).
- Quoted spread / relative spread (Foucault eq 2.1):
- Micro-price (size-weighted midpoint): - leans toward the thin side, a short-horizon tick predictor.
- Effective half-spread (Foucault eq 2.3): - the realized cost of immediacy versus the contemporaneous mid.
- Realized half-spread (Foucault eq 2.5): - the liquidity supplier’s profit after the market has moved (the mirror image of adverse selection).
- Roll model (Hasbrouck Ch 3):
- Kyle price impact (Hasbrouck Ch 7): , with market depth .
- Glosten–Milgrom adverse-selection spread (Hasbrouck Ch 5), symmetric prior: - the spread is the information cost of facing an informed share .
Fee identity (maker-taker). For a trade of shares, the all-in cash cost is
with at a traditional venue and the signs flipped at an inverted venue.
3. Computational Implementation - the hub demo
A single tiny book demonstrating the quantities above: micro-price, the market-order walk, and the limit/IOC/FOK distinction. Runs on the standard library only and is re-executed and reproduced below (full scripts live on each sub-page).
Read the numbers. The 800-share bid versus the 300-share ask pulls the micro-price () above the mid () toward the ask - a real-time bid-pressure signal. The same 1000-share buy costs as a market order (5.50 bps worse than the best ask) but only as a crossing limit; an FOK of that size is simply rejected because only 300 shares are shown at 100.05.
4. Failure Modes & First-Principles Breakdowns
Hub signposts - the full analysis is in 05 · Failure Modes & Practice. In one line each:
- Order-type misuse - using a market order for size in a thin book (walks the levels), or an FOK where partial fills are acceptable, converts a controllable cost into a binary loss.
- Hidden-liquidity illusion - iceberg reloads forfeit FIFO and dark/midpoint orders have low hit-rates; the visible tip under-represents the true queue.
- Latency as adverse selection - a stale quote is a free option written to faster traders; pick-off loss scales like in the latency .
5. References
- Hasbrouck, Joel - Empirical Market Microstructure (2007)
- O’Hara, Maureen - Market Microstructure Theory (1995). The theoretical bedrock: price formation, dealer and sequential-trade models.
- Harris, Larry - Trading and Exchanges (2003). The plain-English practitioner map of who trades, how venues are structured, and how every order type behaves.
- Foucault, Pagano & Röell - Market Liquidity (2013)
- Abergel, Anane, Chakraborti, Jedidi & Toke (eds.) - Limit Order Books (2016); Gould et al. - “Limit order books,” Quantitative Finance 13(11), 2013. *Deep LOB modeling
6. Connected Graph Bridges
- Foundational base: Probability & Measure Theory · Statistics & Inference
- LOB mechanics depth (cross-linked, not duplicated): Limit Order Book Mechanics · Queue Position & Fill Probability
- Adverse selection & spread: Adverse Selection & Glosten–Milgrom · Spread Decomposition & the Roll Model
- Sub-pages (in-folder): 01 From Zero · 02 Order Types · 03 Exchanges & Venues · 04 Auctions & Continuous Trading · 05 Failure Modes & Practice · 06 Advanced Extensions