set leverage more thorough tests

This commit is contained in:
Sam Germain
2021-09-12 03:09:51 -06:00
parent ad44048e29
commit e070bdd161
6 changed files with 64 additions and 10 deletions

View File

@@ -156,8 +156,8 @@ class Binance(Exchange):
def _set_leverage(
self,
leverage: float,
pair: Optional[str],
trading_mode: Optional[TradingMode]
pair: Optional[str] = None,
trading_mode: Optional[TradingMode] = None
):
"""
Set's the leverage before making a trade, in order to not

View File

@@ -1605,8 +1605,8 @@ class Exchange:
def _set_leverage(
self,
leverage: float,
pair: Optional[str],
trading_mode: Optional[TradingMode]
pair: Optional[str] = None,
trading_mode: Optional[TradingMode] = None
):
"""
Set's the leverage before making a trade, in order to not

View File

@@ -175,8 +175,8 @@ class Kraken(Exchange):
def _set_leverage(
self,
leverage: float,
pair: Optional[str],
trading_mode: Optional[TradingMode]
pair: Optional[str] = None,
trading_mode: Optional[TradingMode] = None
):
"""
Kraken set's the leverage as an option in the order object, so we need to
@@ -185,4 +185,5 @@ class Kraken(Exchange):
if leverage > 1.0:
self._params['leverage'] = leverage
else:
del self._params['leverage']
if 'leverage' in self._params:
del self._params['leverage']