From 2461d86c8d2d0dd692edfabf4fd79162eb87fbd4 Mon Sep 17 00:00:00 2001 From: misagh Date: Thu, 22 Nov 2018 17:24:45 +0100 Subject: [PATCH] dry run should consider stop loss is hit on limit price --- freqtrade/freqtradebot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index ac9fd758c..281b22bc5 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -805,6 +805,11 @@ class FreqtradeBot(object): if self.strategy.stoploss_on_exchange and trade.stoploss_order_id: self.exchange.cancel_order(trade.stoploss_order_id, trade.pair) + # Dry-run should consider stoploss is executed at the limit price + # So overriding limit in case of dry-run + if self.config['dry_run']: + limit = trade.stop_loss + # Execute sell and update trade record order_id = self.exchange.sell(pair=str(trade.pair), ordertype=self.strategy.order_types[sell_type],