Add trading-volume to api schema
This commit is contained in:
@@ -1363,8 +1363,7 @@ class Trade(_DECL_BASE, LocalTrade):
|
||||
trading_volume = Order.query.with_entities(
|
||||
func.sum(Order.cost).label('volume')
|
||||
).filter(
|
||||
(Order.order_filled_date >= start_date)
|
||||
& (Order.status == 'closed')
|
||||
) \
|
||||
.scalar()
|
||||
Order.order_filled_date >= start_date,
|
||||
Order.status == 'closed'
|
||||
).scalar()
|
||||
return trading_volume
|
||||
|
@@ -107,6 +107,7 @@ class Profit(BaseModel):
|
||||
profit_factor: float
|
||||
max_drawdown: float
|
||||
max_drawdown_abs: float
|
||||
trading_volume: Optional[float]
|
||||
|
||||
|
||||
class SellReason(BaseModel):
|
||||
|
Reference in New Issue
Block a user