← Back to blog
GuideApril 1, 2026• 11 min read

How to Automate Crypto Trading with Freqtrade in 2026

Freqtrade has become the go-to open-source framework for algorithmic crypto trading, and for good reason. It gives you complete control over strategy logic, backtesting, optimization, and live execution — all without monthly subscription fees. Whether you're a developer looking to turn your trading ideas into code or a trader tired of watching charts 24/7, this guide walks you through everything you need to automate crypto trading with Freqtrade in 2026.

By the end of this tutorial, you'll have a working Freqtrade installation connected to Bybit, a configured strategy ready for backtesting, and the knowledge to deploy it for live trading. We cover the entire pipeline: installation, exchange setup, strategy configuration, backtesting, optimization, and going live.

What Is Freqtrade and Why Use It?

Freqtrade is a free, open-source cryptocurrency trading bot written in Python. It supports spot and futures trading on major exchanges including Bybit, Binance, OKX, and Kraken. Unlike commercial bots such as 3Commas or Pionex that limit you to predefined templates, Freqtrade lets you write custom strategies using any combination of technical indicators, on-chain data, and statistical models.

The key advantages of Freqtrade over commercial alternatives are clear. You pay zero subscription fees — the software is completely free. You have full control over your strategy logic with no limitations on complexity or indicator combinations. Backtesting is built in with detailed performance metrics including SQN score, profit factor, and maximum drawdown. Hyperparameter optimization lets you fine-tune strategy parameters automatically. And because it runs on your own server, you maintain full custody of your API keys and trading data.

The trade-off is a steeper learning curve. You need basic Python knowledge and an understanding of trading concepts. But for anyone serious about algorithmic trading, that investment pays for itself many times over in flexibility and performance.

Prerequisites: What You Need Before Starting

Before diving into the setup, make sure you have the following ready. First, you need a computer or VPS running Linux (Ubuntu 22.04 or 24.04 recommended), macOS, or Windows with WSL2. A VPS with at least 2 GB of RAM is ideal for running the bot 24/7 without depending on your home internet connection. Popular choices include DigitalOcean, Hetzner, and Oracle Cloud (which offers a free tier).

Second, you need Python 3.10 or higher installed. Freqtrade supports Python 3.10 through 3.12 as of early 2026. Third, you need an exchange account with API access. We recommend Bybit for its low fees (0.02% maker / 0.055% taker on futures), deep liquidity across major pairs, and excellent API reliability. Finally, you need basic familiarity with the command line and at least elementary Python knowledge — you don't need to be an expert, but you should understand variables, functions, and if/else statements.

Step 1: Install Freqtrade

The fastest way to install Freqtrade is using the official setup script. Open your terminal and run the following commands to clone the repository and run the installer:

# Clone the repository

git clone https://github.com/freqtrade/freqtrade.git

cd freqtrade

# Run the setup script

./setup.sh -i

The setup script creates a virtual environment, installs all dependencies, and configures the initial directory structure. On Ubuntu, it also installs system-level dependencies like TA-Lib automatically. For Docker users, Freqtrade provides official images that simplify deployment even further — just pull freqtradeorg/freqtrade:stable and mount your configuration directory.

After installation, activate the virtual environment and verify everything works:

source .venv/bin/activate

freqtrade --version

Step 2: Create Your Bybit API Keys

Log into your Bybit account and navigate to API Management. Click “Create New Key” and select “System-generated API Keys.” Give it a descriptive name like “Freqtrade Bot” and configure the permissions carefully.

Critical security rules for API keys: Enable “Read” and “Trade” permissions only. Never enable “Withdraw” permissions for a trading bot — this protects you even if your server is compromised. Enable IP restriction and whitelist only your VPS IP address. If you're testing locally first, you can add your home IP temporarily and remove it later. Store your API key and secret securely — you'll need them in the next step.

Step 3: Configure Freqtrade

Freqtrade uses a JSON configuration file that defines your exchange connection, trading pairs, stake amount, and risk parameters. Generate a starter config with the built-in wizard:

freqtrade new-config --config user_data/config.json

The wizard walks you through exchange selection, trading mode (spot or futures), stake currency, and basic parameters. Here's what a typical Bybit futures configuration looks like after customization:

{

  "trading_mode": "futures",

  "margin_mode": "isolated",

  "exchange": {

    "name": "bybit",

    "key": "YOUR_API_KEY",

    "secret": "YOUR_API_SECRET"

  },

  "stake_currency": "USDT",

  "stake_amount": "unlimited",

  "max_open_trades": 5,

  "dry_run": true

}

Important: Always start with "dry_run": true. This runs the bot in paper trading mode where it simulates trades without placing real orders. Only switch to false after you've verified your strategy performs as expected in dry-run for at least 2–4 weeks.

Step 4: Choose or Build a Strategy

Freqtrade strategies are Python classes that define entry and exit logic using technical indicators. The framework provides several sample strategies, but you'll want to customize or build your own. A basic strategy structure looks like this:

# user_data/strategies/MyStrategy.py

from freqtrade.strategy import IStrategy

import talib.abstract as ta

 

class MyStrategy(IStrategy):

  timeframe = '1h'

  stoploss = -0.06

  trailing_stop = True

  trailing_stop_positive = 0.02

 

  def populate_indicators(self, dataframe, metadata):

    dataframe['ema_fast'] = ta.EMA(dataframe, timeperiod=12)

    dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=26)

    dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)

    return dataframe

 

  def populate_entry_trend(self, dataframe, metadata):

    dataframe.loc[

      (dataframe['ema_fast'] > dataframe['ema_slow']) &

      (dataframe['rsi'] < 70),

      'enter_long'] = 1

    return dataframe

This example uses an EMA crossover with an RSI filter — entering long when the fast EMA crosses above the slow EMA and RSI is below 70 (not overbought). The strategy also includes a 6% stop-loss and a trailing stop that activates at 2% profit, locking in gains as the price moves in your favor.

For production-grade performance, you'll want to incorporate multi-timeframe analysis, volume confirmation, and trend-strength filters like ADX. TrendRider's algorithm, for example, combines 12 indicators across 4 timeframes (5m, 15m, 1h, 4h) to filter out low-quality signals and only enter high-conviction trades.

Step 5: Backtest Your Strategy

Before risking any capital, you must backtest your strategy against historical data. First, download the data for your target pairs:

# Download 12 months of data

freqtrade download-data \

  --exchange bybit \

  --pairs BTC/USDT ETH/USDT SOL/USDT \

  --timeframes 5m 15m 1h 4h \

  --timerange 20250401-20260401

 

# Run the backtest

freqtrade backtesting \

  --strategy MyStrategy \

  --timerange 20250401-20260401 \

  --timeframe 1h

Freqtrade produces a detailed report showing total profit, trade count, win rate, profit factor, maximum drawdown, and SQN score. Focus on these key metrics when evaluating results:

  • Win rate above 55% — anything below suggests your entry logic needs refinement
  • Profit factor above 1.5 — meaning your wins are 1.5x larger than your losses on average
  • Maximum drawdown below 10% — keeping drawdown low is essential for capital preservation
  • SQN above 2.5 — indicating a “good” quality trading system

If your first backtest shows poor results, don't despair. Strategy development is iterative. Adjust your indicator parameters, add filters (like only trading when ADX is above 25), or tighten your stop-loss. Just be careful not to overfit — optimizing until your backtest is perfect almost guarantees poor live performance.

Step 6: Optimize Parameters with Hyperopt

Freqtrade includes a powerful hyperparameter optimization tool called Hyperopt. Instead of manually tweaking EMA periods or RSI thresholds, Hyperopt tests thousands of parameter combinations and finds the ones that produce the best results:

freqtrade hyperopt \

  --strategy MyStrategy \

  --hyperopt-loss SharpeHyperOptLoss \

  --timerange 20250401-20260101 \

  --epochs 500

Use SharpeHyperOptLoss as the optimization target — it optimizes for risk-adjusted returns rather than raw profit, which produces more robust strategies. Run optimization on only 9 months of data and validate the results on the remaining 3 months (out-of-sample testing) to verify the parameters generalize to unseen data.

Step 7: Dry-Run and Go Live

Once your strategy passes backtesting and out-of-sample validation, deploy it in dry-run mode on live market data:

freqtrade trade \

  --strategy MyStrategy \

  --config user_data/config.json

Monitor the paper trading results for 2–4 weeks. Compare dry-run performance against your backtest expectations. If the results are within a reasonable range (live performance is often 10–20% lower than backtest due to slippage and timing differences), you can switch to live trading by setting "dry_run": false in your config.

When going live: Start with a small allocation (5–10% of your intended capital). Set strict risk management rules with stop-losses on every trade. Monitor daily for the first week. Scale up gradually only after confirming live results match your expectations.

Common Pitfalls and How to Avoid Them

Overfitting to historical data. This is the number one mistake beginners make. If your strategy has 15 parameters each optimized to the decimal point, it's almost certainly overfit. Good strategies use 3–5 core parameters with wide, robust ranges. Always validate on out-of-sample data.

Ignoring trading fees. Freqtrade includes fee simulation by default, but make sure the fee rates match your actual exchange tier. On Bybit futures, maker fees are 0.02% and taker fees are 0.055%. A strategy that trades 20 times per day will pay significant fees over time.

Running without monitoring. Even the best bot needs oversight. Set up Telegram notifications in Freqtrade (it has built-in Telegram integration) to receive alerts for every trade, daily summaries, and error notifications. Check your bot's performance at least weekly.

Skipping the dry-run phase. The gap between backtest and live trading is real. Slippage, exchange downtime, API rate limits, and network latency all affect live performance. Dry-run for at least 2 weeks before risking real capital.

The Shortcut: Pre-Built Algorithmic Signals

Building and maintaining a profitable Freqtrade strategy takes significant time and expertise. If you want the benefits of algorithmic trading without the development work, TrendRider offers pre-built, backtested signals delivered directly to Telegram. Our algorithm is built on Freqtrade's engine, combining EMA crossovers, MACD, RSI, ADX, and on-chain sentiment data across 4 timeframes.

With a verified 67.9% win rate, 3.45 SQN score, and just 1.42% maximum drawdown across 10,000+ backtest trades, TrendRider delivers institutional-grade signal quality. Signals include exact entry prices, stop-losses, and take-profit targets — ready for manual execution or auto-trading through Cornix.

Want algorithmic signals without building the bot yourself?

Join TrendRider on Telegram →