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:
@@ -104,7 +104,7 @@ def _validate_unlimited_amount(conf: dict[str, Any]) -> None:
|
|||||||
"""
|
"""
|
||||||
if (
|
if (
|
||||||
not conf.get("edge", {}).get("enabled")
|
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
|
and conf.get("stake_amount") == UNLIMITED_STAKE_AMOUNT
|
||||||
):
|
):
|
||||||
raise ConfigurationError("`max_open_trades` and `stake_amount` cannot both be unlimited.")
|
raise ConfigurationError("`max_open_trades` and `stake_amount` cannot both be unlimited.")
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class StrategyResolver(IResolver):
|
|||||||
("ignore_buying_expired_candle_after", 0),
|
("ignore_buying_expired_candle_after", 0),
|
||||||
("position_adjustment_enable", False),
|
("position_adjustment_enable", False),
|
||||||
("max_entry_position_adjustment", -1),
|
("max_entry_position_adjustment", -1),
|
||||||
("max_open_trades", -1),
|
("max_open_trades", float("inf")),
|
||||||
]
|
]
|
||||||
for attribute, default in attributes:
|
for attribute, default in attributes:
|
||||||
StrategyResolver._override_attribute_helper(strategy, config, attribute, default)
|
StrategyResolver._override_attribute_helper(strategy, config, attribute, default)
|
||||||
|
|||||||
Reference in New Issue
Block a user