Extract Closed profit calculation to trade object

This commit is contained in:
Matthias
2021-07-10 12:18:55 +02:00
parent ed77889d6b
commit b41c234440
3 changed files with 30 additions and 3 deletions

View File

@@ -70,9 +70,7 @@ class Wallets:
# If not backtesting...
# 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 if trade.close_profit_abs])
tot_profit = Trade.get_total_closed_profit()
else:
tot_profit = LocalTrade.total_profit
tot_in_trades = sum([trade.stake_amount for trade in open_trades])