mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Improve pairlistparam types
This commit is contained in:
parent
2ea157d9d3
commit
4636de30cd
|
@ -16,13 +16,33 @@ from freqtrade.mixins import LoggingMixin
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PairlistParameter(TypedDict):
|
||||
type: Literal["number", "string", "boolean"]
|
||||
default: Union[int, float, str, bool, None]
|
||||
class __PairlistParameterBase(TypedDict):
|
||||
description: str
|
||||
help: str
|
||||
|
||||
|
||||
class __NumberPairlistParameter(__PairlistParameterBase):
|
||||
type: Literal["number"]
|
||||
default: Union[int, float, None]
|
||||
|
||||
|
||||
class __StringPairlistParameter(__PairlistParameterBase):
|
||||
type: Literal["string"]
|
||||
default: Union[str, None]
|
||||
|
||||
|
||||
class __BoolPairlistParameter(__PairlistParameterBase):
|
||||
type: Literal["boolean"]
|
||||
default: Union[bool, None]
|
||||
|
||||
|
||||
PairlistParameter = Union[
|
||||
__NumberPairlistParameter,
|
||||
__StringPairlistParameter,
|
||||
__BoolPairlistParameter
|
||||
]
|
||||
|
||||
|
||||
class IPairList(LoggingMixin, ABC):
|
||||
|
||||
def __init__(self, exchange: Exchange, pairlistmanager,
|
||||
|
|
Loading…
Reference in New Issue
Block a user