don't use "can_short" in backtesting to determine application of leverage

This commit is contained in:
Matthias
2023-03-26 16:17:10 +02:00
parent fb1541bdf6
commit b09fb5826f
3 changed files with 7 additions and 4 deletions

View File

@@ -739,7 +739,7 @@ class Backtesting:
proposed_leverage=1.0,
max_leverage=max_leverage,
side=direction, entry_tag=entry_tag,
) if self._can_short else 1.0
) if self.trading_mode != TradingMode.SPOT else 1.0
# Cap leverage between 1.0 and max_leverage.
leverage = min(max(leverage, 1.0), max_leverage)