Advertisement IC Markets

Rebuilding spreads from bid-only history

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Rebuilding spreads from bid-only history

Post by Fairman »

Rebuilding spreads from bid-only history

Many free data sets include only bid prices, with no ask. A backtest on bid-only data needs a spread assumption. A constant value is the lazy option, and it's wrong in predictable ways.

A better approach builds a spread model from whatever real quotes are available. Record bid and ask from the live platform for a few weeks, then compute the average spread by hour and weekday. Apply that profile to the historical bid series.

The model captures the main pattern: tight in London and New York, wider in Asia, spiking at rollover. It misses news spikes, which need a separate treatment, such as adding a spread multiplier around known release times.

The check is to compare the model's total spread cost on a sample of recent trades with the actual cost. If the model understates by 20 percent, adjust it.

It's imperfect, but far better than assuming 0.5 pips at all times. The difference between a flat and a time-varying spread is often the difference between a profitable and a losing backtest for strategies with small targets.

Where only bid data exists, which spread model fills the gap?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Post Reply