From fd211166f067ab990ff0298e5616dfc673eb2e3c Mon Sep 17 00:00:00 2001 From: adriance Date: Tue, 15 Mar 2022 12:23:59 +0800 Subject: [PATCH] fixed side error --- freqtrade/optimize/backtesting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index ba6aab71e..c597c6748 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -392,8 +392,8 @@ class Backtesting: ): # Worst case: price reaches stop_positive_offset and dives down. stop_rate = (sell_row[OPEN_IDX] * - (1 + side_1 * abs(self.strategy.trailing_stop_positive_offset) + - abs(self.strategy.trailing_stop_positive / leverage))) + (1 + side_1 * abs(self.strategy.trailing_stop_positive_offset) - + side_1 * abs(self.strategy.trailing_stop_positive / leverage))) else: # Worst case: price ticks tiny bit above open and dives down. stop_rate = sell_row[OPEN_IDX] * (1 -