mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 00:23:07 +00:00
feat: have performance account for leverage correctly
This commit is contained in:
@@ -1939,8 +1939,11 @@ class Trade(ModelBase, LocalTrade):
|
||||
select(
|
||||
Trade.pair,
|
||||
func.sum(
|
||||
func.coalesce(Order.filled, Order.amount)
|
||||
* func.coalesce(Order.average, Order.price, Order.ft_price)
|
||||
(
|
||||
func.coalesce(Order.filled, Order.amount)
|
||||
* func.coalesce(Order.average, Order.price, Order.ft_price)
|
||||
)
|
||||
/ func.coalesce(Trade.leverage, 1)
|
||||
).label("cost_per_pair"),
|
||||
)
|
||||
.join(Order, Trade.id == Order.ft_trade_id)
|
||||
|
||||
Reference in New Issue
Block a user