Free historical data for backtesting: where to get it, and the catch
"Where do you get your data?" is the second most common question in every systematic-trading forum, right after "which platform". The answers are usually a list of links. The links are the easy part.
Free historical price data is more available than it has ever been, especially for crypto, where the exchanges themselves publish years of candles. The hard part is not finding a file. It is knowing what is wrong with the file — because something always is, and each problem pushes a backtest in the flattering direction.
This guide covers the sources worth knowing, then the five things to check in any dataset before you build a result on it. The checks take longer than the download. They are also the reason the result will mean something.
Where to get it
Crypto
- Exchange REST APIs. Binance, Coinbase, Kraken, OKX, Bybit and most others serve OHLCV candles at intervals from one minute up, free, back to the pair's listing. Rate limits apply; a script that pages through them is a common first project.
- Bulk archives. Binance publishes monthly candle files for every spot pair at every interval as plain downloads (data.binance.vision). This is the fastest way to get years of one-minute data with no API work.
- Aggregator CSVs. Sites such as CryptoDataDownload host daily, hourly and minute OHLCV for major pairs across many exchanges as downloadable files.
Stocks and ETFs
- Free API tiers. Providers such as Tiingo, Polygon and Alpha Vantage offer free tiers with daily bars for US equities, with limits on calls, history depth or intraday resolution. Read the current terms; they change.
- Broker data. Most brokers expose historical bars through their platform or API to account holders, usually with the broker's own adjustment conventions.
- Yahoo-style downloads. Daily adjusted bars for most listed stocks are available from several free web sources. They are convenient and they carry every one of the problems below.
The five catches
1. Adjustments
Stock prices get adjusted after the fact for splits and dividends, so that a 2-for-1 split does not look like a 50% crash. That is correct for computing returns and wrong for anything that touches a price level: a rule like "buy under $50", a round-number breakout, a fixed-dollar stop. Adjusted data shows prices that never traded. Some sources adjust for splits only, some for dividends too, some not at all, and few say which.
Check: find a known split in your instrument's history and look at the bars around it. If there is no jump, the data is adjusted. If your rules use price levels, get unadjusted data or adjust your thresholds.
2. Survivorship
Any list of instruments you download today is a list of the ones that are still around. Dead coins, delisted stocks, and failed funds are gone, often along with their history. A universe built from a current list has had every failure removed before the backtest starts. The survivorship guide covers how much this flatters different strategy types and how to test for it.
Check: when was the list of instruments defined? If the answer is "now", the bias is present.
3. Gaps
Exchanges have outages. APIs drop candles. Aggregators stitch feeds together and lose hours at the seams. A missing hour in a 1-hour series either becomes a bar that is silently skipped — so every lookback window is now slightly wrong — or is filled by interpolation, which invents a price. Neither is announced.
Check: count the bars. A year of hourly crypto candles should have 8,760; a year of daily US equity bars about 252. Then look at the largest time difference between consecutive bars. If it is not one interval, you have gaps, and you need to decide how your rules treat them.
4. Sessions and timezones
A "daily" bar is a convention. Crypto daily bars usually close at midnight UTC. US equity daily bars close at 4 p.m. New York. A provider that builds daily bars from a different boundary — or that timestamps in local time without saying so — produces bars that no trader watching the market would have seen close at that moment. Intraday bars are worse: an hourly bar anchored at the top of the hour is a different bar from one anchored at the 9:30 open, and rules that fire "on the close" fire at different prices depending on which you have.
Check: take one bar and confirm, against a chart you trust, when it opened and closed in the market's own clock. Do it for an intraday bar and a daily bar, and do it across a daylight-saving change.
5. Interval construction
A 4-hour bar can be built from four 1-hour bars in six different ways, depending on where you start counting. A daily bar built from minutes depends on which minutes count as the session. Two sources that both say "4h" can disagree on every open, high, low and close, and a strategy tuned on one will not match the other.
Check: if you can, get the finest interval available and build coarser bars yourself, from a boundary you chose and wrote down. If you cannot, at least confirm the boundary the source uses and never mix sources.
| Problem | What it does to a backtest | Quick check |
|---|---|---|
| Adjustments | Rules on price levels fire on prices that never existed | Look at bars around a known split |
| Survivorship | Every failure removed; dip-buyers look brilliant | When was the instrument list made? |
| Gaps | Lookback windows silently wrong; interpolated prices invented | Count bars; find the largest gap |
| Sessions / timezones | Signals at closes no trader saw | Verify one bar's open and close on the market clock |
| Interval construction | Two sources' "4h" bars disagree on every value | Build coarse bars yourself from a stated boundary |
How much history
Enough to include a stretch you would not have enjoyed. For daily bars, ten years is a sensible floor — it will usually contain a crash, a grinding bear, and a euphoric run. For hourly bars, several years. The real requirement is trades per market condition rather than calendar time; the sample-size guide explains why a strategy that has only seen one regime has been tested once.
A data checklist before any backtest
- Know whether prices are adjusted, and for what.
- Know when the instrument list was defined.
- Count the bars and find the largest gap.
- Verify one bar's open and close on the market's own clock.
- Know the interval boundary, and never mix sources.
- Write all five answers down next to the result.
Data problems are the fifth cause in the fails-live diagnostic and the second step in the full backtesting loop. They do not break a strategy on day one the way leakage does. They make a mediocre one look fine, which is slower and costs more.
How Wise Apple handles data
Wise Apple loads ten-plus years of candle history for stocks, ETFs and crypto — eleven crypto exchanges plus a US equities feed — so the download step does not exist, and the five checks above are done once, centrally, rather than by every user separately. Every interval is built locally from a single canonical 1-hour series with a stated boundary, so a 4-hour bar is the same 4-hour bar every time; US equity hours are session-anchored at the 9:30 open; gaps are preserved rather than interpolated. Backtests run one instrument at a time against the full history of that instrument, which sidesteps universe survivorship. And if you have data of your own, it accepts CSV import or a provider key, and the same checks apply — the tool will not do them for you.
Questions people ask about historical data for backtesting
Where can I get free historical data for backtesting?
For crypto: exchange REST APIs (Binance, Coinbase, Kraken, OKX and others serve candles back to listing), Binance's bulk monthly candle archive at data.binance.vision, and aggregator CSV sites such as CryptoDataDownload. For US stocks: free API tiers from providers such as Tiingo, Polygon and Alpha Vantage, broker data feeds, and web downloads of daily adjusted bars. Check the current terms of each; limits change.
How much historical data do I need for a backtest?
Enough to include at least one market condition you would not have enjoyed — a crash, a long bear, a euphoric run. On daily bars that usually means ten years or more; on hourly bars, several years. What matters is trades per regime, not calendar time.
Should I use adjusted or unadjusted prices for backtesting?
Adjusted for anything that computes returns; unadjusted for anything that uses price levels, such as dollar thresholds, round-number breakouts or fixed-dollar stops. Adjusted data shows prices that never traded. Know which you have — check the bars around a known split — and match it to your rules.
Why do backtests differ between data sources?
Because sources differ on adjustments, on where a bar's boundary falls, on how gaps are handled, and on which timezone the timestamps use. Two sources can both label a bar "4h" and disagree on its open, high, low and close. Never mix sources, and if possible build coarse bars yourself from the finest interval available.
How much should I spend on backtesting data?
For daily and hourly bars on liquid stocks, ETFs, and major crypto pairs, usually nothing at first: exchange archives and free tiers cover ten-plus years, and the five catches on this page matter more than the vendor. Paying starts to make sense when you need delisted securities for an honest universe, intraday history, or point-in-time fundamentals — gaps the free feed cannot show you. Spend on the gap your strategy actually has, not on the feed with the most instruments.