From 57ba31c09cbd6028fb612c1468c89eb899fa367d Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Sun, 1 Aug 2021 21:56:46 -0600 Subject: [PATCH] changed __ varibles to _ to remove python3.10 warning --- freqtrade/enums/liqformula.py | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/freqtrade/enums/liqformula.py b/freqtrade/enums/liqformula.py index d65c5db38..0720fbd1e 100644 --- a/freqtrade/enums/liqformula.py +++ b/freqtrade/enums/liqformula.py @@ -15,7 +15,7 @@ class LiqFormula(Enum): FTX = "FTX" NONE = None - def __exception(self, trading_mode: TradingMode, freq_specific: Optional[bool] = True): + def _exception(self, trading_mode: TradingMode, freq_specific: Optional[bool] = True): """ Raises an exception if exchange used doesn't support desired leverage mode :param trading_mode: cross, isolated, cross_futures or isolated_futures @@ -29,45 +29,45 @@ class LiqFormula(Enum): else: raise OperationalException(f"{self.name} does not support {trading_mode.value} trading") - def __binance(self, trading_mode: TradingMode): + def _binance(self, trading_mode: TradingMode): # TODO-lev: Additional arguments, fill in formulas if trading_mode == TradingMode.CROSS_MARGIN: # TODO-lev: perform a calculation based on this formula # https://www.binance.com/en/support/faq/f6b010588e55413aa58b7d63ee0125ed - self.__exception(trading_mode) + self._exception(trading_mode) elif trading_mode == TradingMode.ISOLATED_MARGIN: - self.__exception(trading_mode) # Likely won't be implemented + self._exception(trading_mode) # Likely won't be implemented elif trading_mode == TradingMode.CROSS_FUTURES: # TODO-lev: perform a calculation based on this formula # https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93 - self.__exception(trading_mode) + self._exception(trading_mode) elif trading_mode == TradingMode.ISOLATED_FUTURES: # TODO-lev: perform a calculation based on this formula # https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93 - self.__exception(trading_mode) + self._exception(trading_mode) else: - self.__exception(trading_mode) + self._exception(trading_mode) - def __kraken(self, trading_mode: TradingMode): + def _kraken(self, trading_mode: TradingMode): # TODO-lev: Additional arguments, fill in formulas if trading_mode == TradingMode.CROSS_MARGIN: - self.__exception(trading_mode) + self._exception(trading_mode) # TODO-lev: perform a calculation based on this formula # https://support.kraken.com/hc/en-us/articles/203325763-Margin-Call-Level-and-Margin-Liquidation-Level elif trading_mode == TradingMode.CROSS_FUTURES: # TODO-lev: implement - self.__exception(trading_mode) + self._exception(trading_mode) elif trading_mode == TradingMode.ISOLATED_MARGIN or \ trading_mode == TradingMode.ISOLATED_FUTURES: - self.__exception(trading_mode, True) + self._exception(trading_mode, True) else: - self.__exception(trading_mode) + self._exception(trading_mode) - def __ftx(self, trading_mode: TradingMode): + def _ftx(self, trading_mode: TradingMode): # TODO-lev: Additional arguments, fill in formulas - self.__exception(trading_mode) + self._exception(trading_mode) def __call__(self, **k): @@ -77,10 +77,10 @@ class LiqFormula(Enum): return None if self.name == "BINANCE": - return self.__binance(trading_mode) + return self._binance(trading_mode) elif self.name == "KRAKEN": - return self.__kraken(trading_mode) + return self._kraken(trading_mode) elif self.name == "FTX": - return self.__ftx(trading_mode) + return self._ftx(trading_mode) else: - self.__exception(trading_mode) + self._exception(trading_mode)