{"record":{"id":"0b2ef0f5b911f6ed","repo":"freqtrade/freqtrade","slug":"this-strategy-requires-startup-candles-candles-t-0b2ef0","errorCode":null,"errorMessage":"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}.","messagePattern":"This strategy requires (.+?) candles to start, which is more than \\((.+?) candles\\) the amount of candles (.+?) provides for (.+?)\\.","errorType":"exception","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"freqtrade/exchange/exchange.py","lineNumber":914,"sourceCode":"            self._config[\"candle_type_def\"],\n            dt_ts(date_minus_candles(timeframe, startup_candles)) if timeframe else None,\n        )\n        # Require one more candle - to account for the still open candle.\n        candle_count = startup_candles + 1\n        # Allow 5 calls to the exchange per pair\n        required_candle_call_count = int(\n            (candle_count / candle_limit) + (0 if candle_count % candle_limit == 0 else 1)\n        )\n        if self._ft_has[\"ohlcv_has_history\"]:\n            if required_candle_call_count > 5:\n                # Only allow 5 calls per pair to somewhat limit the impact\n                raise ConfigurationError(\n                    f\"This strategy requires {startup_candles} candles to start, \"\n                    f\"which is more than 5x ({candle_limit * 5 - 1} candles) \"\n                    f\"the amount of candles {self.name} provides for {timeframe}.\"\n                )\n        elif required_candle_call_count > 1:\n            raise ConfigurationError(\n                f\"This strategy requires {startup_candles} candles to start, \"\n                f\"which is more than ({candle_limit - 1} candles) \"\n                f\"the amount of candles {self.name} provides for {timeframe}.\"\n            )\n        if required_candle_call_count > 1:\n            logger.warning(\n                f\"Using {required_candle_call_count} calls to get OHLCV. \"\n                f\"This can result in slower operations for the bot. Please check \"\n                f\"if you really need {startup_candles} candles for your strategy.\"\n            )\n        return required_candle_call_count\n\n    def validate_trading_mode_and_margin_mode(\n        self,\n        trading_mode: TradingMode,\n        margin_mode: MarginMode | None,  # Only None when trading_mode = TradingMode.SPOT\n        allow_none_margin_mode: bool = False,\n    ):","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/freqtrade/freqtrade/blob/1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15/freqtrade/exchange/exchange.py#L896-L932","documentation":"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.","triggerScenarios":"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.","commonSituations":"Porting warmup-heavy strategies to exchanges with limited OHLCV depth; users seeing the 5x variant solved elsewhere and expecting the same ceiling here.","solutions":["Reduce startup_candles below candle_limit - 1 (usually 499).","Switch to an exchange with ohlcv_has_history where the 5-call allowance applies.","Precompute indicators needing deep history offline and feed via informative data files."],"exampleFix":"# strategy - before\nstartup_candles: int = 600  # exceeds single-call limit\n\n# after\nstartup_candles: int = 400","handlingStrategy":"validation","validationCode":"limit = exchange.ohlcv_candle_limit(timeframe, config['candle_type_def'])\nneed = strategy.startup_candles + 1\nif not exchange._ft_has['ohlcv_has_history'] and need > limit:\n    raise SystemExit(f\"startup_candles must be <= {limit - 1} on this exchange\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On history-less exchanges, cap startup_candles below the single-call candle limit (usually 499).","Avoid deep-lookback indicators on rolling-window exchanges."],"tags":["exchange","ohlcv","startup-candles","strategy","configuration"],"backgroundTag":null,"analyzedSha":"1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15","analyzedAt":"2026-08-15T05:09:08.096Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}