Add rudimentary description per pairlist
This commit is contained in:
@@ -68,6 +68,10 @@ class AgeFilter(IPairList):
|
|||||||
f"{self._max_days_listed} {plural(self._max_days_listed, 'day')}"
|
f"{self._max_days_listed} {plural(self._max_days_listed, 'day')}"
|
||||||
) if self._max_days_listed else '')
|
) if self._max_days_listed else '')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filter pairs by age (days listed)."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ class IPairList(LoggingMixin, ABC):
|
|||||||
If no Pairlist requires tickers, an empty Dict is passed
|
If no Pairlist requires tickers, an empty Dict is passed
|
||||||
as tickers argument to filter_pairlist
|
as tickers argument to filter_pairlist
|
||||||
"""
|
"""
|
||||||
|
return False
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
@abstractmethod
|
||||||
|
def description() -> str:
|
||||||
|
"""
|
||||||
|
Return description of this Pairlist Handler
|
||||||
|
-> Please overwrite in subclasses
|
||||||
|
"""
|
||||||
|
return ""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ class OffsetFilter(IPairList):
|
|||||||
return f"{self.name} - Taking {self._number_pairs} Pairs, starting from {self._offset}."
|
return f"{self.name} - Taking {self._number_pairs} Pairs, starting from {self._offset}."
|
||||||
return f"{self.name} - Offsetting pairs by {self._offset}."
|
return f"{self.name} - Offsetting pairs by {self._offset}."
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Offset pair list filter."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ class PerformanceFilter(IPairList):
|
|||||||
"""
|
"""
|
||||||
return f"{self.name} - Sorting pairs by performance."
|
return f"{self.name} - Sorting pairs by performance."
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filter pairs by performance."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ class PrecisionFilter(IPairList):
|
|||||||
"""
|
"""
|
||||||
return f"{self.name} - Filtering untradable pairs."
|
return f"{self.name} - Filtering untradable pairs."
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filters low-value coins which would not allow setting stoplosses."
|
||||||
|
|
||||||
def _validate_pair(self, pair: str, ticker: Optional[Ticker]) -> bool:
|
def _validate_pair(self, pair: str, ticker: Optional[Ticker]) -> bool:
|
||||||
"""
|
"""
|
||||||
Check if pair has enough room to add a stoploss to avoid "unsellable" buys of very
|
Check if pair has enough room to add a stoploss to avoid "unsellable" buys of very
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ class PriceFilter(IPairList):
|
|||||||
|
|
||||||
return f"{self.name} - No price filters configured."
|
return f"{self.name} - No price filters configured."
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filter pairs by price."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ class ProducerPairList(IPairList):
|
|||||||
"""
|
"""
|
||||||
return f"{self.name} - {self._producer_name}"
|
return f"{self.name} - {self._producer_name}"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Get a pairlist from an upstream bot."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ class RemotePairList(IPairList):
|
|||||||
"""
|
"""
|
||||||
return f"{self.name} - {self._pairlistconfig['number_assets']} pairs from RemotePairlist."
|
return f"{self.name} - {self._pairlistconfig['number_assets']} pairs from RemotePairlist."
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Retrieve pairs from a remote API."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ class ShuffleFilter(IPairList):
|
|||||||
return (f"{self.name} - Shuffling pairs every {self._shuffle_freq}" +
|
return (f"{self.name} - Shuffling pairs every {self._shuffle_freq}" +
|
||||||
(f", seed = {self._seed}." if self._seed is not None else "."))
|
(f", seed = {self._seed}." if self._seed is not None else "."))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Randomize pairlist order."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ class SpreadFilter(IPairList):
|
|||||||
return (f"{self.name} - Filtering pairs with ask/bid diff above "
|
return (f"{self.name} - Filtering pairs with ask/bid diff above "
|
||||||
f"{self._max_spread_ratio:.2%}.")
|
f"{self._max_spread_ratio:.2%}.")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filter by bid/ask difference."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ class StaticPairList(IPairList):
|
|||||||
"""
|
"""
|
||||||
return f"{self.name}"
|
return f"{self.name}"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Use pairlist as configured in config."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ class VolatilityFilter(IPairList):
|
|||||||
f"{self._min_volatility}-{self._max_volatility} "
|
f"{self._min_volatility}-{self._max_volatility} "
|
||||||
f" the last {self._days} {plural(self._days, 'day')}.")
|
f" the last {self._days} {plural(self._days, 'day')}.")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filter pairs by their recent volatility."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -114,6 +114,10 @@ class VolumePairList(IPairList):
|
|||||||
"""
|
"""
|
||||||
return f"{self.name} - top {self._pairlistconfig['number_assets']} volume pairs."
|
return f"{self.name} - top {self._pairlistconfig['number_assets']} volume pairs."
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Provides dynamic pair list based on trade volumes."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ class RangeStabilityFilter(IPairList):
|
|||||||
f"{self._min_rate_of_change}{max_rate_desc} over the "
|
f"{self._min_rate_of_change}{max_rate_desc} over the "
|
||||||
f"last {plural(self._days, 'day')}.")
|
f"last {plural(self._days, 'day')}.")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def description() -> str:
|
||||||
|
return "Filters pairs by their rate of change."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def available_parameters() -> Dict[str, PairlistParameter]:
|
def available_parameters() -> Dict[str, PairlistParameter]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -404,6 +404,7 @@ class StrategyListResponse(BaseModel):
|
|||||||
|
|
||||||
class PairListResponse(BaseModel):
|
class PairListResponse(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
|
description: str
|
||||||
is_pairlist_generator: bool
|
is_pairlist_generator: bool
|
||||||
params: Dict[str, Any]
|
params: Dict[str, Any]
|
||||||
|
|
||||||
@@ -418,10 +419,6 @@ class PairListsPayload(BaseModel):
|
|||||||
stake_currency: str
|
stake_currency: str
|
||||||
|
|
||||||
|
|
||||||
class PairListsTest(BaseModel):
|
|
||||||
pairlists: List[PairListResponse]
|
|
||||||
|
|
||||||
|
|
||||||
class FreqAIModelListResponse(BaseModel):
|
class FreqAIModelListResponse(BaseModel):
|
||||||
freqaimodels: List[str]
|
freqaimodels: List[str]
|
||||||
|
|
||||||
|
|||||||
@@ -328,6 +328,7 @@ def list_pairlists(config=Depends(get_config)):
|
|||||||
"name": x['name'],
|
"name": x['name'],
|
||||||
"is_pairlist_generator": x['class'].is_pairlist_generator,
|
"is_pairlist_generator": x['class'].is_pairlist_generator,
|
||||||
"params": x['class'].available_parameters(),
|
"params": x['class'].available_parameters(),
|
||||||
|
"description": x['class'].description(),
|
||||||
} for x in pairlists
|
} for x in pairlists
|
||||||
]}
|
]}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user