From d2608cbf13a05020d52e94638a322e486434cc61 Mon Sep 17 00:00:00 2001 From: Matthias Voppichler Date: Mon, 23 Apr 2018 20:06:00 +0200 Subject: [PATCH] improve check when not to run --- freqtrade/freqtradebot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 7359aa580..c7094b332 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -365,10 +365,10 @@ class FreqtradeBot(object): # Update trade with order values logger.info('Found open order for %s', trade) order = exchange.get_order(trade.open_order_id, trade.pair) - # TODO: correct place here ?? # Try update amount (binance-fix) try: - if trade.fee_open != 0: + # Only run for closed trades + if trade.fee_open != 0 and not (order['status'] == 'open' or order['price'] is None): new_amount = self.get_real_amount(trade) # This may break if a exchange applies no fee (which appears highly unlikely) if order['amount'] != new_amount: