Open alensiljak opened 5 years ago
Actually, this does exist in ledger since the later 3.1.x versions.
> ledger b assets and xyz --average-lot-prices
1046 XYZ {2.775 AUD} Assets:Investments:Shares:XYZ
The average lot price is shown is curly brackets.
Ref: #1015
Something that
does not exist out-of-the-box in Ledger butwould be very convenient. After implementing the lots feature, and pricing in another commodity (-X), this should be trivial as the value is already "there somewhere". It would need to be output with an appropriate switch.Effectively, given the data https://gitlab.com/snippets/1856416 one should be able to get an average cost of the commodity in another commodity (currency).
In practice, this means that I want to know that,
This shows the average cost/price per unit for the available lots. The total value is available after
--unrealized
implementation.Test case
command
b --lots --flat
resultThe remaining 4 ETF lot is from the lot [2019-01-15] and its avg. cost (= original cost in this case) is 12 EUR.
A more complex case would be appropriate for this, to show the average of multiple lots involved.