Page 1 of 1

Overlapping bars and the broker that rebuilds history

Posted: Fri Oct 30, 2026 9:04 am
by Fairman
Overlapping bars and the broker that rebuilds history

Historical data on some platforms is not fixed. Brokers revise it, patch gaps, and sometimes replace stretches with data from other sources.

A backtest run last month and again today may produce different results on the same dates. The data changed under it.

This is particularly annoying for tight strategies. A one-tick difference in a bar's high can change whether a target was hit.

Keeping a personal copy of the dataset used in each test avoids the problem. It also provides a stable base for comparing strategy versions.

For live recording, saving raw ticks to files with timestamps takes little storage. A year of one major pair's ticks is a few gigabytes. It becomes an asset after a couple of years.

Another symptom is an indicator that suddenly shows different values on old bars after a restart. The code did not change. The history underneath did. Spotting this early saves hours of chasing a bug that does not exist, and a hash or a copy of the file before each test run makes the culprit obvious.

Is a personal archive of tick data being kept, or is each test relying on whatever the broker supplies that day?

Re: Overlapping bars and the broker that rebuilds history

Posted: Wed Nov 04, 2026 12:51 pm
by Fairman
Some brokers rebuild historical bars after the fact, for example to correct bad ticks, adjust for server time changes or merge data from different feeds. When that happens, bars on the chart may change after the trader has already seen them. Indicators and EAs that depend on those bars may then show different values from what they showed in real time. This can cause confusion when reviewing trades, since the chart no longer matches what was seen at the time of entry. It can also affect backtests, since historical data downloaded later may differ from the data the strategy actually traded on live.

Re: Overlapping bars and the broker that rebuilds history

Posted: Wed Nov 04, 2026 4:25 pm
by Amanhasnoname
This caught me out when I re-ran a backtest on an EURUSD strategy after a platform update and the profit dropped by about twelve percent with identical settings. After a day of looking for a bug in my code, I compared the data files and found the broker had replaced about two weeks of M1 bars from the previous spring. The highs and lows were different by a pip or so in many places, and that was enough to flip several trades.

Now I export the history to a CSV before every serious test and keep the file together with the results, along with a hash of it. If a result changes later, I can tell in a minute whether the data or the logic is responsible. I also record live ticks to a file on a small VPS, and after eight months it's about three gigabytes, which I find a very reasonable cost.

The tick archive has been useful beyond testing. It lets me check what my spread really was at the time of a fill, instead of relying on what the broker shows afterwards.