Hacker News new | ask | show | jobs
by faustlast 283 days ago
I’ve been a long-time user of (h)ledger. I use a custom script to generate a cost basis when computing capital gains for selling transactions. Are there any recent updates or tools that improve cost-basis tracking or capital gains handling in hledger?
3 comments

When I had this need I put together https://src.d10.dev/lotter. It takes as input ledger-cli entries and puts out entries with lot info added, which you can then run through `ledger`. You can quickly scan its output and see if what it does makes sense to you.

The repo hasn't seen activity for a while, but AFAIK it still works. I just haven't needed it myself recently.

https://plaintextaccounting.org/Investing-and-trading summarises the current options, and https://joyful.com/hledger+lot+tracking has design notes, some of them recent.
I suspect you can do this with custom currencies and subaccounts