Fix small bug with /daily if close_profit_abs is not yet filled
This commit is contained in:
parent
10c5b230b4
commit
5c5cf782f5
@ -224,7 +224,8 @@ class RPC:
|
|||||||
Trade.close_date >= profitday,
|
Trade.close_date >= profitday,
|
||||||
Trade.close_date < (profitday + timedelta(days=1))
|
Trade.close_date < (profitday + timedelta(days=1))
|
||||||
]).order_by(Trade.close_date).all()
|
]).order_by(Trade.close_date).all()
|
||||||
curdayprofit = sum(trade.close_profit_abs for trade in trades)
|
curdayprofit = sum(
|
||||||
|
trade.close_profit_abs for trade in trades if trade.close_profit_abs is not None)
|
||||||
profit_days[profitday] = {
|
profit_days[profitday] = {
|
||||||
'amount': curdayprofit,
|
'amount': curdayprofit,
|
||||||
'trades': len(trades)
|
'trades': len(trades)
|
||||||
|
Loading…
Reference in New Issue
Block a user