fix: default max_open_trades to inf instead of -1

Without this, the auto-conversion doesn't backpopulate to the config

closes #11752
This commit is contained in:
Matthias
2025-05-14 20:14:10 +02:00
parent 3b6dbaccf8
commit 9d91a4a298
2 changed files with 2 additions and 2 deletions

View File

@@ -104,7 +104,7 @@ def _validate_unlimited_amount(conf: dict[str, Any]) -> None:
"""
if (
not conf.get("edge", {}).get("enabled")
and conf.get("max_open_trades") == float("inf")
and (conf.get("max_open_trades") == float("inf") or conf.get("max_open_trades") == -1)
and conf.get("stake_amount") == UNLIMITED_STAKE_AMOUNT
):
raise ConfigurationError("`max_open_trades` and `stake_amount` cannot both be unlimited.")

View File

@@ -79,7 +79,7 @@ class StrategyResolver(IResolver):
("ignore_buying_expired_candle_after", 0),
("position_adjustment_enable", False),
("max_entry_position_adjustment", -1),
("max_open_trades", -1),
("max_open_trades", float("inf")),
]
for attribute, default in attributes:
StrategyResolver._override_attribute_helper(strategy, config, attribute, default)