From 1c9abd9e3579097bb6c3c323e2d765afe551f351 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 26 Mar 2023 17:27:52 +0200 Subject: [PATCH] Properly respect can_short flag in backtesting closes #8387 --- freqtrade/optimize/backtesting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 31e133515..a701b04e4 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -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()