Add option pairlist parameter type

This commit is contained in:
Matthias
2023-04-21 19:30:32 +02:00
parent c5bf029701
commit 3d4be92cc6
3 changed files with 11 additions and 2 deletions

View File

@@ -31,6 +31,12 @@ class __StringPairlistParameter(__PairlistParameterBase):
default: Union[str, None]
class __OptionPairlistParameter(__PairlistParameterBase):
type: Literal["option"]
default: Union[str, None]
options: List[str]
class __BoolPairlistParameter(__PairlistParameterBase):
type: Literal["boolean"]
default: Union[bool, None]
@@ -39,6 +45,7 @@ class __BoolPairlistParameter(__PairlistParameterBase):
PairlistParameter = Union[
__NumberPairlistParameter,
__StringPairlistParameter,
__OptionPairlistParameter,
__BoolPairlistParameter
]

View File

@@ -59,8 +59,9 @@ class ShuffleFilter(IPairList):
def available_parameters() -> Dict[str, PairlistParameter]:
return {
"shuffle_frequency": {
"type": "string",
"type": "option",
"default": "candle",
"options": ["candle", "iteration"],
"description": "Shuffle frequency",
"help": "Shuffle frequency. Can be either 'candle' or 'iteration'.",
},

View File

@@ -123,8 +123,9 @@ class VolumePairList(IPairList):
"help": "Number of assets to use from the pairlist",
},
"sort_key": {
"type": "string",
"type": "option",
"default": "quoteVolume",
"options": SORT_VALUES,
"description": "Sort key",
"help": "Sort key to use for sorting the pairlist.",
},