The Claude Quant PlaybookDownload ebookDownload ebook

Bid–ask spread in basis points

The spread is the gap between the best price to buy and the best price to sell. Dividing by the mid turns it into a percentage cost you can compare across cheap and expensive stocks.

Build a trading system with Claude.Download ebook

01The formula

the spread in basis points (1 bp = 0.01%)
the spread in price units: best ask minus best bid
the mid price, (b + a)/2

02See it move

03Where it is used

04Why traders use it

A two-cent spread is tiny on a $200 stock and large on a $5 one. Basis points put every instrument on one scale, and the spread is the first cost any strategy has to beat.

05Worked example

A bid of $50.00 with a 2-tick spread gives a spread of $0.02, which is 4.00 bp of the mid. Buying 1,000 shares and selling them straight back costs $20.00.

06How it is built

  1. Read the best bid and best ask ; the spread is .
  2. Divide by the mid to express it as a fraction of the price.
  3. Multiply by 10,000 to get basis points.
  4. A round trip (buy at , sell at ) costs the full spread; a single market order costs about half of it, measured from the mid.

07The common mistake

Counting the full spread as the cost of one trade. One market order pays the half-spread against the mid; only a round trip pays the whole spread.

08In Python and LaTeX

b, a = 50.00, 50.02
mid = (a + b) / 2
print(round((a - b) / mid * 10000, 2), 'bp')
s_{\text{bp}} = \frac{a - b}{m} \times 10{,}000

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.