{"record":{"id":"87d354b0e2b5a322","repo":"freqtrade/freqtrade","slug":"no-pair-in-whitelist","errorCode":null,"errorMessage":"No pair in whitelist.","messagePattern":"No pair in whitelist\\.","errorType":"exception","errorClass":"OperationalException","httpStatus":null,"severity":"error","filePath":"freqtrade/optimize/backtesting.py","lineNumber":212,"sourceCode":"                \"Timeframe needs to be set in either \"\n                \"configuration or as cli argument `--timeframe 5m`\"\n            )\n        self.timeframe = str(self.config.get(\"timeframe\"))\n        self.timeframe_secs = timeframe_to_seconds(self.timeframe)\n        self.timeframe_min = self.timeframe_secs // 60\n        self.timeframe_td = timedelta(seconds=self.timeframe_secs)\n        self._is_backtest_runmode = self.dataprovider.runmode == RunMode.BACKTEST\n        self.disable_database_use()\n        self.init_backtest_detail()\n        self.pairlists = PairListManager(self.exchange, self.config, self.dataprovider)\n        self._validate_pairlists_for_backtesting()\n\n        self.dataprovider.add_pairlisthandler(self.pairlists)\n        self.dynamic_pairlist: bool = self.config.get(\"enable_dynamic_pairlist\", False)\n        self.pairlists.refresh_pairlist(only_first=self.dynamic_pairlist)\n\n        if len(self.pairlists.whitelist) == 0:\n            raise OperationalException(\"No pair in whitelist.\")\n        self.set_fee()\n        self.precision_mode = self.exchange.precisionMode\n        self.precision_mode_price = self.exchange.precision_mode_price\n\n        if self.config.get(\"freqai_backtest_live_models\", False):\n            from freqtrade.freqai.utils import get_timerange_backtest_live_models\n\n            self.config[\"timerange\"] = get_timerange_backtest_live_models(self.config)\n\n        self.timerange = TimeRange.parse_timerange(\n            None if self.config.get(\"timerange\") is None else str(self.config.get(\"timerange\"))\n        )\n\n        # Get maximum required startup period\n        self.required_startup = max([strat.startup_candle_count for strat in self.strategylist])\n        self.exchange.validate_required_startup_candles(self.required_startup, self.timeframe)\n\n        # Add maximum startup candle count to configuration for informative pairs support","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/freqtrade/freqtrade/blob/1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15/freqtrade/optimize/backtesting.py#L194-L230","documentation":"Thrown in Backtesting.init_backtest right after `self.pairlists.refresh_pairlist(...)` when the resulting whitelist is empty. It means the pairlist chain (whitelist plus any filters) removed every candidate pair before the backtest could start. The exchange object and fee are already initialized at this point, so the failure is purely about pair selection.","triggerScenarios":"Backtesting with an empty `pair_whitelist`, or with filters (PriceFilter, SpreadFilter, AgeFilter, etc.) or a malformed StaticPairList/VolumepairList chain that filters out all pairs; also a whitelist of pairs that all fail validation against the exchange markets.","commonSituations":"Copy-pasted config with pair symbols that don't match the exchange's format (e.g. 'BTC/USDT' on an exchange quoted differently), a pair_whitelist emptied by an aggressive PercentOfVolumeFilter, or futures configs listing spot-only pairs.","solutions":["Check `pair_whitelist` in the active config is non-empty and uses exact exchange symbols (e.g. \"BTC/USDT\", \"ETH/USDT:USDT\" for futures).","Temporarily remove pairlist filters (PriceFilter, SpreadFilter, ...) to identify which one removes all pairs.","Run `freqtrade test-pairlist` to inspect what the pairlist chain produces.","For futures, verify trading_mode/futures_pair_whitelist consistency and that the pairs exist on the exchange."],"exampleFix":"# before\n\"pairlists\": [{\"method\": \"StaticPairList\"}, {\"method\": \"PriceFilter\", \"low_price_ratio\": 0.5}],\n\"exchange\": {\"pair_whitelist\": [\"BTC/USDT\"]}\n# after\n\"pairlists\": [{\"method\": \"StaticPairList\"}],\n\"exchange\": {\"pair_whitelist\": [\"BTC/USDT\", \"ETH/USDT\"]}","handlingStrategy":"validation","validationCode":"def validate_whitelist(config) -> bool:\n    chain = [p[\"method\"] for p in config.get(\"pairlists\", [])]\n    pairs = config.get(\"exchange\", {}).get(\"pair_whitelist\", [])\n    return bool(pairs) and \"StaticPairList\" in chain  # dynamic chains may still empty out","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `freqtrade test-pairlist -c <config>` before backtesting to see the effective pairlist.","Prefer StaticPairList with an explicit whitelist for backtests.","Use exact exchange symbols (futures pairs end with :USDT for USDT-margined futures)."],"tags":["freqtrade","backtesting","pairlist","whitelist","configuration"],"backgroundTag":null,"analyzedSha":"1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15","analyzedAt":"2026-08-15T05:09:08.096Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}