Properly respect can_short flag in backtesting

closes  #8387
This commit is contained in:
Matthias 2023-03-26 17:27:52 +02:00
parent c14ac8a205
commit 1c9abd9e35

View File

@ -203,6 +203,8 @@ class Backtesting:
# since a "perfect" stoploss-exit is assumed anyway
# And the regular "stoploss" function would not apply to that case
self.strategy.order_types['stoploss_on_exchange'] = False
# Update can_short flag
self._can_short = self.trading_mode != TradingMode.SPOT and strategy.can_short
self.strategy.ft_bot_start()