proper validation of freqai config parameters

This commit is contained in:
robcaulk
2022-05-25 12:37:25 +02:00
parent 7ff3258607
commit 7486d9d9e2
5 changed files with 34 additions and 37 deletions

View File

@@ -85,6 +85,7 @@ def validate_config_consistency(conf: Dict[str, Any], preliminary: bool = False)
_validate_unlimited_amount(conf)
_validate_ask_orderbook(conf)
validate_migrated_strategy_settings(conf)
_validate_freqai(conf)
# validate configuration before returning
logger.info('Validating configuration ...')
@@ -163,6 +164,21 @@ def _validate_edge(conf: Dict[str, Any]) -> None:
)
def _validate_freqai(conf: Dict[str, Any]) -> None:
"""
Freqai param validator
"""
if not conf.get('freqai', {}):
return
for param in constants.SCHEMA_FREQAI_REQUIRED:
if param not in conf.get('freqai', {}):
raise OperationalException(
f'{param} not found in Freqai config'
)
def _validate_whitelist(conf: Dict[str, Any]) -> None:
"""
Dynamic whitelist does not require pair_whitelist to be set - however StaticWhitelist does.