Add check to ensure close_profit_abs is filled on closed trades
Technically, this should not be possible, but #4554 shows it is. closes #4554
This commit is contained in:
@@ -71,7 +71,8 @@ class Wallets:
|
||||
# TODO: potentially remove the ._log workaround to determine backtest mode.
|
||||
if self._log:
|
||||
closed_trades = Trade.get_trades_proxy(is_open=False)
|
||||
tot_profit = sum([trade.close_profit_abs for trade in closed_trades])
|
||||
tot_profit = sum(
|
||||
[trade.close_profit_abs for trade in closed_trades if trade.close_profit_abs])
|
||||
else:
|
||||
tot_profit = LocalTrade.total_profit
|
||||
tot_in_trades = sum([trade.stake_amount for trade in open_trades])
|
||||
|
Reference in New Issue
Block a user