Pair name-based sorting.

Attempt at more rational string sorting. Change test to show not working as expected.
This commit is contained in:
Leif Segen 2020-11-28 11:33:25 -06:00
parent 03c5714399
commit 6a74c57c3d
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class PerformanceFilter(IPairList):
# set initial value for pairs with no trades to 0 # set initial value for pairs with no trades to 0
# and sort the list using performance and count # and sort the list using performance and count
sorted_df = list_df.merge(performance, on='pair', how='left')\ sorted_df = list_df.merge(performance, on='pair', how='left')\
.fillna(0).sort_values(by=['profit', 'count'], ascending=False) .fillna(0).sort_values(by=['profit', 'count', 'pair'], ascending=False)
pairlist = sorted_df['pair'].tolist() pairlist = sorted_df['pair'].tolist()
return pairlist return pairlist

View File

@ -305,7 +305,7 @@ def test_VolumePairList_refresh_empty(mocker, markets_empty, whitelist_conf):
# PerformanceFilter # PerformanceFilter
([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume"}, ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume"},
{"method": "PerformanceFilter"}], {"method": "PerformanceFilter"}],
"USDT", ['ETH/USDT', 'NANO/USDT', 'ADAHALF/USDT', 'ADADOUBLE/USDT']), "USDT", ['ETH/USDT', 'NANO/USDT', 'ADADOUBLE/USDT', 'ADAHALF/USDT']),
# AgeFilter only # AgeFilter only
([{"method": "AgeFilter", "min_days_listed": 2}], ([{"method": "AgeFilter", "min_days_listed": 2}],
"BTC", 'filter_at_the_beginning'), # OperationalException expected "BTC", 'filter_at_the_beginning'), # OperationalException expected