Rename config whitelist to pairlist

This commit is contained in:
Matthias 2018-12-04 20:23:03 +01:00
parent bf678164c7
commit 6ab907bef1
10 changed files with 29 additions and 29 deletions

View File

@ -39,7 +39,7 @@
"stoploss": "market",
"stoploss_on_exchange": "false"
},
"whitelist": {
"pairlist": {
"method": "VolumePairList",
"config": {
"number_assets": 20,

View File

@ -111,7 +111,7 @@ class Configuration(object):
# Add dynamic_whitelist if found
if 'dynamic_whitelist' in self.args and self.args.dynamic_whitelist:
# Update to volumePairList (the previous default)
config['whitelist'] = {'method': 'VolumePairList',
config['pairlist'] = {'method': 'VolumePairList',
'config': {'number_assets': self.args.dynamic_whitelist}
}
logger.warning(

View File

@ -124,7 +124,7 @@ CONF_SCHEMA = {
'ignore_roi_if_buy_signal_true': {'type': 'boolean'}
}
},
'whitelist': {
'pairlist': {
'type': 'object',
'properties': {
'method': {'type': 'string', 'enum': AVAILABLE_PAIRLISTS},

View File

@ -59,7 +59,7 @@ class FreqtradeBot(object):
self.persistence = None
self.exchange = Exchange(self.config)
self.wallets = Wallets(self.exchange)
if self.config.get('whitelist', {}).get('method') == 'VolumePairList':
if self.config.get('pairlist', {}).get('method') == 'VolumePairList':
self.pairlists: StaticPairList = VolumePairList(self, self.config)
else:
self.pairlists: StaticPairList = StaticPairList(self, self.config)

View File

@ -20,7 +20,7 @@ class VolumePairList(StaticPairList):
def __init__(self, freqtrade, config: dict) -> None:
self._freqtrade = freqtrade
self._config = config
self._whitelistconf = self._config.get('whitelist', {}).get('config')
self._whitelistconf = self._config.get('pairlist', {}).get('config')
self._whitelist = self._config['exchange']['pair_whitelist']
self._blacklist = self._config['exchange'].get('pair_blacklist', [])
self._number_pairs = self._whitelistconf['number_assets']

View File

@ -23,7 +23,7 @@ def whitelist_conf(default_conf):
default_conf['exchange']['pair_blacklist'] = [
'BLK/BTC'
]
default_conf['whitelist'] = {'method': 'StaticPairList',
default_conf['pairlist'] = {'method': 'StaticPairList',
'config': {'number_assets': 3}
}
@ -58,7 +58,7 @@ def test_refresh_pairlists(mocker, markets, whitelist_conf):
def test_refresh_whitelist_dynamic(mocker, markets, tickers, whitelist_conf):
whitelist_conf['whitelist'] = {'method': 'VolumePairList',
whitelist_conf['pairlist'] = {'method': 'VolumePairList',
'config': {'number_assets': 5}
}
mocker.patch.multiple(
@ -90,7 +90,7 @@ def test_VolumePairList_refresh_empty(mocker, markets_empty, whitelist_conf):
def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, markets, tickers) -> None:
whitelist_conf['whitelist']['method'] = 'VolumePairList'
whitelist_conf['pairlist']['method'] = 'VolumePairList'
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
freqtrade = get_patched_freqtradebot(mocker, whitelist_conf)
mocker.patch('freqtrade.exchange.Exchange.get_markets', markets)
@ -114,7 +114,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, markets, tickers)
def test_gen_pair_whitelist_not_supported(mocker, default_conf, tickers) -> None:
default_conf['whitelist'] = {'method': 'VolumePairList',
default_conf['pairlist'] = {'method': 'VolumePairList',
'config': {'number_assets': 10}
}
mocker.patch('freqtrade.exchange.Exchange.get_tickers', tickers)
@ -126,7 +126,7 @@ def test_gen_pair_whitelist_not_supported(mocker, default_conf, tickers) -> None
@pytest.mark.parametrize("pairlist", AVAILABLE_PAIRLISTS)
def test_pairlist_class(mocker, whitelist_conf, markets, pairlist):
whitelist_conf['whitelist']['method'] = pairlist
whitelist_conf['pairlist']['method'] = pairlist
mocker.patch('freqtrade.exchange.Exchange.get_markets', markets)
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
freqtrade = get_patched_freqtradebot(mocker, whitelist_conf)

View File

@ -662,7 +662,7 @@ def test_rpc_whitelist(mocker, default_conf) -> None:
def test_rpc_whitelist_dynamic(mocker, default_conf) -> None:
patch_coinmarketcap(mocker)
patch_exchange(mocker)
default_conf['whitelist'] = {'method': 'VolumePairList',
default_conf['pairlist'] = {'method': 'VolumePairList',
'config': {'number_assets': 4}
}
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))

View File

@ -1034,7 +1034,7 @@ def test_whitelist_dynamic(default_conf, update, mocker) -> None:
_send_msg=msg_mock
)
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
default_conf['whitelist'] = {'method': 'VolumePairList',
default_conf['pairlist'] = {'method': 'VolumePairList',
'config': {'number_assets': 4}
}
freqtradebot = get_patched_freqtradebot(mocker, default_conf)

View File

@ -119,8 +119,8 @@ def test_load_config_with_params(default_conf, mocker) -> None:
configuration = Configuration(args)
validated_conf = configuration.load_config()
assert validated_conf.get('whitelist', {}).get('method') == 'VolumePairList'
assert validated_conf.get('whitelist', {}).get('config').get('number_assets') == 10
assert validated_conf.get('pairlist', {}).get('method') == 'VolumePairList'
assert validated_conf.get('pairlist', {}).get('config').get('number_assets') == 10
assert validated_conf.get('strategy') == 'TestStrategy'
assert validated_conf.get('strategy_path') == '/some/path'
assert validated_conf.get('db_url') == 'sqlite:///someurl'

View File

@ -2532,7 +2532,7 @@ def test_order_book_ask_strategy(default_conf, limit_buy_order, limit_sell_order
def test_startup_messages(default_conf, mocker):
default_conf['whitelist'] = {'method': 'VolumePairList',
default_conf['pairlist'] = {'method': 'VolumePairList',
'config': {'number_assets': 20}
}
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))