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.

On this page
  1. Why Freqtrade
  2. Install & config
  3. Write a strategy
  4. Backtest & hyperopt
  5. Dry-run first
  6. Safe start

Why traders pick Freqtrade

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
strategy backtest hyperopt dry-run live
The disciplined Freqtrade pipeline: never skip dry-run on the way from backtest to live.

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 is where edges go to die

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

  1. Strategy idea proven on the backtester first.
  2. Backtest on one period, validate on a held-out period.
  3. Weeks of dry-run matching expectations.
  4. Trade-only API keys; see key security.
  5. Tiny stake live, scale only after it behaves.
Not financial advice. This content is educational. Automated and algorithmic trading carries a real risk of financial loss. Never trade money you cannot afford to lose. Review the SEC investor.gov and CFTC resources before trading.

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.

MB

Mustafa Bilgic

Algorithmic trading practitioner · Founder, AITradingBot.us

Mustafa builds and backtests automated trading systems and writes about them without the hype. Every tool on this site is free and runs entirely in your browser.