MarketData Hub

Backtesting a Trading Strategy with Historical Data

A backtest is only as trustworthy as the data behind it. This guide covers how to source clean historical data, pick a timeframe, dodge the classic biases that flatter results, and which tools to plug the data into.

Get the app — €9 →Buy a licence →

1 — Get clean, granular data

Start from accurate OHLC or tick data covering enough history to span multiple market regimes (trends, ranges, crises). Download the exact instrument and date range you need as CSV or JSON — for example EUR/USD, BTC/USD or the US 500.

Then look at the file before you trust it. Open it in the app's chart viewer: a gap, a flat stretch or a spike that isn't real is obvious on a chart and invisible in a results table, and the viewer's quality check lists gaps and damaged timestamps for you.

A downloaded file open in the MarketData Hub chart viewer: daily candlesticks with an EMA, Bollinger Bands, volume and an RSI pane. The prices are illustrative, not market data.
Look before you test. The downloaded file, opened in the app as a chart with indicators. Illustrative prices.

2 — Match the timeframe to the strategy

Test on the timeframe you'd actually trade. Intraday strategies need 1-minute or tick data; swing systems can use hourly or daily candles. Going finer than necessary just slows the backtest — see tick vs OHLC.

3 — Avoid the classic biases

4 — Pick a backtesting tool

5 — Validate and iterate

Check performance across in-sample and out-of-sample periods, multiple instruments and different market conditions before trusting a result. When you're ready, get the app and pull the history you need.

Frequently asked questions

What data do I need to backtest a trading strategy?
Accurate historical OHLC or tick data for the instrument and timeframe you trade, covering enough years to include several market regimes. CSV or JSON exports load into every common backtesting tool.
Is free historical data good enough for backtesting?
Yes, provided it is accurate and granular. The Dukascopy Bank SA archive the MarketData Hub client fetches from runs from tick level to monthly candles, which is sufficient for most retail and quantitative backtesting.
Which timeframe should I backtest on?
The one you would actually trade. Intraday and scalping strategies need 1-minute or tick data; swing and position strategies can use hourly or daily candles.

Related markets

Related guides