From bbf6bade7c9e551b9dc4db21bfff1c1484e59b23 Mon Sep 17 00:00:00 2001 From: hippocritical Date: Tue, 20 May 2025 21:30:41 +0200 Subject: [PATCH] Fixed a bug where the pairlist was just .*/USDT (with a length of 1.) The bug happened since it just checked the length of the list itself, not what it represents. in this case .*/USDT could be any amount of pairs when the user sets a max_open_trades of let's say 3 then the pairs only have 3 trade slots of whatever amount of pairs it really has and thereby creating a bottleneck. This just sets the max_open_trades to -1 without even checking it, letting freqtrade itself handle the amount of trades allowed at a given time. --- freqtrade/optimize/analysis/lookahead_helpers.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/freqtrade/optimize/analysis/lookahead_helpers.py b/freqtrade/optimize/analysis/lookahead_helpers.py index 631a9549f..7ff83f86c 100644 --- a/freqtrade/optimize/analysis/lookahead_helpers.py +++ b/freqtrade/optimize/analysis/lookahead_helpers.py @@ -153,14 +153,10 @@ class LookaheadAnalysisSubFunctions: raise OperationalException( "Targeted trade amount can't be smaller than minimum trade amount." ) - if len(config["pairs"]) > config.get("max_open_trades", 0): - logger.info( - "Max_open_trades were less than amount of pairs " - "or defined in the strategy. " - "Set max_open_trades to amount of pairs " - "just to avoid false positives." - ) - config["max_open_trades"] = len(config["pairs"]) + config["max_open_trades"] = -1 + logger.info( + f"forced pairs to -1 (same amount of max_open_trades as there are pairs)" + ) min_dry_run_wallet = 1000000000 if get_dry_run_wallet(config) < min_dry_run_wallet: