prior pairlists should go first
This commit is contained in:
parent
bd106b4b8e
commit
af59572cb9
@ -62,7 +62,7 @@ class ProducerPairList(IPairList):
|
|||||||
if pairlist is None:
|
if pairlist is None:
|
||||||
pairlist = self._pairlistmanager._dataprovider.get_producer_pairs(self._producer_name)
|
pairlist = self._pairlistmanager._dataprovider.get_producer_pairs(self._producer_name)
|
||||||
|
|
||||||
pairs = list(dict.fromkeys(upstream_pairlist + pairlist))
|
pairs = list(dict.fromkeys(pairlist + upstream_pairlist))
|
||||||
if self._num_assets:
|
if self._num_assets:
|
||||||
pairs = pairs[:self._num_assets]
|
pairs = pairs[:self._num_assets]
|
||||||
|
|
||||||
|
@ -1413,3 +1413,16 @@ def test_ProducerPairlist(mocker, whitelist_conf, markets):
|
|||||||
# Pairlist reduced to 2
|
# Pairlist reduced to 2
|
||||||
assert pm.whitelist == pairs[:2]
|
assert pm.whitelist == pairs[:2]
|
||||||
assert len(pm.whitelist) == 2
|
assert len(pm.whitelist) == 2
|
||||||
|
whitelist_conf['exchange']['pair_whitelist'] = ['TKN/BTC']
|
||||||
|
|
||||||
|
whitelist_conf['pairlists'] = [
|
||||||
|
{"method": "StaticPairList"},
|
||||||
|
{
|
||||||
|
"method": "ProducerPairList",
|
||||||
|
"producer_name": "hello_world",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
pm = PairListManager(exchange, whitelist_conf, dp)
|
||||||
|
pm.refresh_pairlist()
|
||||||
|
assert len(pm.whitelist) == 4
|
||||||
|
assert pm.whitelist == ['TKN/BTC'] + pairs
|
||||||
|
Loading…
Reference in New Issue
Block a user