πChapter 3: "How to Download Historical K-Line Data in Crypto? Freqtrade download-data Tutorial"
This article was produced by the Quantitative Trading Lab at https://www.itrade.icu. Visit for more benefits.
In Freqtrade, K-line data is the foundation for backtesting, optimization, and live trading. Whether you are a strategy developer or researcher, mastering the download-data command is the first step in quantitative trading.
This article explains how to use freqtrade download-data to download historical market data, including common parameters, Docker usage, download recommendations, and supported exchanges.
π₯ 1. Basic Command Format
Download by specifying trading pairs:
freqtrade download-data \
--exchange binance \
--pairs BTC/USDT \
--timeframes 1h \
--timerange 20230101-20230701Download according to
config.json:
freqtrade download-data \
--config user_data/config.json \
--timeframes 15m \
--timerange 20200101-20250626Common Parameter Explanation
--exchange
Choose exchange (e.g., binance, bybit, kucoin)
--pairs
Specify trading pairs, e.g., BTC/USDT, multiple separated by commas
--timeframes
Timeframe to download, e.g., 1m, 15m, 1h, 1d
--timerange
Data period, format YYYYMMDD-YYYYMMDD
--days
Download the last N days of data (mutually exclusive with timerange)
--config
(Optional) Use an existing config file to specify exchange
π 2. Suggestions for Downloading Multiple Coins / Timeframes
Multiple pairs (e.g., BTC, ETH, BNB):
Multiple timeframes (e.g., download 15m and 1h simultaneously):
Best practice: download each timeframe separately for easier management:
π³ 3. Downloading Data in Docker
For Docker deployments, the command differs slightly:
Ensure you mount the user_data/ directory correctly in docker-compose.yml:
π 4. Where Is the Data Stored?
Downloaded K-line data is saved at:
Example:
Freqtrade automatically recognizes and uses these files for backtesting and optimization.
π 5. Supported Exchanges in Freqtrade
You can run the following command to see supported exchanges:
Common supported exchanges (may vary by version):
Binance (Spot / Futures)
Bybit
KuCoin
Huobi
Kraken
OKX
Coinbase Pro
Gate, etc.
β οΈ Some exchanges require an API key to download historical data.
β
6. Notes and Recommendations
Download period
Usually cover at least 3β6 months of data
Time granularity
For strategy development, 1h or 15m is common; for high-frequency strategies, use 1m
Longer historical data
Too long data may mislead due to structural market changes
Local storage
1m data consumes significant disk space
π Summary
freqtrade download-data is the starting point for all strategy development. This article covered:
Parameter usage: exchange / pairs / timeframes / timerange
Techniques for downloading multiple coins and multiple timeframes
Docker environment download method
Data storage path and supported exchanges
Last updated