fix: only consider filled orders

This commit is contained in:
Matthias
2025-01-26 20:07:00 +01:00
parent b01de10ab2
commit f9d4d38523

View File

@@ -1934,6 +1934,7 @@ class Trade(ModelBase, LocalTrade):
.filter(
*filters,
Order.ft_order_side == case((Trade.is_short.is_(True), "sell"), else_="buy"),
Order.filled > 0,
)
.group_by(*columns)
.cte("pair_costs")