From 3eb2981fb4253c26699179fa59e011b96cdf664e Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 5 Nov 2024 20:45:58 +0100 Subject: [PATCH] chore: add explaining comment for "not fill" branch --- freqtrade/freqtradebot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 21ac61d9c..6e37442c1 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1198,6 +1198,8 @@ class FreqtradeBot(LoggingMixin): ) stake_amount = trade.stake_amount if not fill: + # If we have open orders, we need to add the stake amount of the open orders + # as it's not yet included in the trade.stake_amount stake_amount += sum( o.stake_amount for o in trade.open_orders if o.ft_order_side == trade.entry_side )