MarketData Hub All markets · Guides

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.

Open the data downloader →

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.

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, grab the data and start testing.

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. MarketData Hub data is sourced from Dukascopy Bank SA and available 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.

More guides