From e66611c96540a9f3d36c993952e4d11f6ec1e4b1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 25 Dec 2024 17:53:12 +0100 Subject: [PATCH] chore: fix 2 minor potential bugs --- freqtrade/rpc/rpc.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 96b5620d0..67edd3924 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -301,7 +301,7 @@ class RPC: # Format profit as a string with the right sign profit = f"{trade['profit_ratio']:.2%}" fiat_profit = trade.get("profit_fiat", None) - if isnan(fiat_profit): + if fiat_profit is None or isnan(fiat_profit): fiat_profit: float = trade.get("profit_abs", 0.0) if not isnan(fiat_profit): profit += f" ({fiat_profit:.2f})" @@ -314,11 +314,9 @@ class RPC: orders = trade.get("orders", []) if orders: active_order_side = ".".join( - "*" - if (o.get("ft_is_open") and o.get("ft_order_side") == trade.get("entry_side")) - else "**" + "*" if (o.get("is_open") and o.get("ft_is_entry")) else "**" for o in orders - if o.get("ft_is_open") + if o.get("is_open") ) # Direction string for non-spot