Compare commits

...

9 Commits

Author SHA1 Message Date
Jakub W.
8a9c9d1cf2
Merge 50f07e7b11 into 59a44d6973 2024-09-19 09:07:14 +02:00
Matthias
59a44d6973
Merge pull request #10679 from freqtrade/update/binance-leverage-tiers
Some checks are pending
Build Documentation / Deploy Docs through mike (push) Waiting to run
Update Binance Leverage Tiers
2024-09-19 06:29:02 +02:00
xmatthias
7561692352 chore: update pre-commit hooks 2024-09-19 03:15:32 +00:00
Jakub Werner (jakubikan)
50f07e7b11 only doing this if the category is set 2024-09-17 23:03:51 +02:00
Jakub Werner (jakubikan)
660623181a adding category list if the category is not from the category 2024-09-17 22:36:21 +02:00
Jakub Werner (jakubikan)
03ee3aaf40 adding category list if the category is not from the category 2024-09-17 22:35:00 +02:00
Jakub Werner (jakubikan)
0b7cb2a1a8 cleanup 2024-09-16 22:52:26 +02:00
Jakub Werner (jakubikan)
92af01b0cb adding category for MarketCapPairList.py 2024-09-16 22:51:42 +02:00
Jakub Werner (jakubikan)
dc26d0d7ba adding category for MarketCapPairList.py 2024-09-16 22:50:08 +02:00
2 changed files with 1917 additions and 882 deletions

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@ class MarketCapPairList(IPairList):
self._number_assets = self._pairlistconfig["number_assets"] self._number_assets = self._pairlistconfig["number_assets"]
self._max_rank = self._pairlistconfig.get("max_rank", 30) self._max_rank = self._pairlistconfig.get("max_rank", 30)
self._refresh_period = self._pairlistconfig.get("refresh_period", 86400) self._refresh_period = self._pairlistconfig.get("refresh_period", 86400)
self._category = self._pairlistconfig.get("category", None)
self._marketcap_cache: TTLCache = TTLCache(maxsize=1, ttl=self._refresh_period) self._marketcap_cache: TTLCache = TTLCache(maxsize=1, ttl=self._refresh_period)
self._def_candletype = self._config["candle_type_def"] self._def_candletype = self._config["candle_type_def"]
@ -45,6 +46,15 @@ class MarketCapPairList(IPairList):
is_demo=_coingecko_config.get("is_demo", True), is_demo=_coingecko_config.get("is_demo", True),
) )
if self._category:
categories = self._coingecko.get_coins_categories_list()
category_ids = [cat["category_id"] for cat in categories]
if self._category not in category_ids:
raise OperationalException(
f"category not in coingecko category list you can choose from {category_ids}"
)
if self._max_rank > 250: if self._max_rank > 250:
raise OperationalException("This filter only support marketcap rank up to 250.") raise OperationalException("This filter only support marketcap rank up to 250.")
@ -85,6 +95,12 @@ class MarketCapPairList(IPairList):
"description": "Max rank of assets", "description": "Max rank of assets",
"help": "Maximum rank of assets to use from the pairlist", "help": "Maximum rank of assets to use from the pairlist",
}, },
"category": {
"type": "string",
"default": None,
"description": "The Category",
"help": "Th Category of the coin e.g layer-1 default None",
},
"refresh_period": { "refresh_period": {
"type": "number", "type": "number",
"default": 86400, "default": 86400,
@ -140,6 +156,7 @@ class MarketCapPairList(IPairList):
page="1", page="1",
sparkline="false", sparkline="false",
locale="en", locale="en",
**({"category": self._category} if self._category else {}),
) )
if data: if data:
marketcap_list = [row["symbol"] for row in data] marketcap_list = [row["symbol"] for row in data]