Capital Gains Report

87 views
Skip to first unread message

Alok Parlikar

unread,
Jan 3, 2021, 9:58:46 AM1/3/21
to Beancount
Hi,

For a subtree of accounts (say, Assets:Investments) I need to generate details of capital gains calculation, e.g.

units_sold | acquisition_date | cost | sale_date | price | gains

I'm using the FIFO booking method.

I was considering writing a script to do this, but also wondering if there would be a simpler approach -- would bean-report or bean-query support this?

Thanks
Alok

Cheng Zhen

unread,
Jan 3, 2021, 10:11:19 AM1/3/21
to bean...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/882062a3-f927-4a80-a82d-d14cdc683729n%40googlegroups.com.

Martin Blais

unread,
Jan 3, 2021, 5:14:26 PM1/3/21
to Beancount
The right thing to do is to have the reduction code log matching ids on the augmenting and reducing lots, so that a single pass over the entries can then gather all the trades (combinations of augmenting and reducing lots) from any subset of transactions. I've been getting by on custom scripts so far, and it's something I *really* want, and had a go at it one evening a few months ago (https://github.com/beancount/beancount/tree/trade_quick_experiment), but as always, the devil rears its ugly head when we get to the details and this requires more than just a bit of hacking.

v3 will *for sure* have this built in and it'll be clean. For now, you'll have to write a script to pull together your trade data.



--

Alok Parlikar

unread,
Jan 3, 2021, 7:23:08 PM1/3/21
to bean...@googlegroups.com
Thank you, Martin! 

You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/VBfTDh5HlB4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhPpu33hUSLZpeMxUG%2BsL4yQ_H9rNGQof2cxtFBB%2BSqZWQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages