Skip to content

Commit

Permalink
show unrealized profit percentage in 'all holdings' view
Browse files Browse the repository at this point in the history
  • Loading branch information
1ma authored and yagebu committed Sep 19, 2024
1 parent 78de554 commit cea3744
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/reports/holdings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ SELECT
first(getprice(currency, cost_currency)) as price,
cost(sum(position)) as book_value,
value(sum(position)) as market_value,
safediv((abs(sum(number(value(position)))) - abs(sum(number(cost(position))))), sum(number(cost(position)))) * 100 as unrealized_profit_pct,
cost_date as acquisition_date
WHERE account_sortkey(account) ~ "^[01]"
GROUP BY account, cost_date, currency, cost_currency, cost_number, account_sortkey(account)
Expand Down

0 comments on commit cea3744

Please sign in to comment.