Freqtrade Basics: A Comprehensive Guide to Key Concepts

·

This guide covers fundamental concepts about how Freqtrade operates and its core functionalities.

Freqtrade Terminology

Fee Management

Freqtrade incorporates fees in all profit calculations:

👉 Optimize your trading strategy with low fees

Trading Pair Nomenclature

Follows CCXT conventions:

Spot Pairs

Format: base/quote (e.g., ETH/USDT).

Futures Pairs

Format: base/quote:settle (e.g., ETH/USDT:USDT).

Bot Execution Logic

The iterative loop runs every few seconds (internals.process_throttle_secs):

  1. Initialization:

    • Fetch open trades from storage.
    • Identify tradable pairs.
    • Download OHLCV data (including informational pairs).
  2. Strategy Analysis:

    • Call populate_indicators().
    • Evaluate entry/exit trends via populate_entry_trend() and populate_exit_trend().
  3. Order Management:

    • Check order timeouts (check_entry_timeout(), check_exit_timeout()).
    • Adjust prices via adjust_entry_price().
  4. Position Handling:

    • Validate stop-loss, ROI, exit signals.
    • Determine exit pricing (exit_pricing or custom_exit_price()).
    • Call confirm_trade_exit() before order placement.
  5. Entry Validation:

    • Set entry price (entry_pricing or custom_entry_price()).
    • Calculate leverage (leverage()) for margin/futures.
    • Determine stake size (custom_stake_amount()).
    • Confirm via confirm_trade_entry().

Backtesting/Hyperopt Execution

Simulates core logic without live interactions:

👉 Master backtesting techniques for better results

FAQ

Q: How often are callbacks triggered in backtesting vs. live trading?
A: Backtesting calls each callback once per candle; live trading triggers them per iteration (~5s intervals).

Q: Does Freqtrade support custom fee structures?
A: Yes, use --fee parameter in backtesting/hyperopt to override defaults.

Q: What happens if a trading pair uses incorrect nomenclature?
A: The bot may fail to recognize it, causing errors like "pair unavailable."

Q: How is total profit calculated?
A: Sum of realized/unrealized profits relative to total investment.

Q: Can I adjust open positions dynamically?
A: Yes, via adjust_trade_position() callback for live trading.