The Claude Quant PlaybookDownload ebookDownload ebook

Mid price

The mid price is the average of the best bid and the best ask. It is the simplest estimate of what the asset is worth at this instant.

Build a trading system with Claude.Download ebook

01The formula

the mid price: the halfway point of the market
the best bid: the highest price anyone is willing to pay right now
the best ask: the lowest price anyone is willing to sell at right now

02See it move

03Where it is used

04Why traders use it

Trade prices jump between the bid and the ask even when nothing has changed. The mid strips out that bounce, so it is the standard reference for marking positions, measuring costs and building signals.

05Worked example

With a best bid of $99.99 and a spread of 2 ticks, the best ask is $100.01 and the mid is $100.000. Anyone who buys at the ask pays $0.010 more than the mid: half the spread.

06How it is built

  1. Read the top of the book: the highest bid and the lowest ask .
  2. The true value is somewhere in between, otherwise someone would trade.
  3. With no other information, take the halfway point: .
  4. The distance from mid to either side, , is the half-spread: what a market order pays for immediacy.

07The common mistake

Treating the mid as a price you can trade at. You buy at the ask and sell at the bid; the mid is only a reference. It also ignores size, so a book with 100 shares on the bid and 10,000 on the ask has the same mid as a balanced one.

08In Python and LaTeX

b, a = 99.99, 100.01
mid = (b + a) / 2
print(round(mid, 3), 'half-spread', round((a - b) / 2, 3))
m = \frac{b + a}{2}

09Where it fits

Rather not code the maths yourself? Describe your trading idea and let AI build the bot.

Build a bot with AgenKit

The worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.