mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
option B
This commit is contained in:
@@ -154,15 +154,25 @@ class MarketCapFilter(IPairList):
|
|||||||
|
|
||||||
if can_filter:
|
if can_filter:
|
||||||
filtered_pairlist = []
|
filtered_pairlist = []
|
||||||
top_marketcap = marketcap_list[:self._max_rank:]
|
|
||||||
|
|
||||||
for pair in pairlist:
|
# option A
|
||||||
base = pair.split('/')[0]
|
# top_marketcap = marketcap_list[:self._max_rank:]
|
||||||
if base.lower() in top_marketcap:
|
|
||||||
filtered_pairlist.append(pair)
|
# for pair in pairlist:
|
||||||
else:
|
# base = pair.split('/')[0]
|
||||||
logger.info(f"Remove {pair} from whitelist because it's not in "
|
# if base.lower() in top_marketcap:
|
||||||
f"top {self._max_rank} market cap")
|
# filtered_pairlist.append(pair)
|
||||||
|
# else:
|
||||||
|
# logger.info(f"Remove {pair} from whitelist because it's not in "
|
||||||
|
# f"top {self._max_rank} market cap")
|
||||||
|
|
||||||
|
# option B
|
||||||
|
for mc_pair in marketcap_list:
|
||||||
|
test_pair = f"{mc_pair.upper()}/{self._stake_currency.upper}"
|
||||||
|
if test_pair in pairlist:
|
||||||
|
filtered_pairlist.append(test_pair)
|
||||||
|
if len(filtered_pairlist) == self._max_rank:
|
||||||
|
break
|
||||||
|
|
||||||
if len(filtered_pairlist) > 0:
|
if len(filtered_pairlist) > 0:
|
||||||
return filtered_pairlist
|
return filtered_pairlist
|
||||||
|
|||||||
Reference in New Issue
Block a user