Bid-Ask Spread

The difference between the highest price a buyer is willing to pay (bid) and the lowest price a seller is willing to accept (ask). The spread represents a direct cost of trading and a source of profit for market makers.

The bid-ask spread is the difference between the best available buy price (the bid) and the best available sell price (the ask) for a financial instrument at any given moment. It is the most fundamental transaction cost in trading and exists in every market where buyers and sellers interact. Understanding the spread is essential for accurate backtesting and realistic performance estimation.

How the spread works

At any point during market hours, there are buyers willing to purchase at various prices and sellers willing to sell at various prices. The highest buy price is the bid, and the lowest sell price is the ask. The ask is always higher than the bid. If a trader wants to buy immediately, they pay the ask price. If they want to sell immediately, they receive the bid price. The difference is the spread.

For highly liquid instruments like large-cap stocks or major currency pairs, the spread might be as small as one cent or one pip. For less liquid instruments like small-cap stocks, exotic options, or thinly traded ETFs, the spread can be much wider, sometimes representing a significant percentage of the instrument's price.

Why the spread matters for trading

The spread is a cost that must be paid on every round-trip trade (buy then sell, or sell then buy). A strategy that enters and exits positions frequently pays the spread each time, and this cost compounds. For a stock with a $0.02 spread trading at $50.00, each round trip costs 4 basis points (0.04%). Over 1,000 round trips per year, the cumulative cost is 4%, which can easily eliminate a strategy's edge.

Many naive backtesting engines ignore the spread entirely, assuming orders fill at the mid price. This overstates returns by exactly the spread amount per trade. For high-frequency strategies that trade dozens or hundreds of times per day, ignoring the spread can turn a losing strategy into an apparently profitable one.

Factors that affect spread width

Liquidity is the primary determinant. Instruments with more market participants and higher trading volume tend to have tighter spreads. Volatility widens spreads because market makers face more risk of adverse price movements and compensate by quoting wider markets. Time of day matters as well: spreads tend to be wider at market open and close, and during off-hours or pre-market sessions.

Market structure also plays a role. Instruments traded on centralized exchanges with competing market makers tend to have tighter spreads than those traded over-the-counter where fewer dealers may be quoting.

Practical example

A day trading strategy generates 20 round-trip trades per day on a stock with an average spread of $0.05 at a price of $100. The spread cost per trade is 5 basis points, and the daily spread cost is 100 basis points (1%). Over 252 trading days, the annual spread cost is approximately 252%. Even before considering other costs like commissions and slippage, the strategy needs to generate more than 252% annual gross returns just to break even on spread costs. This illustrates why high-frequency strategies require extremely tight spreads to be viable.

How Tektii helps

Tektii's backtesting engine models the bid-ask spread using actual historical spread data rather than assuming a fixed spread or ignoring it entirely. Buy orders fill at the ask and sell orders fill at the bid, reflecting the real cost of execution. This prevents traders from overestimating their strategy's profitability and ensures that backtest results account for one of the most significant and unavoidable trading costs.

See bid-ask spread in action

Test your trading strategies with professional backtesting tools and real market data.

Start for free