From cc885e25ac048cba4df69b8a2bd8787d728dd69d Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 11 Aug 2022 20:16:07 +0200 Subject: [PATCH] Improve NAN Handling in RPC --- freqtrade/rpc/rpc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index ede8a9d3c..ed7f13a96 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -179,8 +179,10 @@ class RPC: else: current_rate = trade.close_rate if len(trade.select_filled_orders(trade.entry_side)) > 0: - current_profit = trade.calc_profit_ratio(current_rate) - current_profit_abs = trade.calc_profit(current_rate) + current_profit = trade.calc_profit_ratio( + current_rate) if not isnan(current_rate) else NAN + current_profit_abs = trade.calc_profit( + current_rate) if not isnan(current_rate) else NAN current_profit_fiat: Optional[float] = None # Calculate fiat profit if self._fiat_converter: