What is the best way to connect dividend posting with the stock that pays it ?

117 views
Skip to first unread message

timoth...@gmail.com

unread,
Sep 29, 2019, 8:45:55 AM9/29/19
to Beancount
Hi !

I am thinking about how to track my dividend payments in order to compute the ROI of a specific stock.
Currently a dividend is simply a trasaction from Income:Dividend to Assets:TradingAcount:Cash , and nothing connects it to the stock that paid this dividend.

What would be the best practice to achieve this connection ? Link ? Hashtag ? something else ?

Martin Blais

unread,
Sep 29, 2019, 9:19:12 AM9/29/19
to Beancount
I put the stock symbol in the account name.
Another way is to put it in metadata on the posting (or transaction,
if always dedicated to the stock).

There's no best practice.
So far there isn't much support for computing returns.
I once had a good go at attempting to automate this for the whole set
of accounts at once, and it got a little tricky.
Cadavers of that experience lie here now:
https://bitbucket.org/blais/beancount/src/tip/experiments/returns/

I haven't had time to get back to it, but I'd like to revisit this,
with more modest aims:
- IRR only, not caring about cash-adjusted returns
- Computing a set of cash flows for each (account, commodity) separately
- Then, building something on top of that which can combine the
time-series together
> --
> 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/98d7be53-94b2-40d2-9c00-1ba8eb32a44d%40googlegroups.com.

timoth...@gmail.com

unread,
Sep 29, 2019, 1:06:58 PM9/29/19
to Beancount
When you say : "I put the symbol in the accoutn name". Does this means that you have a seperate income:Dividend account per stock ?

Adam Gibbins

unread,
Sep 29, 2019, 4:12:02 PM9/29/19
to bean...@googlegroups.com
Yes, exactly. e.g. Expenses:Dividend:AAPL
That way you know where it came from, yet you can still get the overall dividends by looking at Expenses:Dividend for tax reporting and the like.

Martin Blais

unread,
Sep 29, 2019, 9:29:48 PM9/29/19
to Beancount
That's one way to do it.
You can use metadata on the posting.
Or if you always have a dedicated transaction for every such event, on
the transaction object itself.

At the end of the day, you're going to select a subset of these
postings somehow, and run some aggregation on them.
You just need a way to identify which stock they're from.




On Sun, Sep 29, 2019 at 1:07 PM <timoth...@gmail.com> wrote:
>
> When you say : "I put the symbol in the accoutn name". Does this means that you have a seperate income:Dividend account per stock ?
>
> --
> 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/bf8e0569-9c44-4350-af61-e8f8388d8ba3%40googlegroups.com.

Justus Pendleton

unread,
Sep 30, 2019, 12:25:07 AM9/30/19
to Beancount
On Monday, September 30, 2019 at 12:06:58 AM UTC+7, timoth...@gmail.com wrote:
When you say : "I put the symbol in the accoutn name". Does this means that you have a seperate income:Dividend account per stock ?

Keep in mind that you are, quite literally, getting paid from a different payee -- it is a bit like an Account Receivable and people often set up separate sub-accounts to handle that.

That said, at the end of the day it depends on what reporting you want/need to generate. Ultimately that's what is going to drive your account structure. My general feeling is that tags are more flexible, so those are generally a better default choice. You can have multiple tags but you can't have multiple account hierarchies. (Of course, you lose out on the whole hierarchical aggregation with tags, so it isn't exactly an open-and-shut case in favor of tags.)

What if you hold VTSAX in taxable, tax-deferred (401k), *and* tax-free (Roth IRA)? Do you create:

Income:Dividends:Taxable:VTSAX
Income:Dividends:TaxDeferred:VTSAX
Income:Dividends:TaxFree:VTSAX

What if I just want a list of my taxable dividends (for tax filing purposes)? Clearly, I need to ignore the other two VTSAX. But what if I then want a list of all VTSAX dividends? How do I aggregate the three different account hierarchies?

Martin Blais

unread,
Oct 1, 2019, 12:37:41 AM10/1/19
to Beancount
Use a regexp: Income:Dividends:.*:VTSAX
Either from SQL or from a Python program.

At the EOTD, all that Beancount does is ensure the double-entry
balancing rule on input, then denormalize your transactions to create
a single very long table of postings, and allow you to select
subgroups of these postings and aggregate them using the (only
slightly) special aggregation algorithm in its "Inventory" container.
How you select the subsets of postings is really up to you. Hierarchy
is useful, but by no means the only way to select groups of postings.




>
> --
> 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/2550bff0-b22f-4123-906d-769b7868902b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages