Article 3: π οΈ Starting from Scratch! A Detailed Guide to the Freqtrade download-data Command and Docker Usage
In Freqtrade, K-line data is the foundation for backtesting, optimization, and trading.
Whether you're a strategy developer or a researcher, mastering the download-data command is the first step toward quantitative trading.
This article explains how to use the freqtrade download-data command to download historical market data, covering common parameters, Docker usage, download recommendations, and supported exchanges.
π Want to Learn Quantitative Trading?
π Visit: https://www.itrade.icu
Find Freqtrade tutorials, strategy guides, indicator analysis, and more to help you master quantitative trading with ease!
π₯ 1. Basic Command Format
- Download data for a specific trading pair:
freqtrade download-data \
--exchange binance \
--pairs BTC/USDT \
--timeframes 1h \
--timerange 20230101-20230701
- Download using a
config.jsonfile:
freqtrade download-data \
--config user_data/config.json \
--timeframes 15m \
--timerange 20200101-20250626
Common Parameters Explained:
| Parameter | Description |
|---|---|
--exchange |
Specify the exchange (e.g., binance, bybit, kucoin) |
--pairs |
Specify trading pairs, e.g., BTC/USDT, separated by commas |
--timeframes |
Timeframes to download, e.g., 1m, 15m, 1h, 1d
|
--timerange |
Data time range, format: YYYYMMDD-YYYYMMDD
|
--days |
Download data for the last N days (alternative to --timerange) |
--config |
(Optional) Use an existing config file to specify the exchange |
π 2. Downloading Multiple Pairs / Timeframes
- Multiple trading pairs (e.g., BTC, ETH, BNB):
--pairs BTC/USDT,ETH/USDT,BNB/USDT
- Multiple timeframes (e.g., 15m and 1h):
--timeframes 15m,1h
- Best Practice: Download each timeframe separately for easier management:
freqtrade download-data --timeframes 15m
freqtrade download-data --timeframes 1h
π³ 3. Using Docker to Download Data
If you're using Docker, the command is slightly different:
docker compose run --rm freqtrade download-data \
--config /quants/freqtrade/user_data/config.json \
--timeframes 15m \
--timerange 20220101-20230701
Ensure the user_data/ directory is properly mounted in your docker-compose.yml:
volumes:
- "./user_data:/quants/freqtrade/user_data"
π 4. Where is the Data Stored?
Downloaded K-line data is stored in:
user_data/data/<exchange>/<pair><timeframe>-<type>.feather
For example:
user_data/data/binance/BTC_USDT_USDT-5m-futures.feather
Freqtrade automatically detects and uses this data for backtesting and optimization.
π 5. Which Exchanges Does Freqtrade Support?
Run the following command to view currently supported exchanges:
freqtrade list-exchanges
Commonly supported exchanges (may vary by version):
- Binance (spot and futures)
- Bybit
- KuCoin
- Huobi
- Kraken
- OKX
- Coinbase Pro
- Gate, etc. > β οΈ Some exchanges require an API key to download historical data.
β 6. Tips and Recommendations
| Item | Recommendation |
|---|---|
| Time Range | Download at least 3β6 months of data |
| Timeframe | Use 1h or 15m for strategy development; 1m for high-frequency strategies |
| Longer Data = Better? | Very old data may mislead due to changing market conditions |
| Storage Space | 1m data is large; ensure sufficient disk space |
π 7. Summary
The freqtrade download-data command is the starting point for all strategy development.
This article covered:
- Parameter usage:
exchange,pairs,timeframes,timerange - Techniques for downloading multiple pairs and timeframes
- Downloading data in a Docker environment
- Data storage paths and supported exchanges

Top comments (0)