mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Update typing to account for correctly typed sqlalchemy responses
This commit is contained in:
parent
34c1838566
commit
962417bdea
|
@ -1637,7 +1637,7 @@ class Trade(ModelBase, LocalTrade):
|
|||
Retrieves total realized profit
|
||||
"""
|
||||
if Trade.use_db:
|
||||
total_profit: float = Trade.session.execute(
|
||||
total_profit = Trade.session.execute(
|
||||
select(func.sum(Trade.close_profit_abs)).filter(Trade.is_open.is_(False))
|
||||
).scalar_one()
|
||||
else:
|
||||
|
@ -1845,4 +1845,4 @@ class Trade(ModelBase, LocalTrade):
|
|||
Order.order_filled_date >= start_date,
|
||||
Order.status == 'closed'
|
||||
)).scalar_one()
|
||||
return trading_volume
|
||||
return trading_volume or 0.0
|
||||
|
|
Loading…
Reference in New Issue
Block a user