Skip to content

Commit

Permalink
feat: have performance account for leverage correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Jan 19, 2025
1 parent 1e2450d commit 141286a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions freqtrade/persistence/trade_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1939,8 +1939,11 @@ def get_overall_performance(minutes=None) -> list[dict[str, Any]]:
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)
Expand Down

0 comments on commit 141286a

Please sign in to comment.