Trading the Breaking

Trading the Breaking

Share this post

Trading the Breaking
Trading the Breaking
HFT: Basics of orderflow
Alpha Lab

HFT: Basics of orderflow

If you don’t understand order flow, you’re trading blind. Here’s what happens when smart money enters the game

πš€πšžπšŠπš—πš π™±πšŽπšŒπš”πš–πšŠπš—'s avatar
πš€πšžπšŠπš—πš π™±πšŽπšŒπš”πš–πšŠπš—
Feb 07, 2025
βˆ™ Paid
14

Share this post

Trading the Breaking
Trading the Breaking
HFT: Basics of orderflow
2
Share

Table of contents:

  1. Introduction.

  2. What is order flow?

  3. Why flat lines are a myth?

  4. The square-root law

  5. The basics of reaction-diffusionβ€”aka simulating the trading frenzy


Introduction

Picture this: you’re selling ice cream on a sunny beach. Life’s good. But suddenly, a bus full of tourists arrives. Your cart is swarmed. Do you:
A) Keep prices the same and run out of ice cream in 5 minutes?
B) Raise prices because heck yeah, supply and demand?

If you picked B, congratulations! You’ve just mastered the first rule of trading: big demand β†’ higher prices. But here’s the twist: in financial markets, it’s not quite that simple. Instead of tourists, imagine hedge funds with billion-dollar orders. Instead of ice cream, think Tesla shares. And instead of you, picture a grumpy market maker muttering, β€œWhy can’t these traders just stick to small orders?”

Before we dig in, a friendly reminder: while many sophisticated models might mention topics like overfitting or the Kelly criterion, today we’ll leave those behind. Our focus is on clear, engaging insights and simple mathematics. Ready to trade some ice cream for knowledge? Let’s begin!

What is order flow?

Let’s start with a hypothesis: Big trades move prices more than small ones. Shocking, right? But how do we quantify this? Enter order flowβ€”the heartbeat of markets that refers to the sequence of transactions. Every buy/sell order tells a story:

  • Small orders are like casual conversations among friends.

  • Big orders are the equivalent of shouting across the room, grabbing everyone’s attention.

In 1991, Joel Hasbrouck published a paper titled Measuring the Information Content of Stock Trades. His findings?

  1. Price impact isn’t instant. Like bad news from your in-laws, it takes time to sink in.

  2. Bigger trades = bigger impact. A 1M order hits harder than a 100 one.

  3. Market makers hate surprises. They widen spreads after big trades.

  4. Illiquid markets = drama queens. Thinly traded stocks overreact to everything.

Speaking of drama, let’s talk about order books β€” the market’s version of a Rorschach test.

Let’s put on our math professor hat for a momentβ€”don’t worry I promise to keep it simple. Suppose we denote the order size by Q. In many trading scenarios, the impact of a trade isn’t directly proportional to Q. Instead, it’s more nuanced. Big orders tend to have a disproportionately large effect, but not as dramatically large as a one-for-one increase in size might suggest.

To illustrate, consider a simplistic relationship:

\(I = k \cdot Q^{\alpha}\)

where:

  • I is the price impact.

  • k is a constant that encapsulates market conditions.

  • Ξ± is an exponent that is often less than 1, meaning the impact grows less than proportionally with order size.

For many markets, researchers have found that Ξ± is around 0.5. In plain English, if you quadruple your order size, the price impact roughly doubles rather than quadruples. It’s like our ice cream cart: if you suddenly serve four times as many cones, you might run out faster, but the extra excitement in the queue only increases so much.

Now that we’ve set the stage with order flow, let’s move on to something even more visual: the order book. Think of it as the market’s ledgerβ€”a detailed menu of who is buying and selling, at which prices, and in what quantities. Unlike the neatly drawn lines in textbooks, real order books are as quirky as they are informative. Ready to dive into this art form? Let’s go!

Understanding the Order Book: How It Impacts Trading - SimTrade blog

I must admit that this photo really looks like an avocado and strawberry ice cream πŸ˜‹

Why flat lines are a myth?

Can a system truly remain in a state of perfect equilibrium, or is every flat line just an illusion hiding underlying fluctuations?

In some books, you might see an order book depicted as two perfectly horizontal linesβ€”one for buy orders, one for sell orders. In the real world, however, order books are more like the zany scribbles of a mad artist: they form a V shape, reflecting the depth and liquidity of the market.

Let’s break down a real order book:

  • Buy orders or Bids: These represent the quantities buyers are willing to purchase at different prices. The closer you are to the current market price, the fewer shares you might get, but at a more favorable price.

  • Sell orders or Asks: These indicate the quantities sellers are ready to sell. As you move away from the current market price, you might find larger orders, but at a steeper cost.

Here’s a simplified visual. Fake order books look like this:

|   Buy Orders   |   Sell Orders  |  
|100 shares @ $10|100 shares @ $11|  
|100 shares @ $10|100 shares @ $11|
|100 shares @ $10|100 shares @ $11|  

But real order books? They look like this, just like in the picture above:

|   Buy Orders     |   Sell Orders     |
|50 shares  @ $9.90|50 shares  @ $10.10|
|200 shares @ $9.80|200 shares @ $10.20|
|500 shares @ $9.70|500 shares @ $10.30|

Notice the V shape? As you dig deeper into the order bookβ€”further from the market price. The available quantity increases, but the prices become less attractive. It’s like going to the back of an ice cream truck and finding a shelf full of flavors you wouldn’t normally chooseβ€”even though they’re plentiful.

If order books were actually flat, trading would be as easy as ordering pizza. But no, they’re more like a sushi conveyor beltβ€”the good stuff gets snatched fast, leaving you with seaweed salad.

Okay! Having visualized the order book, let’s move on to one of the most fascinating discoveries in market impact research: the square-root law. If order flow is the market’s gossip and the order book its colorful ledger, then the square-root law is the neat mathematical formula that ties it all together. Let’s crack the code behind this intriguing relationship.

This post is for paid subscribers

Already a paid subscriber? Sign in
Β© 2025 Quant Beckman
Privacy βˆ™ Terms βˆ™ Collection notice
Start writingGet the app
Substack is the home for great culture

Share