Improve NAN Handling in RPC

This commit is contained in:
Matthias 2022-08-11 20:16:07 +02:00
parent de690b0a69
commit cc885e25ac
1 changed files with 4 additions and 2 deletions

View File

@ -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: