Merge feat/freqai into develop to get new features

This commit is contained in:
robcaulk
2022-07-03 16:17:13 +02:00
29 changed files with 3894 additions and 8 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.

View File

@@ -97,6 +97,8 @@ class Configuration:
self._process_analyze_options(config)
self._process_freqai_options(config)
# Check if the exchange set by the user is supported
check_exchange(config, config.get('experimental', {}).get('block_bad_exchanges', True))
@@ -461,6 +463,16 @@ class Configuration:
config.update({'runmode': self.runmode})
def _process_freqai_options(self, config: Dict[str, Any]) -> None:
self._args_to_config(config, argname='freqaimodel',
logstring='Using freqaimodel class name: {}')
self._args_to_config(config, argname='freqaimodel_path',
logstring='Using freqaimodel path: {}')
return
def _args_to_config(self, config: Dict[str, Any], argname: str,
logstring: str, logfun: Optional[Callable] = None,
deprecated_msg: Optional[str] = None) -> None: