Why Realistic Liquidity Modeling Matters for Backtests
Explore how market depth, fill probability, latency and position size affect backtest realism and learn practical ways to model liquidity constraints.
Produced with automation, then checked by deterministic quality rules and an independent source-grounded review before publication.
- 01Assuming infinite market depth hides execution slippage.
- 02Treating every order as a guaranteed fill ignores order‑book dynamics.
- 03Neglecting latency and routing delays inflates timing accuracy.
- 04Using stale or aggregated price data misrepresents available liquidity.
- 05Failing to model position‑size impact creates unrealistic profit forecasts.
Realistic liquidity modeling is essential for trustworthy backtest results. Ignoring market depth, fill uncertainty, latency, or position impact produces overly optimistic performance that rarely translates to live trading.
What Happens When Market Depth Is Treated as Infinite?
Many backtests apply the historical mid price to every trade, effectively assuming any size can be absorbed without moving the price. In reality order books have limited depth and large orders consume multiple price levels, creating slippage.
- The order‑book depth at the time of the trade is rarely captured in bar data.
- Large positions can shift the market price, especially in thinly traded assets.
- Slippage grows non‑linearly with order size, a factor often omitted.
How Can I Approximate Depth Without Full Order‑Book Data?
Use a simple market‑impact function that adds a percentage or basis‑point offset to the execution price, calibrated against historical volume or observed slippage in similar markets.
How Does Fill Probability Influence Backtest Accuracy?
A common shortcut is to treat every intended trade as a guaranteed fill. Real markets present partial fills, rejected orders, or no fills at all due to insufficient liquidity at the target price.
- Partial fills reduce realized exposure and may alter subsequent signals.
- Order rejections can change the timing of later trades, affecting strategy dynamics.
- Modeling realistic fill probability requires historical order‑book snapshots or statistical estimates.
When Is It Reasonable to Assume Near‑Certain Fills?
Only for very small, high‑frequency strategies on highly liquid instruments where empirical evidence shows near‑certain fills; otherwise the assumption adds significant bias.
Can Latency and Order Routing Delays Skew Results?
Backtests often execute trades at the exact timestamp of the bar, ignoring the milliseconds or seconds needed for order transmission, routing and exchange processing. This latency can turn a profitable signal into a loss if the market moves unfavorably during the delay.
- Include a latency buffer based on typical network and exchange latency.
- Simulate order routing choices that may affect fill quality.
- Recognize that high‑frequency strategies are especially sensitive to timing assumptions.
Why Do Stale or Aggregated Prices Create False Liquidity Signals?
Using end‑of‑day or low‑resolution bars can hide intra‑day price spikes and gaps where liquidity evaporates. Traders may think a price level was reachable when the market never traded there during the interval.
- Prefer higher‑frequency data when modeling assets with volatile order flow.
- Check data source metadata for timestamp freshness and coverage.
- Treat missing or unverified price points as unknown rather than zero.
How Does Position Size Impact Liquidity Modeling?
Scaling a strategy without adjusting for market impact can produce unrealistic profit curves. Larger positions increase the likelihood of moving the market, especially in assets with limited depth.
- Apply a market‑impact function that grows with order size.
- Use historical volume to set realistic position limits.
- Monitor daily notional caps to avoid exceeding typical market capacity.
A backtest that ignores liquidity constraints is like a race car tested on a treadmill - it never experiences the friction that slows real performance.
For deeper guidance on related topics, see Liquidity Assumptions That Can Skew Backtest Results, How to Model Slippage Accurately in a Trading Backtest and the broader Felix documentation.
Frequently asked questions
Apply a fixed percentage or basis‑point offset to the execution price, calibrated against historical order‑book depth or observed slippage in similar markets.
No. Liquidity varies widely between stocks, crypto, futures and prediction markets, so assumptions must be tailored to each market’s typical depth and volatility.
Check that the data includes source identifiers, timestamps and any warnings about missing bars; treat any unverified price as uncertain rather than zero.
Only for very small, high‑frequency strategies on highly liquid instruments where empirical evidence shows near‑certain fills; otherwise the assumption adds significant bias.
Sources and verification
Product claims in this article were checked against these first-party references. Runtime status remains authoritative for current availability.
- Felix documentationfirst party
- Felix machine referencefirst party
Build with Felix now.
Felix infrastructure is live through MCP and the API. The Felix V1 retail quant-desk private beta is planned for September 22.
Overfitting can make a backtest look perfect while failing in live markets. This article explains how to recognize the warning signs, use out‑of‑sample testing, and apply statistical tools to keep your models honest.
Strategy turnover-the frequency of opening and closing positions-directly impacts the realism of a backtest. Learn why high turnover can amplify data gaps, slippage, and execution risk, and how to account for these factors.