
A credible spread modeling backtest treats the bid-ask spread as dynamic and regime-dependent, folds in commissions and slippage on every round trip, and validates results with walk-forward CPCV rather than a single historical path. Skip any of these and a strategy's backtested edge is partly an artifact of unmodeled friction. When quote data are missing, academic estimators fill the gap, and larger orders need conservative impact scaling to avoid flattering position sizes that would move the market in practice.
TL;DR:
- Use daily CHL estimates from high, low, and close prices when quotes are unavailable; floor negative readings at zero, especially for illiquid instruments.
- Fill at the next bar’s open, charge spread and commission on entry and exit, and widen spread assumptions during news or liquidity stress.
- For larger orders, apply the square root law to order size versus average volume, allow partial fills, and test net Sharpe under doubled impact assumptions.
- Validate with walk forward windows, CPCV, embargoed labels, and Monte Carlo permutation tests; report cost adjusted Sharpe, turnover, and fifth percentile stress returns.
Table of Contents
- What spread modeling must represent for credible backtests
- Estimating spreads when quote-level data are missing
- Execution modeling: slippage, market impact, and regime dependence
- Integrating spread models into ML backtests and validation pipelines
- Practical data considerations and how a clean minute-bar dataset changes spread modeling
- Author perspective: best-practice checklist for spread-aware ML backtests
- How BacktestMarket data fits this workflow
- FAQ
- Sources
What spread modeling must represent for credible backtests
Fixed-percentage cost assumptions understate risk because they ignore the fact that spreads widen exactly when liquidity disappears, which is also when strategies tend to trade more. A flat 2 basis point assumption might hold on a calm Tuesday afternoon and fail completely during a data release, a liquidity gap, or a weekend open.
A spread model worth trusting needs to represent several things at once:
- Variable spreads that widen during low-liquidity hours, around news, and at session opens or closes
- Explicit commission fields separate from spread cost, since brokers charge both
- Round-trip accounting that charges the cost twice, once on entry and once on exit
- Next-bar fills rather than same-bar fills, so the simulated price reflects what was actually tradable
- Tick-size floors that keep spreads discrete rather than continuous for low-price instruments
The pragmatic default most practitioners converge on is next-bar execution with round-trip costs charged explicitly and a conditional multiplier applied during tagged stress or news windows. Tagging regimes can be as simple as flagging scheduled economic releases and realized-volatility spikes, then widening the modeled spread by a fixed multiple during those bars. Exchange minimum price variations also matter here: for low-priced securities, discrete tick sizes materially affect spreads and quotation sizes, so a continuous spread model will misstate costs for those instruments specifically.
Estimating spreads when quote-level data are missing
When quote-level data are unavailable, three low-frequency estimators cover most practical cases, each with different data requirements and failure modes.
- Roll's estimator uses only consecutive price changes and their serial covariance, requiring no high or low data, but it breaks down when returns are positively autocorrelated and often produces undefined or negative estimates on trending instruments.
- Corwin-Schultz uses two-day high-low ranges to separate volatility from spread, improving on Roll but still sensitive to overnight gaps and jumps.
- CHL (Abdi-Ranaldo style), which jointly uses high, low, and close prices, produces estimates with higher correlation to true TAQ effective spreads than either predecessor and performs especially well on less-liquid instruments, according to research published in The Review of Financial Studies.
The practical recipe: compute daily CHL estimates, aggregate to a two-day corrected monthly average to smooth noise, floor any negative values at zero rather than treating them as rebate signals, then scale by daily volume to map the monthly estimate down to per-trade basis points. A simplified outline looks like this: pull daily high, low, and close; compute the CHL spread per the published formula; average over a rolling window; convert the monthly bps figure to a per-trade cost by dividing by expected trades per month for that instrument.
One sourced finding worth anchoring your estimator choice on: the CHL estimator outperforms older alternatives specifically on less-liquid instruments, which matters most for the exact instruments where quote data tends to be thinnest.

Execution modeling: slippage, market impact, and regime dependence
Slippage and market impact are not the same cost. Slippage is closer to a floor, the minimum friction from crossing the spread on a small order, while market impact grows with order size relative to available liquidity and does not scale linearly. A practical model many practitioners reach for is the square-root law: impact scales with the square root of order size divided by average volume, times a volatility-dependent constant. Small orders might see impact near the quoted half-spread, while an order sized at several times average bar volume can see impact multiples larger, which is why flat half-spread assumptions underestimate cost for anything beyond small size.
Build the execution layer around a few rules:
- Fill orders at the next bar's open, never the signal bar's close
- Allow partial fills when order size exceeds a bar's typical volume
- Pair every entry with its exit explicitly so P&L reflects the full round trip, not a running mark-to-market that ignores unwound cost
During tagged news or stress windows, widen both the spread assumption and the impact constant conservatively rather than reusing calm-market parameters.
Pro Tip: Run your backtest twice with impact constants set at your base estimate and at double that estimate; if the strategy's net Sharpe collapses between the two, your edge is too thin to survive real execution.
Integrating spread models into ML backtests and validation pipelines
Turning spread modeling into something a validation pipeline can consume starts with feature engineering and ends with cost-aware reporting.
- Build spread features from a Kalman-filtered hedge ratio between related instruments, then compute z-score, OU half-life, and volatility-adjusted spread on the filtered residual, freezing the hedge ratio at each rebalance boundary to avoid overtrading from a constantly shifting beta.
- Label outcomes with triple-barrier or forward-window labels, and enforce an embargo period between training and test windows so information from adjacent bars never leaks across the split.
- Validate with anchored walk-forward optimization, retuning hyperparameters inside each window rather than once globally, then layer combinatorial purged cross-validation and Monte Carlo permutation tests on top. A production-grade validation pipeline combining walk-forward, CPCV, and permutation testing is what separates genuine skill from an overfit curve.
- Report metrics net of cost: net Sharpe after spread, commission, and slippage; an implementable utility score that bakes costs into the objective directly rather than bolting them on afterward; the 5th percentile return from Monte Carlo resampling; and turnover in basis points per rebalance.
On the utility side, academic work on the implementable efficient frontier shows that embedding transaction costs directly into the optimization objective, rather than applying them as a post-hoc haircut, changes optimal position sizing and produces better out-of-sample net utility. Avoid same-bar fills anywhere in this pipeline. A signal computed on a bar's close should never fill on that same bar's price, in training or in validation.
Practical data considerations and how a clean minute-bar dataset changes spread modeling
Every estimator above is only as good as the price series feeding it. Noisy timestamps, missing bars, and unadjusted futures rolls all inflate estimated spreads and distort turnover calculations.
Clean minute-bar data removes several of these failure points at once:
- Consistent tick intervals mean fewer gaps that force interpolation
- Correct timestamping avoids off-by-one errors that misalign spread features with fills
- Pre-applied back-adjustments on futures prevent artificial jumps at roll dates from masquerading as spread widening
- Per-bar granularity makes turnover and round-trip cost tracking computationally direct rather than approximated from daily bars
With minute-level granularity, per-bar spread tracking and turnover-based cost accounting become something you compute directly rather than infer statistically, which is exactly the input CHL-style estimators and walk-forward pipelines need to produce stable results.
Author perspective: best-practice checklist for spread-aware ML backtests
Before calling any strategy deployable, run it against a short checklist:
- A low-frequency spread estimator applied where quote data are thin, with negatives floored at zero
- An explicit, size-aware impact model, not a flat half-spread assumption
- Walk-forward validation with CPCV and embargoed labels, not a single train-test split
- Monte Carlo permutation testing with a reported Deflated Sharpe Ratio
- Survival of a stress-scenario replay at widened spread and impact parameters
For internal review, the minimum publishable set is net Sharpe after all costs, turnover in basis points, and the 5th percentile return under the stress scenario. A strategy that cannot produce all three numbers is not ready to brief to a desk.
— Start
How BacktestMarket data fits this workflow
We built our datasets for exactly this kind of work. Clean minute-bar history, ready to import into MT4 and MT5 without reformatting, cuts the data-prep time that usually eats into the hours a quant actually has for spread estimation and validation design.
- Our Forex Major Full Pack gives you ready-to-import minute bars across major pairs for spread-aware simulations without separate data cleaning.
- Our broader Historical Data catalog covers metals, bonds, and indices for testing estimator behavior across asset classes.
- Support is available to help validate an estimator against a sample download before committing to a full dataset.
For teams running recurring strategy development, our Annual Plan at 119 EUR per year covers ongoing dataset access, and our Expert Advisors and Indicators give you automated tools to pair with the data once your validation pipeline clears. For execution mechanics once you move toward live trading, practical trade execution guidance complements the impact modeling covered above. Start with a sample download and check it against your own CHL estimates before you commit to a full pack.
FAQ
What is a spread modeling backtest?
A spread modeling backtest is a simulation that charges variable bid-ask spread, commissions, and slippage on every trade rather than assuming a flat or zero cost. It typically widens the modeled spread during low-liquidity or news windows and charges cost on both the entry and exit of every round trip.
How do I backtest spreads when I don't have quote data?
Use a low-frequency estimator such as Corwin-Schultz or the CHL/Abdi-Ranaldo estimator, which derive spread estimates from daily high, low, and close prices. CHL tends to outperform older estimators specifically on less-liquid instruments, which is where quote data is hardest to source.
What is walk-forward CPCV and why does it matter for ML backtests?
Walk-forward validation retrains and retests a model across rolling, anchored windows instead of one static split, and combinatorial purged cross-validation (CPCV) adds embargoed, purged folds to prevent information leakage between training and test sets. A production validation pipeline pairs both with Monte Carlo permutation testing to separate genuine skill from overfitting.
How much does accurate historical spread data cost?
Pricing depends on the dataset and provider; our own Historical Data and Forex Major Full Pack are priced on request, while continuous access through our Annual Plan is listed at 119 EUR per year. Costs vary elsewhere by asset coverage, tick granularity, and history length.
How should I model market impact for larger order sizes?
A practical starting point is the square-root law, where impact scales with the square root of order size relative to average volume rather than linearly. Practitioners who model slippage only as a flat half-spread tend to underestimate costs significantly once order size grows beyond a small fraction of typical bar volume.
Sources
Recommended
- MT4 Portfolio Backtesting: Export Replay to Find Real Drawdowns
- Stop Fake Alpha: 5 Checks Quants Need for Hedging Backtesting Data
Related resources
Explore BacktestMarket's historical data packs to put the ideas in this article into practice.

