exchange.create_order removed default for leverage
This commit is contained in:
@@ -909,11 +909,10 @@ class Exchange:
|
||||
side: str,
|
||||
amount: float,
|
||||
rate: float,
|
||||
leverage: float,
|
||||
reduceOnly: bool = False,
|
||||
leverage: float = 1.0,
|
||||
time_in_force: str = 'gtc',
|
||||
) -> Dict:
|
||||
# TODO-lev: remove default for leverage
|
||||
if self._config['dry_run']:
|
||||
dry_order = self.create_dry_run_order(pair, ordertype, side, amount, rate, leverage)
|
||||
return dry_order
|
||||
|
@@ -1423,6 +1423,7 @@ class FreqtradeBot(LoggingMixin):
|
||||
side=trade.exit_side,
|
||||
amount=amount,
|
||||
rate=limit,
|
||||
leverage=trade.leverage,
|
||||
reduceOnly=self.trading_mode == TradingMode.FUTURES,
|
||||
time_in_force=time_in_force
|
||||
)
|
||||
|
@@ -569,7 +569,7 @@ class LocalTrade():
|
||||
payment = "BUY" if self.is_short else "SELL"
|
||||
# * On margin shorts, you buy a little bit more than the amount (amount + interest)
|
||||
logger.info(f'{order_type.upper()}_{payment} has been fulfilled for {self}.')
|
||||
# TODO-lev: Double check this
|
||||
# TODO-lev: Is anything else needed here?
|
||||
self.close(safe_value_fallback(order, 'average', 'price'))
|
||||
elif order_type in ('stop_loss_limit', 'stop-loss', 'stop-loss-limit', 'stop'):
|
||||
self.stoploss_order_id = None
|
||||
|
Reference in New Issue
Block a user