From f96f0cdea7b665435240c4bef07a9f01ba31f425 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 30 Oct 2018 20:02:31 +0100 Subject: [PATCH] Add additional comment --- freqtrade/optimize/backtesting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 9678b6d09..b5c883d4f 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -208,7 +208,9 @@ class Backtesting(object): sell = self.strategy.should_sell(trade, sell_row.open, sell_row.date, buy_signal, sell_row.sell, low=sell_row.low, high=sell_row.high) if sell.sell_flag: + trade_dur = int((sell_row.date - buy_row.date).total_seconds() // 60) + # Special handling if high or low hit STOP_LOSS or ROI if sell.sell_type in (SellType.STOP_LOSS, SellType.TRAILING_STOP_LOSS): # Set close_rate to stoploss closerate = trade.stop_loss