Add "defaultCandletype"
This commit is contained in:
@@ -12,9 +12,16 @@ class CandleType(str, Enum):
|
||||
# TODO-lev: not sure this belongs here, as the datatype is really different
|
||||
FUNDING_RATE = "funding_rate"
|
||||
|
||||
@classmethod
|
||||
def from_string(cls, value: str) -> 'CandleType':
|
||||
@staticmethod
|
||||
def from_string(value: str) -> 'CandleType':
|
||||
if not value:
|
||||
# Default to spot
|
||||
return CandleType.SPOT_
|
||||
return CandleType(value)
|
||||
|
||||
@staticmethod
|
||||
def get_default(trading_mode: str) -> 'CandleType':
|
||||
if trading_mode == 'futures':
|
||||
return CandleType.FUTURES
|
||||
# TODO-lev: The below should be SPOT, not SPOT_
|
||||
return CandleType.SPOT_
|
||||
|
Reference in New Issue
Block a user