Skip to content
Level 1 · Chart ReaderLessonPart 01 · page 3 of 622 min
22Minutes
2Sources
StandardRequires

Bid, Ask, Spread and Liquidity

The single price drawn on your chart is a summary of a two-sided market you cannot see. At any moment there is a price at which you could sell and a different, higher price at which you could buy, and the difference between them is a cost you pay before your idea has had a chance to be right or wrong. This lesson makes that cost concrete, then generalises it into the concept that decides more of your research design than any indicator ever will: liquidity.

By the end you should be able to state what the bid and the ask are, calculate the round-trip cost of crossing a spread, describe what market depth adds to the picture, define liquidity in more than one dimension, and explain why a liquidity filter belongs at the front of every study you run.

The bid is the highest price anyone is currently willing to pay. The ask, also called the offer, is the lowest price anyone is currently willing to accept. In a functioning market the bid is below the ask, because if they ever met, the two orders would trade and disappear.

Two consequences follow directly:

  • You buy at the ask and sell at the bid. Not at the price on your chart.
  • The mid price, halfway between them, is a convention used for measurement and for marking positions. It is not a price at which anyone has offered to trade.

The last traded price is a third thing again: a historical fact about a transaction that has already happened. It may sit at the bid, at the ask, or between them, and in a quiet instrument it may be minutes or hours old. The Close on a daily chart is a last traded price, or on many exchanges the price produced by a closing auction — a different mechanism, which the next lesson examines.

The spread is a cost you pay before you are right

Section titled “The spread is a cost you pay before you are right”

Take a share quoted 20.00 bid, 20.04 ask. The spread is 0.04, which is about 0.20 per cent of the price. Suppose you buy 500 shares at the ask and, a moment later with the quote unchanged, sell them back at the bid:

  • Bought: 500 at 20.04 = 10,020
  • Sold: 500 at 20.00 = 10,000
  • Difference: 20, or about 0.20 per cent of the amount invested

Nothing happened. No news, no move, no mistake. The position had to gain 0.20 per cent simply to return you to where you started, before any commission. That is the round-trip cost of crossing the spread, and it is charged on every trade regardless of whether the trade turns out well.

Now scale it by turnover. Consider a rule that holds a position for an average of five trading days. On roughly 250 trading days that is about fifty round trips per position slot per year. At 0.20 per cent each, spread alone consumes something in the region of ten per cent of the capital allocated to that slot over a year, on these assumptions and before commission. A rule holding for sixty days performs roughly four round trips and pays about one twelfth of that.

This arithmetic is not a performance claim about any strategy. It is the reason two rules with identical signals and different holding periods are not comparable until costs are modelled, and it is why short-horizon ideas need a much larger gross effect to survive.

The bid and ask are only the front row. Behind them sits an order book with quantities resting at each price level. A simplified snapshot might look like this:

Bid size Bid price Ask price Ask size
600 20.00 20.04 800
1,500 19.98 20.06 1,200
2,500 19.95 20.09 1,000
3,000 19.90 20.12 2,000

If you send a market order to buy 3,000 shares against this book, you do not get 3,000 at 20.04. You take the 800 available there, then 1,200 at 20.06, then 1,000 at 20.09. The total cost is 60,194, an average of about 20.065 per share. Compared with the 20.04 you saw quoted, you paid roughly 0.0247 more per share, or about 0.12 per cent extra — and the best offer is now 20.12, because you consumed the three cheapest levels outright.

That last point is the important one. Your own order moved the price you received. This is market impact, and it is a function of your size relative to the size available, not of your skill. It is also self-inflicted and invisible in most backtests, which fill the entire order at a single price drawn from the chart.

Depth is only visible with a data feed that carries it, and even then most tools show you less of it than this table suggests. AmiBroker’s real-time quote fields cover the top of the book — best bid, best ask, and the size resting at each — rather than a full ladder of levels; the User’s Guide lists real-time data as a Professional-edition capability. Part 22 covers those quote fields when you get there. For the end-of-day path this course is designed around, you get neither the ladder nor the best bid and ask, and you approximate depth using volume instead, which is exactly what the liquidity filters later in the course do.

Liquidity is not one property. Four dimensions are worth separating, because a market can be generous on some and mean on others:

  • Tightness — how wide the spread is. The cost of a small trade executed immediately.
  • Depth — how much size rests near the touch. The cost of a large trade executed immediately.
  • Resiliency — how quickly the book refills after being consumed. Whether you can repeat the trade, or get out again shortly afterwards.
  • Immediacy — whether trading is happening at all right now. A share that trades in three bursts a day is not continuously available, whatever its daily total suggests.

From end-of-day data you can measure none of these directly, but you can compute serviceable proxies for all of them:

Proxy How it is computed What it stands in for
Average daily volume Mean of the volume series over a window Depth and immediacy, roughly
Average daily turnover Mean of price multiplied by volume The same, but comparable across price levels and currencies
Participation Your intended position size divided by average daily turnover How much of the day’s trading you would have to be
Daily range as a fraction of price Mean of the high minus low, divided by close Very roughly, how expensive immediacy tends to be

Turnover is almost always the better of the first two. A share at 3.00 trading two million shares a day and a share at 300.00 trading twenty thousand shares a day have wildly different share volumes and identical turnover, and it is turnover that tells you whether your intended position is large or small relative to the market. Part 12 builds this into a reusable screening filter.

Practitioners commonly cap a position at a small percentage of average daily turnover. There is no universal correct figure: the right cap depends on your horizon, on how urgently you need to exit, and on how concentrated the trading is within the day. Treat any specific number you read — including any number you adopt yourself — as a convention to be justified, not a rule handed down.

A backtest is a simulation that assumes each signalled trade occurred, at a price you specified, in the size you specified, without disturbing anything. In a heavily traded instrument that assumption is approximately harmless. In a thinly traded one it can be so wrong that the results describe a market that never existed.

In a genuinely illiquid symbol, several of these are routinely true at once:

  • The day’s closing price came from a single small trade, and no larger transaction was possible near it.
  • The day’s entire volume is smaller than the position your sizing rule wants to take.
  • The spread is one, two or five per cent, so a round trip costs more than most of the moves you are trying to capture.
  • Some days have no trades at all, and your data source has filled the gap by repeating the previous close — which Part 2 treats as a data defect, because that is what it is.

There is a nastier consequence hiding behind those bullet points. The largest percentage moves in a universe tend to be concentrated in its smallest and least liquid members, so a rule that ranks by return, or that buys the biggest gainers, tends to select exactly the symbols where the fill assumption fails hardest. That is a tendency you can check on your own universe rather than a law, and it is worth checking before you trust any ranking result. The backtest will look better because it is unrealistic, and it will look better in a way that feels like a discovery. Part 30 devotes a full lesson to this family of errors.

Why the spread belongs in every cost assumption

Section titled “Why the spread belongs in every cost assumption”

Five reasons, each of which recurs later in the course:

  1. It is unconditional. Commission scales with trade count too, but the spread is paid on every entry and every exit whether the idea was right or wrong. It does not average out over many trades; it accumulates.
  2. It scales with turnover. Two rules with the same signals and different holding periods have completely different cost profiles. Comparing them without costs compares the wrong thing.
  3. It scales inversely with liquidity. The same rule can be viable on large, heavily traded shares and hopeless on small ones. Any conclusion of the form “this works” is incomplete without the universe attached.
  4. It is not constant. Spreads tend to widen at the open, around announcements, and when volatility rises — which is to say, exactly when many technical signals fire. A single average figure is a simplification that tends to flatter active rules.
  5. It is often the dominant cost. Commissions have fallen a long way in many markets. For a short-horizon rule in anything other than the most heavily traded instruments, the spread and the impact of your own order usually matter far more.

The practical discipline that follows is short. State the universe. State the liquidity filter. State the round-trip cost you are assuming and where the number came from. Then run the test, and afterwards check how much of the conclusion survives if the cost assumption is doubled.

You can now read a quote as two prices rather than one, and calculate what crossing them costs on a round trip. You know that the book has depth behind the touch, that consuming it moves the price against you, and that this cost is invisible to a backtest. You have four dimensions of liquidity and a set of proxies you can compute from ordinary end-of-day data. And you have a specific reason why a liquidity filter belongs at the very front of any study: without it, your most attractive results will tend to come from the symbols where your assumptions are least defensible.

The next lesson steps back to the mechanism that produces the printed price in the first place, and introduces the scale that every move has to be measured against.

Check your understanding

Question 1. A share is quoted 20.00 bid, 20.04 ask. You buy at market and immediately sell at market, with the quote unchanged. Ignoring commission, what is the result?
Show the answer and why

Answer: A loss of about 0.04 per share, roughly 0.20 per cent

You bought at the ask and sold at the bid, so you paid the full spread. Nothing about the market changed; the cost is structural. This is why holding period and turnover have to be part of any comparison between rules.

Question 2. You are screening a universe containing shares priced from 2 to 900. Which liquidity measure compares them most sensibly?
Show the answer and why

Answer: Average daily turnover, meaning price multiplied by volume

Share volume is not comparable across price levels: a low-priced share can trade enormous share counts and modest value. Turnover expresses the same idea in money, which is the unit your position size is denominated in. Market capitalisation is related but measures the size of the company rather than how much of it trades.

Question 3. Which of these make a backtest fill assumption less defensible? Select all that apply.
Show the answer and why

Answer: The intended position is a large fraction of the symbol’s average daily turnover, The rule buys at the closing price of the signal bar, The symbol has days with no trades, filled in by repeating the previous close

Large participation, acting at a price that was only known once trading ended, and repeated closes standing in for absent trading all weaken the assumption. Filtering to heavily traded shares strengthens it, which is exactly why liquidity filters come first.

Question 4. Why does consuming several levels of the order book cost more than the quoted spread suggests?
Show the answer and why

Answer: Because only the first portion trades at the best price and the remainder trades at successively worse levels

Size available at the touch is limited. An order larger than that size trades through successive levels, so the average fill is worse than the top of the book, and the quote left behind is worse than the one you saw. This is market impact, and it grows with your size relative to the available depth.

Sources for this lesson

2 verified · checked 2026-08-31

  1. 01AmiBroker User's Guide — How to get quotes from various markets§ Real-time data (Professional Edition only)amibroker.com/guide/h_quotes.html2026-08-31
  2. 02AFL Function Reference — GetRTDataamibroker.com/guide/afl/getrtdata.html2026-08-31

Every technical claim on this page was checked against the official AmiBroker documentation on the date shown. Where the course disagrees with folklore, the source is how you can tell which one to trust.