Freqtrade guide: the free, open-source bot done right
Freqtrade is the most popular free, open-source crypto trading bot — Python-based, self-hosted, and supported by a large community. There's no subscription, no cloud holding your keys, and full control over the logic. The trade-off is that you run it yourself. This guide covers installing Freqtrade, writing a strategy class, backtesting it, dry-running it as a paper trade, and the disciplined path to going live.
Why traders pick Freqtrade
- Free & open-source — no subscription, MIT-licensed, auditable code.
- Self-hosted — your API keys stay on your server, not a third-party cloud.
- Full toolchain — backtesting, hyperopt parameter search, dry-run paper trading and a Telegram control bot, all built in.
Freqtrade's own backtester is excellent, but get the strategy idea right first on our backtester before investing time in a Python class.
Step 1 — install and configure
bash · install.shgit clone https://github.com/freqtrade/freqtrade
cd freqtrade
./setup.sh -i # installs into a venv
freqtrade new-config --config config.json
The config holds your exchange, pairs, stake amount and — critically — "dry_run": true to start in paper mode.
Step 2 — write a strategy class
A Freqtrade strategy is a Python class that populates indicator columns and sets entry/exit signals. Here's a minimal SMA-crossover, the same logic as our backtester's default:
python · sma_cross.pyfrom freqtrade.strategy import IStrategy
import talib.abstract as ta
class SmaCross(IStrategy):
timeframe = '1h'
minimal_roi = {'0': 0.10}
stoploss = -0.05
def populate_indicators(self, df, meta):
df['fast'] = ta.SMA(df, 20)
df['slow'] = ta.SMA(df, 50)
return df
def populate_entry_trend(self, df, meta):
df.loc[df['fast'] > df['slow'], 'enter_long'] = 1
return df
Step 3 — backtest and hyperopt
bash · test.shfreqtrade download-data --timeframe 1h --days 365
freqtrade backtesting --strategy SmaCross
# optional parameter search — beware overfitting
freqtrade hyperopt --strategy SmaCross --epochs 100
Hyperopt finds the parameters that fit the past best — which is overfitting by another name. Optimize on one period, validate on a held-out period, and prefer robust settings over the single best-looking result. See backtesting vs forward testing.
Step 4 — dry-run before live
With "dry_run": true, Freqtrade trades against live prices using fake money. Run it for weeks. Only when the dry-run matches your backtest expectations and survives volatile sessions should you flip to live with a tiny stake.
Safe-start checklist
- Strategy idea proven on the backtester first.
- Backtest on one period, validate on a held-out period.
- Weeks of dry-run matching expectations.
- Trade-only API keys; see key security.
- Tiny stake live, scale only after it behaves.
Frequently asked questions
Is Freqtrade really free?
Yes. Freqtrade is open-source under the MIT license with no subscription. You only pay for a server to run it on and normal exchange trading fees. Because it's self-hosted, your API keys stay on your own machine rather than a third-party cloud.
Is Freqtrade good for beginners?
Freqtrade is powerful but assumes comfort with Python, the command line and a server. Beginners can run it, but should expect a learning curve. If you want zero coding, a no-code platform is gentler; if you want control and no fees, Freqtrade rewards the effort.
Does Freqtrade have backtesting?
Yes, excellent built-in backtesting plus hyperopt for parameter search and dry-run paper trading against live prices. The caution is overfitting: hyperopt fits the past, so validate on a held-out period and prefer robust parameters over the single best-looking result.
How do I run Freqtrade safely?
Start with dry_run set to true so it trades fake money against live prices, run it for weeks, and only go live with a tiny stake once results match your backtest. Use trade-only API keys with no withdrawal rights, and keep a max-drawdown stop.