Electronic Markets and Trade Execution
Theory decides what to hold; execution decides what you actually pay to hold it — and poor execution leaks straight into fund performance. This lesson opens the modern electronic market: the limit order book, the two order types and their market impact, the VWAP/TWAP/POV execution algorithms and how their cost is benchmarked, then high-frequency trading and the big-data / machine-learning tools reshaping investment.
On this page
Modern exchanges (e.g. the NYSE) are electronic double auctions: buyers post bid prices (the most they'll pay), sellers post ask (offer) prices (the least they'll accept). A trading day has an opening auction, continuous intraday trading, and a closing auction (not every venue runs all three).
Learning outcomes
- Read a limit order book and identify the best bid/ask.
- Execute market and limit orders and compute the resulting price and market impact.
- Compute VWAP/TWAP benchmarks and the VWAP transaction cost.
- Contrast the VWAP, TWAP and POV execution algorithms.
- Explain high-frequency trading, latency arbitrage, and machine learning in finance.
The limit order book
At any instant, supply and demand are summarised by the limit order book (LOB), which has many levels of bid and ask prices with aggregate sizes. Using a Vodafone snapshot (best 3 levels):
The best bid (122.50) and best ask (122.55) are simply "the bid" and "the ask". You will never see an ask ≤ a bid — if that happened, trading would instantly clear it.
Market orders
A market order executes immediately at the best available prices, walking down the book if one level can't fill it. Pro: near-guaranteed quick execution. Con: no price control and potential market impact.
A market sell of 10,000 shares
Using the Vodafone book, sell 10,000 at market. Find the proceeds, average price and the book afterwards.
Show solution
5,696 fill at the best bid 122.50; the remaining 4,304 fill at 122.45. Proceeds \(=5696(122.50)+4304(122.45)=1{,}224{,}784\); average price \(=1{,}224{,}784/10{,}000=122.478\). Afterwards the 122.50 level is emptied and 122.45 has \(30{,}179-4{,}304=25{,}875\) left — the order has pushed the price down (market impact).
Proceeds 1,224,784; avg 122.478; new best bid 122.45 (size 25,875)Limit orders
A limit order executes only at a target price or better. If it doesn't cross the book it simply joins the queue at its level; if a limit buy's price is at/above the best ask it executes against those sellers, with any remainder resting on the book. Pro: price guaranteed. Con: execution is not — it may wait, or never fill.
Two limit buys
(a) Limit buy 10,000 @122.50. (b) Limit buy 50,000 @122.55.
Show solution
(a) 122.50 is the bid, not the ask — nothing executes; you join the queue and the 122.50 size grows to \(5696+10000=15{,}696\) (with 5,696 ahead of you). (b) 122.55 is the best ask with 49,432 shares: 49,432 of your 50,000 fill immediately; the leftover \(568\) rests as a new bid at 122.55. A marketable limit order behaves like a market order up to its limit price.
(a) queue at 122.50 → size 15,696; (b) 49,432 filled, 568 rest at 122.55Execution benchmarks: VWAP and TWAP
Trading a large order means balancing speed against price. Performance is judged against benchmarks:
VWAP transaction cost
Market trades: (12,300), (14,100), (10,150), (10,200), (13,350). A trader buys: (12,100), (10,50), (13,150). Find the VWAP benchmark, the trade VWAP and the VWAP cost.
Show solution
Benchmark \(=\frac{300(12)+100(14)+150(10)+200(10)+350(13)}{1100}=11.8636\). Trade VWAP \(=\frac{100(12)+50(10)+150(13)}{300}=12.1667\). For a buy, cost \(=300\times(12.1667-11.8636)=\textbf{90.92}\) — the trader paid above market. The TWAP (volume-ignoring) here is \(\frac{12+14+10+10+13}{5}=11.8\), useful when one giant trade would distort the volume-weighted figure. Caveat: if a trader is most of the day's volume, trade VWAP ≈ benchmark by construction, making the cost a misleading ~0.
Benchmark 11.8636, trade VWAP 12.1667, VWAP cost 90.92Execution algorithms
An execution algorithm slices a large order and sends pieces over time. A VWAP algo schedules trades on the historical intraday volume profile — trading more when volume is high (open/close) — aiming to hit/beat VWAP. A TWAP algo sends equal slices uniformly over time (e.g. every 5 minutes), targeting TWAP. Both have a deterministic schedule. A percent-of-volume (POV) algo instead adjusts dynamically, trading a fixed fraction (say 10%) of the actual volume each interval — adapting better to real liquidity, but without guaranteeing completion by day's end.
High-frequency trading
HFT is algorithmic trading using high-speed computation for executions in fractions of a second — characterised by very short holding periods, many small trades, a high order-to-transaction ratio, and complex algorithms. Uses include signal trading (from news/the LOB), index arbitrage with derivatives/ETFs, statistical trading (pairs, mean reversion), and latency arbitrage.
Latency is the delay between sending an order and its arrival. HFT firms shave it via co-location (servers next to the exchange) and even microwave links (faster than fibre), gaining a speed and information edge. Pros: tighter bid-ask spreads, added liquidity, faster arbitrage elimination (more efficient markets). Cons: a costly technological arms race, predatory/unethical latency arbitrage, little human oversight, and herding of similar algos raising systemic risk — as in the May 2010 flash crash.
Big data and machine learning
Big data is characterised by three V's: volume (millions/billions of points), velocity (real-time generation), and variety (text, images, video — not just numbers). Machine learning is, in essence, statistical model-fitting: predict \(y\) from attributes via \(y=f(x_1,\dots,x_n;\theta)\), and "learn" the parameters \(\theta\) from data.
A neural network is just a richer, multi-layer non-linear regression — feed inputs through a linear stage, apply an activation function, repeat; many hidden layers make a deep network (deep learning). Applications include text-mining sentiment (ratio of "excitement" to "anxiety" words) and using satellite/street-view images to estimate house prices. Pros: the universal approximation theorem (a rich enough network can approximate any function), efficient fitting at scale, and accessible free tools (Python, Keras, TensorFlow, scikit-learn). Cons: over-fitting (mistaking noise for signal, failing out-of-sample) and a black-box nature that resists interpretation. Reinforcement learning goes further — the model continuously fine-tunes as it observes new data, choosing \(\text{action}=f(\text{state})\) and learning from the reward (the technology behind AlphaGo and dynamic trading).
Execution is where theory meets cost. The limit order book aggregates bids and asks; market orders guarantee speed but pay market impact, while limit orders guarantee price but not fill. Large orders are sliced by VWAP/TWAP/POV algorithms and judged against the VWAP benchmark. HFT compresses spreads and adds liquidity but fuels a latency arms race and systemic fragility, while big data and machine learning — from linear regression to deep and reinforcement learning — extend the analyst's toolkit, powerful but prone to over-fitting and opacity.