Remove calc_close_profit from RPC

This is now possible - but only for closed trades, so certain occurances
need to remain.
This commit is contained in:
Matthias 2020-03-22 11:28:18 +01:00
parent 2c434e9b11
commit f14c496ce9

View File

@ -197,7 +197,7 @@ class RPC:
Trade.close_date >= profitday,
Trade.close_date < (profitday + timedelta(days=1))
]).order_by(Trade.close_date).all()
curdayprofit = sum(trade.calc_profit() for trade in trades)
curdayprofit = sum(trade.close_profit_abs for trade in trades)
profit_days[profitday] = {
'amount': f'{curdayprofit:.8f}',
'trades': len(trades)
@ -246,8 +246,8 @@ class RPC:
durations.append((trade.close_date - trade.open_date).total_seconds())
if not trade.is_open:
profit_ratio = trade.calc_profit_ratio()
profit_closed_coin.append(trade.calc_profit())
profit_ratio = trade.close_profit
profit_closed_coin.append(trade.close_profit_abs)
profit_closed_ratio.append(profit_ratio)
else:
# Get current rate