freqtrade/freqtrade · error · ConfigurationError

This strategy requires {startup_candles} candles to start, w

Error message

This strategy requires {startup_candles} candles to start, which is more than ({candle_limit - 1} candles) the amount of candles {self.name} provides for {timeframe}.

What it means

Raised in validate_required_startup_candles() on exchanges where _ft_has['ohlcv_has_history'] is false: the exchange serves only a rolling window, so startup candles must fit in a single call. If startup_candles + 1 exceeds the candle limit (message shows candle_limit - 1 as the practical max), configuration aborts because gaps in indicator warmup would be unavoidable.

Source

Thrown at freqtrade/exchange/exchange.py:914

            self._config["candle_type_def"],
            dt_ts(date_minus_candles(timeframe, startup_candles)) if timeframe else None,
        )
        # Require one more candle - to account for the still open candle.
        candle_count = startup_candles + 1
        # Allow 5 calls to the exchange per pair
        required_candle_call_count = int(
            (candle_count / candle_limit) + (0 if candle_count % candle_limit == 0 else 1)
        )
        if self._ft_has["ohlcv_has_history"]:
            if required_candle_call_count > 5:
                # Only allow 5 calls per pair to somewhat limit the impact
                raise ConfigurationError(
                    f"This strategy requires {startup_candles} candles to start, "
                    f"which is more than 5x ({candle_limit * 5 - 1} candles) "
                    f"the amount of candles {self.name} provides for {timeframe}."
                )
        elif required_candle_call_count > 1:
            raise ConfigurationError(
                f"This strategy requires {startup_candles} candles to start, "
                f"which is more than ({candle_limit - 1} candles) "
                f"the amount of candles {self.name} provides for {timeframe}."
            )
        if required_candle_call_count > 1:
            logger.warning(
                f"Using {required_candle_call_count} calls to get OHLCV. "
                f"This can result in slower operations for the bot. Please check "
                f"if you really need {startup_candles} candles for your strategy."
            )
        return required_candle_call_count

    def validate_trading_mode_and_margin_mode(
        self,
        trading_mode: TradingMode,
        margin_mode: MarginMode | None,  # Only None when trading_mode = TradingMode.SPOT
        allow_none_margin_mode: bool = False,
    ):

View on GitHub (pinned to 1c8edfe4d1)

Solutions

  1. Reduce startup_candles below candle_limit - 1 (usually 499).
  2. Switch to an exchange with ohlcv_has_history where the 5-call allowance applies.
  3. Precompute indicators needing deep history offline and feed via informative data files.

Example fix

# strategy - before
startup_candles: int = 600  # exceeds single-call limit

# after
startup_candles: int = 400
Defensive patterns

Strategy: validation

Validate before calling

limit = exchange.ohlcv_candle_limit(timeframe, config['candle_type_def'])
need = strategy.startup_candles + 1
if not exchange._ft_has['ohlcv_has_history'] and need > limit:
    raise SystemExit(f"startup_candles must be <= {limit - 1} on this exchange")

Prevention

When it happens

Trigger: Strategies with startup_candles >= ohlcv_candle_limit (commonly 500) on history-less exchanges; requesting 400+ warmup candles where only ~499 are reachable in one call.

Common situations: Porting warmup-heavy strategies to exchanges with limited OHLCV depth; users seeing the 5x variant solved elsewhere and expecting the same ceiling here.

Related errors


AI-assisted analysis of freqtrade/freqtrade@1c8edfe4d1 (2026-08-15). Data as JSON: /api/errors/0b2ef0f5b911f6ed. Report an issue: GitHub.