Utility Commands
Besides the Live-Trade and Dry-Run run modes, the backtesting
and hyperopt
optimization subcommands, and the download-data
subcommand which prepares historical data, the bot contains a number of utility subcommands. They are described in this section.
Create User Directory
Creates the directory structure to hold your files for freqtrade. Will also create strategy and hyperopt examples for you to get started.
Can be used multiple times - using --reset
will reset the sample strategy and hyperopt files to their default state.
Command Usage
# Create user directory structure
freqtrade create-userdir
# Create in specific location
freqtrade create-userdir --userdir /path/to/user_data
# Reset sample files to default
freqtrade create-userdir --reset
Using --reset
may result in loss of data, since this will overwrite all sample files without asking again.
Directory Structure Created
user_data/
├── backtest_results/
├── data/
├── hyperopt_results/
├── hyperopts/
│ └── sample_hyperopt_loss.py
├── notebooks/
│ └── strategy_analysis_example.ipynb
├── plot/
└── strategies/
└── sample_strategy.py
Create New Configuration
Creates a new configuration file, asking some questions which are important selections for a configuration.
Command Usage
# Create new config interactively
freqtrade new-config --config user_data/config.json
# Create config in specific location
freqtrade new-config --config /path/to/config.json
Only vital questions are asked. Freqtrade offers a lot more configuration possibilities, which are listed in the Configuration documentation.
Example Interactive Session
$ freqtrade new-config --config user_data/config_binance.json
? Do you want to enable Dry-run (simulated trades)? Yes
? Please insert your stake currency: BTC
? Please insert your stake amount: 0.05
? Please insert max_open_trades (Integer or -1 for unlimited open trades): 3
? Please insert your desired timeframe (e.g. 5m): 5m
? Please insert your display Currency (for reporting): USD
? Select exchange binance
? Do you want to enable Telegram? No
Show Configuration
Show configuration file (with sensitive values redacted by default). Especially useful with split configuration files or environment variables, where this command will show the merged configuration.
Command Usage
# Show config with sensitive values hidden
freqtrade show-config
# Show config with sensitive values visible
freqtrade show-config --show-sensitive
# Show specific config file
freqtrade show-config --config my_config.json
Example Output
Your combined configuration is:
{
"exit_pricing": {
"price_side": "other",
"use_order_book": true,
"order_book_top": 1
},
"stake_currency": "USDT",
"exchange": {
"name": "binance",
"key": "REDACTED",
"secret": "REDACTED",
"ccxt_config": {},
"ccxt_async_config": {}
}
// ...
}
We try to remove all known sensitive information from the default output (without --show-sensitive
).
Yet, please do double-check for sensitive values in your output to make sure you're not accidentally exposing some private info.
Create New Strategy
Creates a new strategy from a template similar to SampleStrategy. The file will be named inline with your class name, and will not overwrite existing files.
Results will be located in user_data/strategies/<strategyclassname>.py
.
Command Usage
# Create basic strategy
freqtrade new-strategy --strategy AwesomeStrategy
# Create with custom user directory
freqtrade new-strategy --userdir ~/.freqtrade/ --strategy AwesomeStrategy
# Create using advanced template
freqtrade new-strategy --strategy AwesomeStrategy --template advanced
# Create minimal template
freqtrade new-strategy --strategy AwesomeStrategy --template minimal
Template Options
minimal
- Empty strategy without any indicator examplesdefault
- Basic strategy with common indicatorsadvanced
- Strategy with all optional functions and methods populated
List Strategies
Use the list-strategies
subcommand to see all strategies in one particular directory.
This subcommand is useful for finding problems in your environment with loading strategies: modules with strategies that contain errors and failed to load are printed in red (LOAD FAILED), while strategies with duplicate names are printed in yellow (DUPLICATE NAME).
Command Usage
# List strategies in default directory
freqtrade list-strategies
# List strategies in custom userdir
freqtrade list-strategies --userdir ~/.freqtrade/
# List strategies in specific path
freqtrade list-strategies --strategy-path ~/.freqtrade/strategies/
# List with one strategy per line
freqtrade list-strategies --one-column
Using these commands will try to load all python files from a directory. This can be a security risk if untrusted files reside in this directory, since all module-level code is executed.
Example Output
Strategy name Location
-------------------- ----------------------------------------
SampleStrategy user_data/strategies/sample_strategy.py
MyAwesomeStrategy user_data/strategies/my_awesome_strategy.py
BrokenStrategy user_data/strategies/broken_strategy.py (LOAD FAILED)
List Hyperopt Loss Functions
Use the list-hyperoptloss
subcommand to see all hyperopt loss functions available.
It provides a quick list of all available loss functions in your environment.
This subcommand can be useful for finding problems in your environment with loading loss functions: modules with Hyperopt-Loss functions that contain errors and failed to load are printed in red (LOAD FAILED), while hyperopt-Loss functions with duplicate names are printed in yellow (DUPLICATE NAME).
Command Usage
# List available loss functions
freqtrade list-hyperoptloss
# List with custom userdir
freqtrade list-hyperoptloss --userdir ~/.freqtrade/
# List with one function per line
freqtrade list-hyperoptloss --one-column
Example Output
HyperOpt Loss Name Location
------------------------------ ----------------------------------------
SharpeHyperOptLoss freqtrade/optimize/hyperopt_loss_sharpe.py
SharpeHyperOptLossDaily freqtrade/optimize/hyperopt_loss_sharpe_daily.py
SortinoHyperOptLoss freqtrade/optimize/hyperopt_loss_sortino.py
CalmarHyperOptLoss freqtrade/optimize/hyperopt_loss_calmar.py
List FreqAI Models
Use the list-freqaimodels
subcommand to see all FreqAI models available.
This subcommand is useful for finding problems in your environment with loading FreqAI models: modules with models that contain errors and failed to load are printed in red (LOAD FAILED), while models with duplicate names are printed in yellow (DUPLICATE NAME).
Command Usage
# List available FreqAI models
freqtrade list-freqaimodels
# List with custom userdir
freqtrade list-freqaimodels --userdir ~/.freqtrade/
List Exchanges
Use the list-exchanges
subcommand to see the exchanges available for the bot.
Command Usage
# List supported exchanges
freqtrade list-exchanges
# List all exchanges (including unsupported)
freqtrade list-exchanges --all
# List with one exchange per line
freqtrade list-exchanges --one-column
Example Output
Exchange name Supported Markets Reason
------------------ ----------- ---------------------- ----------------------------
binance Official spot, isolated futures
bitmart Official spot
bybit spot, isolated futures
gate Official spot, isolated futures
htx Official spot
kraken Official spot
okx Official spot, isolated futures
Output reduced for clarity - supported and available exchanges may change over time.
Values with "missing opt:" might need special configuration (e.g. using orderbook if fetchTickers
is missing) - but should in theory work (although we cannot guarantee they will).
List Markets/Pairs
Use the list-pairs
subcommand to see available trading pairs on an exchange.
Command Usage
# List all pairs for an exchange
freqtrade list-pairs --exchange binance
# List pairs for specific quote currency
freqtrade list-pairs --exchange binance --quote USDT
# List pairs with minimum volume
freqtrade list-pairs --exchange binance --quote USDT --print-json
# List active pairs only
freqtrade list-pairs --exchange binance --active-only
# List pairs with base currency filter
freqtrade list-pairs --exchange binance --base BTC ETH
Example Output
Exchange: binance
Pair Base Quote Active
------------------- ------ ------ --------
BTC/USDT BTC USDT True
ETH/USDT ETH USDT True
ADA/USDT ADA USDT True
List Timeframes
Use the list-timeframes
subcommand to see available timeframes on an exchange.
Command Usage
# List timeframes for an exchange
freqtrade list-timeframes --exchange binance
# List with one timeframe per line
freqtrade list-timeframes --exchange binance --one-column
Example Output
Exchange: binance
Timeframes available: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M
List Data
Use the list-data
subcommand to see available data in your data directory.
Command Usage
# List all available data
freqtrade list-data
# List data with timeranges
freqtrade list-data --show-timerange
# List data for specific exchange
freqtrade list-data --exchange binance
# List data in specific format
freqtrade list-data --data-format-ohlcv feather
Example Output
Found 15 pair / timeframe combinations.
Pair Timeframe Type From To
----------- ----------- ------ ------------------- -------------------
BTC/USDT 1m spot 2023-01-01 00:00:00 2023-12-31 23:59:00
BTC/USDT 5m spot 2023-01-01 00:00:00 2023-12-31 23:55:00
ETH/USDT 1m spot 2023-01-01 00:00:00 2023-12-31 23:59:00
Test Pairlist
Use the test-pairlist
subcommand to test your pairlist configuration.
Command Usage
# Test pairlist configuration
freqtrade test-pairlist
# Test with specific config
freqtrade test-pairlist --config my_config.json
# Test with custom pairlist
freqtrade test-pairlist --config my_config.json --quote USDT
Example Output
Pairlist configuration:
[
{
"method": "VolumePairList",
"number_assets": 20,
"sort_key": "quoteVolume"
}
]
Pairs: ['BTC/USDT', 'ETH/USDT', 'ADA/USDT', ...]
Show Trades
Use the show-trades
subcommand to display trades from your database.
Command Usage
# Show all trades
freqtrade show-trades
# Show trades for specific days
freqtrade show-trades --days 7
# Show trades with profit details
freqtrade show-trades --print-json
# Show trades for specific pair
freqtrade show-trades --pairs BTC/USDT
# Show trades with specific trade IDs
freqtrade show-trades --trade-ids 1,2,3
Example Output
Total trades: 15
First trade opened: 2023-01-01 10:00:00
Last trade opened: 2023-01-15 15:30:00
Total profit: 125.50 USDT (12.55%)
Average profit per trade: 8.37 USDT (0.84%)
Best trade: 45.20 USDT (4.52%)
Worst trade: -15.30 USDT (-1.53%)
Convert Data
Convert data between different formats.
Command Usage
# Convert from JSON to Feather
freqtrade convert-data --format-from json --format-to feather
# Convert specific timeframes
freqtrade convert-data --format-from json --format-to feather -t 1m 5m
# Convert and remove original files
freqtrade convert-data --format-from json --format-to feather --erase
# Convert in specific directory
freqtrade convert-data --format-from json --format-to feather --datadir /path/to/data
Plot Commands
Generate various plots for analysis.
Plot Dataframe
# Plot strategy signals
freqtrade plot-dataframe --strategy MyStrategy --pairs BTC/USDT
# Plot with specific timerange
freqtrade plot-dataframe --strategy MyStrategy --pairs BTC/USDT --timerange 20230101-20230201
# Plot with indicators
freqtrade plot-dataframe --strategy MyStrategy --pairs BTC/USDT --indicators1 sma,ema --indicators2 rsi,macd
Plot Profit
# Plot profit from backtest results
freqtrade plot-profit
# Plot profit with specific timerange
freqtrade plot-profit --timerange 20230101-20230201
# Plot profit for specific pairs
freqtrade plot-profit --pairs BTC/USDT ETH/USDT
Best Practices
Command Organization
- Use meaningful names - Choose descriptive strategy and config names
- Organize directories - Keep strategies and configs well organized
- Regular cleanup - Remove unused strategies and old data
- Version control - Track changes to strategies and configs
Troubleshooting
- Check loading errors - Use list commands to identify issues
- Validate configurations - Use show-config to verify settings
- Test components - Use test commands before live trading
- Monitor data - Regularly check data availability and quality
Security
- Protect sensitive data - Use --show-sensitive carefully
- Validate file sources - Be cautious with untrusted strategy files
- Regular backups - Backup important configurations and data
- Access control - Limit access to trading configurations
Next Steps
After using utility commands:
- Strategy Development - Create and test strategies
- Configuration - Set up bot configuration
- Backtesting - Test strategies with historical data
- Bot Usage - Run the trading bot
Resources
- Command Reference - Complete command documentation
- Configuration - Configuration file options
- Strategy Development - Strategy creation guide