mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 09:31:12 +00:00
Simplify validation
This commit is contained in:
parent
be3fcd90e2
commit
a3c52445ee
|
@ -207,15 +207,12 @@ def _validate_protections(conf: Dict[str, Any]) -> None:
|
||||||
f"Please fix the protection {prot.get('method')}."
|
f"Please fix the protection {prot.get('method')}."
|
||||||
)
|
)
|
||||||
|
|
||||||
if parsed_unlock_at is not None and "stop_duration" in prot:
|
if parsed_unlock_at is not None and (
|
||||||
|
"stop_duration" in prot or "stop_duration_candles" in prot
|
||||||
|
):
|
||||||
raise ConfigurationError(
|
raise ConfigurationError(
|
||||||
"Protections must specify either `unlock_at` or `stop_duration`.\n"
|
"Protections must specify either `unlock_at`, `stop_duration` or "
|
||||||
f"Please fix the protection {prot.get('method')}."
|
"`stop_duration_candles`.\n"
|
||||||
)
|
|
||||||
|
|
||||||
if parsed_unlock_at is not None and "stop_duration_candles" in prot:
|
|
||||||
raise ConfigurationError(
|
|
||||||
"Protections must specify either `unlock_at` or `stop_duration_candles`.\n"
|
|
||||||
f"Please fix the protection {prot.get('method')}."
|
f"Please fix the protection {prot.get('method')}."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user