Changed TODO-mg to TODO-lev
This commit is contained in:
parent
d80db3c4db
commit
9c8acd98c4
@ -29,34 +29,34 @@ class LiqFormula(Enum):
|
|||||||
raise OperationalException(f"{self.name} does not support {trading_mode.value} trading")
|
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-mg: Additional arguments, fill in formulas
|
# TODO-lev: Additional arguments, fill in formulas
|
||||||
|
|
||||||
if trading_mode == TradingMode.CROSS_MARGIN:
|
if trading_mode == TradingMode.CROSS_MARGIN:
|
||||||
# TODO-mg: perform a calculation based on this formula
|
# TODO-lev: perform a calculation based on this formula
|
||||||
# https://www.binance.com/en/support/faq/f6b010588e55413aa58b7d63ee0125ed
|
# https://www.binance.com/en/support/faq/f6b010588e55413aa58b7d63ee0125ed
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
elif trading_mode == TradingMode.ISOLATED_MARGIN:
|
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:
|
elif trading_mode == TradingMode.CROSS_FUTURES:
|
||||||
# TODO-mg: perform a calculation based on this formula
|
# TODO-lev: perform a calculation based on this formula
|
||||||
# https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93
|
# https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
elif trading_mode == TradingMode.ISOLATED_FUTURES:
|
elif trading_mode == TradingMode.ISOLATED_FUTURES:
|
||||||
# TODO-mg: perform a calculation based on this formula
|
# TODO-lev: perform a calculation based on this formula
|
||||||
# https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93
|
# https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
else:
|
else:
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
|
|
||||||
def __kraken(self, trading_mode: TradingMode):
|
def __kraken(self, trading_mode: TradingMode):
|
||||||
# TODO-mg: Additional arguments, fill in formulas
|
# TODO-lev: Additional arguments, fill in formulas
|
||||||
|
|
||||||
if trading_mode == TradingMode.CROSS_MARGIN:
|
if trading_mode == TradingMode.CROSS_MARGIN:
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
# TODO-mg: perform a calculation based on this formula
|
# 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
|
# https://support.kraken.com/hc/en-us/articles/203325763-Margin-Call-Level-and-Margin-Liquidation-Level
|
||||||
elif trading_mode == TradingMode.CROSS_FUTURES:
|
elif trading_mode == TradingMode.CROSS_FUTURES:
|
||||||
# TODO-mg: implement
|
# TODO-lev: implement
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
elif trading_mode == TradingMode.ISOLATED_MARGIN or \
|
elif trading_mode == TradingMode.ISOLATED_MARGIN or \
|
||||||
trading_mode == TradingMode.ISOLATED_FUTURES:
|
trading_mode == TradingMode.ISOLATED_FUTURES:
|
||||||
@ -65,7 +65,7 @@ class LiqFormula(Enum):
|
|||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
|
|
||||||
def __ftx(self, trading_mode: TradingMode):
|
def __ftx(self, trading_mode: TradingMode):
|
||||||
# TODO-mg: Additional arguments, fill in formulas
|
# TODO-lev: Additional arguments, fill in formulas
|
||||||
self.__exception(trading_mode)
|
self.__exception(trading_mode)
|
||||||
|
|
||||||
def __call__(self, **k):
|
def __call__(self, **k):
|
||||||
|
@ -14,7 +14,7 @@ def test_liquidation_formula():
|
|||||||
assert LiqFormula.BINANCE(
|
assert LiqFormula.BINANCE(
|
||||||
trading_mode=spot
|
trading_mode=spot
|
||||||
) is None
|
) is None
|
||||||
# TODO-mg: Uncomment these assertions and make them real calculation tests
|
# TODO-lev: Uncomment these assertions and make them real calculation tests
|
||||||
# assert LiqFormula.BINANCE(
|
# assert LiqFormula.BINANCE(
|
||||||
# trading_mode=cross_margin
|
# trading_mode=cross_margin
|
||||||
# ) == 1.0 #Replace 1.0 with real value
|
# ) == 1.0 #Replace 1.0 with real value
|
||||||
@ -31,26 +31,26 @@ def test_liquidation_formula():
|
|||||||
assert LiqFormula.KRAKEN(
|
assert LiqFormula.KRAKEN(
|
||||||
trading_mode=spot
|
trading_mode=spot
|
||||||
) is None
|
) is None
|
||||||
# TODO-mg: Uncomment these assertions and make them real calculation tests
|
# TODO-lev: Uncomment these assertions and make them real calculation tests
|
||||||
# assert LiqFormula.KRAKEN(
|
# assert LiqFormula.KRAKEN(
|
||||||
# trading_mode=cross_margin
|
# trading_mode=cross_margin
|
||||||
# ) == 1.0
|
# ) == 1.0
|
||||||
# LiqFormula.KRAKEN(
|
# LiqFormula.KRAKEN(
|
||||||
# trading_mode=isolated_margin
|
# trading_mode=isolated_margin
|
||||||
# )
|
# )
|
||||||
# asset exception thrown #TODO-mg: Check that exception is thrown
|
# asset exception thrown #TODO-lev: Check that exception is thrown
|
||||||
# assert LiqFormula.KRAKEN(
|
# assert LiqFormula.KRAKEN(
|
||||||
# trading_mode=cross_futures
|
# trading_mode=cross_futures
|
||||||
# ) == 1.0
|
# ) == 1.0
|
||||||
# LiqFormula.KRAKEN(
|
# LiqFormula.KRAKEN(
|
||||||
# trading_mode=isolated_futures
|
# trading_mode=isolated_futures
|
||||||
# )
|
# )
|
||||||
# asset exception thrown #TODO-mg: Check that exception is thrown
|
# asset exception thrown #TODO-lev: Check that exception is thrown
|
||||||
|
|
||||||
assert LiqFormula.FTX(
|
assert LiqFormula.FTX(
|
||||||
trading_mode=spot
|
trading_mode=spot
|
||||||
) is None
|
) is None
|
||||||
# TODO-mg: Uncomment these assertions and make them real calculation tests
|
# TODO-lev: Uncomment these assertions and make them real calculation tests
|
||||||
# assert LiqFormula.FTX(
|
# assert LiqFormula.FTX(
|
||||||
# trading_mode=cross_margin
|
# trading_mode=cross_margin
|
||||||
# ) == 1.0
|
# ) == 1.0
|
||||||
|
Loading…
Reference in New Issue
Block a user