Replace get_markets_cache() with get_markets_exchange()
This commit is contained in:
@@ -117,18 +117,15 @@ class MarketCapPairList(IPairList):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_markets_cache(self):
|
def get_markets_exchange(self):
|
||||||
markets = self._marketcap_cache.get("markets")
|
markets = [
|
||||||
if not markets:
|
k
|
||||||
markets = [
|
for k in self._exchange.get_markets(
|
||||||
k
|
quote_currencies=[self._stake_currency], tradable_only=True, active_only=True
|
||||||
for k in self._exchange.get_markets(
|
).keys()
|
||||||
quote_currencies=[self._stake_currency], tradable_only=True, active_only=True
|
]
|
||||||
).keys()
|
|
||||||
]
|
|
||||||
self._marketcap_cache["markets"] = markets.copy()
|
|
||||||
|
|
||||||
return markets.copy()
|
return markets
|
||||||
|
|
||||||
def gen_pairlist(self, tickers: Tickers) -> list[str]:
|
def gen_pairlist(self, tickers: Tickers) -> list[str]:
|
||||||
"""
|
"""
|
||||||
@@ -145,7 +142,7 @@ class MarketCapPairList(IPairList):
|
|||||||
else:
|
else:
|
||||||
# Use fresh pairlist
|
# Use fresh pairlist
|
||||||
# Check if pair quote currency equals to the stake currency.
|
# Check if pair quote currency equals to the stake currency.
|
||||||
_pairlist = self.get_markets_cache()
|
_pairlist = self.get_markets_exchange()
|
||||||
|
|
||||||
# No point in testing for blacklisted pairs...
|
# No point in testing for blacklisted pairs...
|
||||||
_pairlist = self.verify_blacklist(_pairlist, logger.info)
|
_pairlist = self.verify_blacklist(_pairlist, logger.info)
|
||||||
@@ -230,7 +227,7 @@ class MarketCapPairList(IPairList):
|
|||||||
pair_format += f":{self._stake_currency.upper()}"
|
pair_format += f":{self._stake_currency.upper()}"
|
||||||
|
|
||||||
top_marketcap = marketcap_list[: self._max_rank :]
|
top_marketcap = marketcap_list[: self._max_rank :]
|
||||||
markets = self.get_markets_cache()
|
markets = self.get_markets_exchange()
|
||||||
|
|
||||||
for mc_pair in top_marketcap:
|
for mc_pair in top_marketcap:
|
||||||
pair = f"{mc_pair.upper()}/{pair_format}"
|
pair = f"{mc_pair.upper()}/{pair_format}"
|
||||||
|
|||||||
Reference in New Issue
Block a user