Preparing Historical Market Data for Strategy Backtests
Summary
This guide explains how to download and maintain historical market data for strategy backtesting and hyperparameter optimization. It covers choosing pairs, timeframes, exchanges, and date ranges; refreshing existing datasets incrementally; and adding earlier history with a prepend option. The command can retrieve OHLCV candles or, where useful, trade-level data that can be resampled into candles. Futures downloads may include mark, index, premium, or funding rate data, depending on the selected settings.
The guide also describes storage format choices and how to inspect available datasets. It cautions that trade downloads can be slow and are generally unnecessary when an exchange provides adequate historical candles; Kraken is given as a case where trade data may be needed. Downloads are strategy-independent, so researchers must obtain enough history for their strategy’s startup period. The document explains workflow and tooling rather than evaluating data quality, exchange coverage, or backtest reliability, so users still need to check whether their chosen data supports their research question.
Key ideas
- Download candle data for selected pairs, timeframes, and date ranges before running backtests.
- Incremental updates fill missing history for existing pairs, while a separate setting can set the history window for newly added pairs.
- Trade-level downloads can be resampled into candles but may be slower than retrieving exchange-provided OHLCV data.
- Futures research may require funding rate and other specialized candle types alongside regular prices.
- Choose the downloaded date range to include the strategy's required startup history.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.