Check if number_assets is defined, as it's required by VolumePairList

This commit is contained in:
Matthias
2018-12-06 19:36:33 +01:00
parent 2f0d7a1aea
commit a63f123b6d
3 changed files with 13 additions and 1 deletions

View File

@@ -20,6 +20,10 @@ class VolumePairList(IPairList):
def __init__(self, freqtrade, config: dict) -> None:
super().__init__(freqtrade, config)
self._whitelistconf = self._config.get('pairlist', {}).get('config')
if 'number_assets' not in self._whitelistconf:
raise OperationalException(
f'`number_assets` not specified. Please check your configuration '
'for "pairlist.config.number_assets"')
self._number_pairs = self._whitelistconf['number_assets']
self._sort_key = self._whitelistconf.get('sort_key', 'quoteVolume')