Freqtrade is a powerful, open-source cryptocurrency trading bot designed for automation, backtesting, and strategy optimization. Whether you're new to algorithmic trading or refining your existing systems, understanding the foundational concepts of Freqtrade is essential for building reliable and profitable strategies.
This guide breaks down core terminology, fee handling, pair naming conventions, and the execution logic behind both live trading and backtesting. We’ll also explore how Freqtrade manages technical indicators, order types, profit calculations, and strategy callbacks to give you a complete picture of its inner workings.
Core Freqtrade Terminology
Before diving into operations, let’s clarify key terms used throughout Freqtrade:
- Strategy: A set of rules defined in code that tells the bot when to enter or exit trades based on market data and indicators.
- Trade: An active position opened on an exchange (i.e., buying a cryptocurrency with the intent to sell later at a profit).
- Open Order: An order placed on the exchange that has not yet been filled (e.g., a buy or sell limit order waiting for price confirmation).
- Trading Pair: A market where two assets are traded against each other, such as
ETH/USDT(spot) orBTC/USDT:USDT(futures). - Timeframe: The duration of each candlestick in your chart (e.g.,
"5m"for 5-minute candles,"1h"for hourly). - Technical Indicators: Mathematical calculations derived from price and volume data—like SMA, EMA, RSI—that help inform trading decisions.
- Limit Order: An order to buy or sell at a specific price or better. It may not execute immediately if the market doesn’t reach that price.
- Market Order: An order that executes instantly at the best available current price, ensuring execution but possibly at a less favorable rate.
- Unrealized Profit: The current profit of an open trade, calculated based on the latest market price versus entry cost.
- Realized Profit: The actual profit locked in after closing a trade. This becomes relevant when using partial exits via
adjust_trade_position(). - Total Profit: The sum of realized and unrealized profits across all trades. Percentage returns are calculated relative to total stake investment.
👉 Discover how automated trading can boost your crypto strategy today.
Fee Handling in Freqtrade
All profit calculations in Freqtrade include trading fees by default—ensuring realistic performance metrics. This applies consistently across different modes:
- In backtesting, hyperopt, and dry-run (paper trading) modes, Freqtrade uses the exchange’s default fee structure (typically the lowest standard rate unless overridden).
- During live trading, the bot retrieves and applies the actual fees charged by your exchange—including any discounts (e.g., BNB fee rebates on Binance).
This accurate fee modeling ensures that simulated results closely reflect real-world outcomes, reducing surprises when going live.
Trading Pair Naming Conventions
Freqtrade follows the CCXT library's naming standards, which are critical for correct market identification.
Using incorrect formatting may result in errors like "this pair is not available." Here's how to format pairs correctly:
Spot Pairs
Format: BASE/QUOTE
Example: XRP/USDT — meaning XRP is bought using USDT.
Futures Pairs
Format: BASE/QUOTE:SETTLE
Example: ETH/USDT:USDT — indicates an ETH perpetual futures contract settled in USDT.
Understanding this distinction prevents mismatches between your configuration and exchange markets—especially important when working with derivatives.
How the Freqtrade Bot Executes Trades
When you launch Freqtrade in live or dry-run mode using the command freqtrade trade, the bot starts an automated loop that runs continuously until stopped.
This process begins by triggering the optional bot_start() callback and then enters a recurring cycle (by default every few seconds, configurable via process_throttle_secs). Each iteration performs the following steps:
- Load Open Trades
Retrieves currently active trades from persistent storage (database or JSON file). - Determine Tradable Pairs
Compiles a list of trading pairs eligible for analysis based on configuration filters. - Download OHLCV Data
Fetches historical candlestick data (Open, High, Low, Close, Volume) for all relevant pairs—including informational pairs used only for signal generation.
This download occurs once per cycle to minimize API calls and network overhead.
Call Strategy Callbacks
Executes key strategy methods:populate_indicators()– Calculates technical indicators.populate_entry_trend()– Generates long/short entry signals.populate_exit_trend()– Determines exit conditions.
Check Order Timeouts
For pending orders:- Calls
check_entry_timeout()orcheck_exit_timeout()if order age exceeds limits. - Invokes
adjust_entry_price()to dynamically update limit prices.
- Calls
Manage Exit Conditions
Evaluates active positions for closure using:- Stop-loss and ROI (Return on Investment) settings.
- Exit signals from strategy.
- Custom logic via
custom_exit()andcustom_stoploss(). - Final exit price determined by
exit_pricingorcustom_exit_price(). - Confirmation via
confirm_trade_exit()before placing the order.
- Adjust Position Size (if enabled)
Usesadjust_trade_position()to add to or partially close positions—ideal for scaling strategies. Evaluate New Entry Opportunities
If undermax_open_trades, checks for new entries:- Entry price set via
entry_pricingorcustom_entry_price(). - Leverage determined via
leverage()in margin/futures mode. - Stake amount calculated via
custom_stake_amount(). - Final entry confirmed via
confirm_trade_entry().
- Entry price set via
This entire loop repeats indefinitely, enabling continuous monitoring and automated execution.
Backtesting & Hyperopt Execution Logic
While live trading focuses on real-time execution, backtesting and hyperparameter optimization (Hyperopt) simulate performance using historical data.
The process includes:
- Loading historical OHLCV data for configured pairs.
- One-time call to
bot_start(). - Running indicator calculations (
populate_indicators()per pair). - Generating entry and exit signals (
populate_entry_trend(),populate_exit_trend()). Simulating trades candle-by-candle:
- Calling
bot_loop_start()per iteration. - Checking order timeouts via config or callbacks.
- Adjusting entry prices with
adjust_entry_price(). - Evaluating entry signals (
enter_long,enter_short). - Confirming entries/exits via optional callbacks.
- Setting custom prices with
custom_entry_price()(applied at candle open). - Determining leverage and stake size where applicable.
- Applying position adjustments via
adjust_trade_position(). - Using
custom_stoploss()andcustom_exit()for advanced exits. - Calculating exit prices via
custom_exit_price()(applied at candle close).
- Calling
Finally, a detailed backtest report is generated—showing profit/loss, win rate, drawdowns, and more.
🔔 Important Note:
Backtests use default exchange fees unless overridden with the --fee parameter. Also, callback frequency differs:
- In backtest: Each callback runs once per candle (can be adjusted with
--timeframe-detail). - In live mode: Callbacks run every cycle (~5 seconds), which may cause behavioral differences.
👉 See how strategy testing can improve your trading accuracy before going live.
Frequently Asked Questions
Q: Does Freqtrade support futures trading?
A: Yes. Freqtrade fully supports futures markets with proper pair formatting (BASE/QUOTE:SETTLE) and leverage configuration via the leverage() callback.
Q: Can I customize entry and exit prices?
A: Absolutely. Use custom_entry_price() and custom_exit_price() in your strategy to define dynamic pricing logic beyond standard limit/market orders.
Q: How are profits calculated in Freqtrade?
A: All profits—unrealized, realized, and total—include trading fees. Total return percentages are based on your total stake investment.
Q: What happens if I exceed max_open_trades?
A: The bot will skip new entries until one or more open trades are closed, respecting your configured concurrency limit.
Q: Is it safe to run Freqtrade with real funds?
A: Always start with paper trading (dry-run mode). Test thoroughly in simulation before deploying live strategies.
Q: Can I modify fees during backtesting?
A: Yes. Use the --fee argument in backtest or hyperopt commands to simulate different fee structures.
Final Thoughts
Freqtrade offers a robust framework for developing, testing, and deploying automated crypto trading strategies. By mastering its core concepts—from pair naming to callback execution—you gain full control over your algorithmic trading workflow.
Whether you're analyzing technical indicators, optimizing entry logic, or simulating long-term performance, Freqtrade provides the tools needed to make informed decisions.
👉 Start refining your strategy with advanced trading tools now.
Keywords: Freqtrade basics, cryptocurrency trading bot, algorithmic trading, backtesting crypto strategies, technical indicators in trading, automated trading system, Freqtrade strategy development, live trading automation