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.
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
- Market makerEarns the spread when it buys on the bid and sells on the ask, and widens it when risk or volatility rises.
- Execution traderAdds half the spread to the expected cost of every market order before choosing between crossing and waiting.
- Portfolio managerCompares spreads in basis points across holdings to judge which strategies can afford to trade often.
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
- Read the best bid and best ask ; the spread is .
- Divide by the mid to express it as a fraction of the price.
- Multiply by 10,000 to get basis points.
- 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{,}00009Where it fits
Rather not code the maths yourself? Describe your trading idea and let AI build the bot.
Build a bot with AgenKitThe worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.