DEV Community

itrade icu
itrade icu

Posted on

Freqtrade Comprehensive Command Manual! Master Quantitative Trading from Beginner to Live Trading in One Article

🚀 Freqtrade Comprehensive Command Manual! Master Quantitative Trading from Beginner to Live Trading in One Article

Master the key commands for a quantitative trading bot from beginner to live trading in one article!

Freqtrade is a powerful and open-source cryptocurrency automated trading framework that supports strategy development, historical backtesting, parameter optimization, data analysis, and live trading.

However, for beginners, the functionality and usage of various commands may not be intuitive. This article categorizes, explains, and provides practical examples of all core Freqtrade commands.

🚀 Want to Learn Quantitative Trading?

👉 Visit: https://www.itrade.icu

Here you'll find Freqtrade beginner tutorials, strategy walkthroughs, indicator explanations, and more to help you easily master quantitative trading skills!

🎯 Command Structure Overview

Freqtrade’s command-line tool uses freqtrade as the main command, with different subcommands to perform various tasks:

freqtrade <subcommand> [options]
Enter fullscreen mode Exit fullscreen mode

You can use freqtrade -h to view the main command help or freqtrade <subcommand> -h to see detailed parameters for a specific subcommand.

📦 Command Categories Quick Reference Table

Category Command Examples Purpose Overview
Data Processing download-data, convert-data Download/process historical market data
Strategy Development & Testing new-strategy, backtesting, hyperopt Create and test trading strategies
Live Trading trade, webserver Start the bot for trading or dry-run
System Configuration new-config, create-userdir Initialize configuration and project structure
Query & Diagnostics show-trades, list-data, list-pairs Query strategies, data, and trade records
Visualization plot-dataframe Visualize strategy behavior with charts

🚀 1. Live and Simulated Trading Commands

trade - Start the Trading Bot (Live or Dry-run)

freqtrade trade \
  --config user_data/config.json \
  --strategy MyStrategy \
  --dry-run
Enter fullscreen mode Exit fullscreen mode
  • --dry-run: Simulate trading without placing real orders (recommended by default)
  • --db-url: Specify the database (for storing trade history)
  • --logfile: Specify the log output location > ⚠️ Ensure the strategy has been backtested and config.json is correctly configured before starting!

📥 2. Data Download and Processing Commands

download-data - Download Historical Market Data

freqtrade download-data \
  --exchange binance \
  --pairs BTC/USDT \
  --timeframes 1h \
  --timerange 20230101-20230301
Enter fullscreen mode Exit fullscreen mode
  • --exchange: Supports exchanges like Binance, Bybit, etc.
  • --pairs: Specify multiple trading pairs at once
  • --timeframes: Download data for timeframes like 1m, 5m, 15m, 1h, 1d, etc.

convert-data - Convert Data Format (CSV → JSON)

Convert external data sources (e.g., CCXT, Kaggle) into Freqtrade’s format.

🧪 3. Strategy Development and Backtesting Commands

new-strategy - Create a Strategy Template

freqtrade new-strategy --strategy MyNewStrategy
Enter fullscreen mode Exit fullscreen mode

Creates a .py file with structured comments in the user_data/strategies/ directory.

backtesting - Backtest Strategy Performance

freqtrade backtesting \
  --config user_data/config.json \
  --strategy MyStrategy \
  --timeframe 15m \
  --timerange 20220101-20230101
Enter fullscreen mode Exit fullscreen mode
  • Simulates historical trades to evaluate strategy profitability
  • Allows setting timeframes, trading pairs, etc.
  • Use with backtesting-show to view chart results

hyperopt - Parameter Optimization

freqtrade hyperopt \
  --config user_data/config.json \
  --strategy MyStrategy \
  --hyperopt-loss SharpeHyperOptLoss
Enter fullscreen mode Exit fullscreen mode
  • Automatically searches for optimal parameter combinations (e.g., RSI thresholds, take-profit ratios)
  • Supports multiple evaluation metrics (Sharpe, Sortino, pure profit, etc.)

📊 4. Data Visualization Commands

plot-dataframe - Visualize Strategy Behavior

freqtrade plot-dataframe \
  --config user_data/config.json \
  --strategy MyStrategy \
  --timerange 20230101-20230201
Enter fullscreen mode Exit fullscreen mode
  • Generates HTML charts showing buy/sell points, candlesticks, indicators, etc.
  • Charts are saved in the user_data/plot/ directory

⚙️ 5. Configuration and Project Initialization Commands

new-config - Create Configuration File

freqtrade new-config --config user_data/config.json
Enter fullscreen mode Exit fullscreen mode

Includes trading pairs, strategy name, risk management, and capital management settings.

create-userdir - Initialize Project Structure

freqtrade create-userdir --userdir user_data
Enter fullscreen mode Exit fullscreen mode

Creates a standard directory structure (logs, data, strategies, configs).

🔍 6. Query and Utility Commands

Command Functionality
show-trades Display trade records/backtest results
list-data View available local historical data
list-pairs Show supported trading pairs in the current config
list-exchanges List exchanges supported by Freqtrade
list-strategies List strategies in the strategies directory
list-timeframes Show supported timeframe formats

✅ Recommended Commands to Master for Daily Use:

freqtrade download-data
freqtrade backtesting
freqtrade hyperopt
freqtrade trade
freqtrade show-trades
Enter fullscreen mode Exit fullscreen mode

🐳 Using Docker

Most commands work in Docker as well:

docker compose run --rm freqtrade trade \
  --config /freqtrade/user_data/config.json \
  --strategy MyStrategy
Enter fullscreen mode Exit fullscreen mode

Ensure the docker-compose.yml file has correctly mounted paths.

📌 Summary

Freqtrade’s command-line tools cover the entire quantitative trading workflow: from data to backtesting, optimization, and live trading, making it ideal for developers and strategy researchers.

Recommended steps to get started:

  1. Download data (download-data)
  2. Write a strategy (new-strategy)
  3. Backtest and optimize (backtesting + hyperopt)
  4. Run live trading (trade + Web UI)
  5. Visualize analysis (plot-dataframe)

Master these commands, and you’ll be able to independently manage a cryptocurrency automated trading system!

Top comments (0)