Skip to content

Commit 9d91a4a

Browse files
committed
fix: default max_open_trades to inf instead of -1
Without this, the auto-conversion doesn't backpopulate to the config closes freqtrade#11752
1 parent 3b6dbac commit 9d91a4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

freqtrade/configuration/config_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _validate_unlimited_amount(conf: dict[str, Any]) -> None:
104104
"""
105105
if (
106106
not conf.get("edge", {}).get("enabled")
107-
and conf.get("max_open_trades") == float("inf")
107+
and (conf.get("max_open_trades") == float("inf") or conf.get("max_open_trades") == -1)
108108
and conf.get("stake_amount") == UNLIMITED_STAKE_AMOUNT
109109
):
110110
raise ConfigurationError("`max_open_trades` and `stake_amount` cannot both be unlimited.")

freqtrade/resolvers/strategy_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def load_strategy(config: Config | None = None) -> IStrategy:
7979
("ignore_buying_expired_candle_after", 0),
8080
("position_adjustment_enable", False),
8181
("max_entry_position_adjustment", -1),
82-
("max_open_trades", -1),
82+
("max_open_trades", float("inf")),
8383
]
8484
for attribute, default in attributes:
8585
StrategyResolver._override_attribute_helper(strategy, config, attribute, default)

0 commit comments

Comments
 (0)