Tracking a non-transparent investment account

225 views
Skip to first unread message

john8...@gmail.com

unread,
Sep 29, 2017, 10:31:46 AM9/29/17
to Beancount
First of all, thank you for this excellent project.

I have a retirement account to which my company and myself contribute with every paycheck. There is little control over investments in this account. One can choose a generic asset allocation from a pre-defined list, and contributions are automatically invested. There are no shares or prices, only a balance that fluctuates due to contributions and investment profit and loss.

Due to the lack of transparency in this account I'm not quite sure how to track it. A naive way might be to track the balance of the account using its base currency, adjusting the balance according to periodic statements:

2017-01-01 open Assets:Bank:Checking  USD
2017-01-01 open Assets:Bank:IRA       USD
2017-01-01 open Income:Bank:IRA:PnL   USD
2017-01-01 open Income:Company:Salary USD
2017-01-01 open Income:Company:IRA    USD

2017-01-01 * "Payroll"
 
Assets:Bank:Checking               900.00 USD
 
Income:Company:Salary             -900.00 USD
 
Assets:Bank:IRA                    100.00 USD
 
Income:Company:IRA                -100.00 USD

; Adjust IRA balance according to quarterly statement
2017-03-31 pad Assets:Bank:IRA Income:Bank:IRA:PnL
2017-04-01 balance Assets:Bank:IRA   110.00 USD

As far as I can tell this method would be sufficient for my current needs (tracking the account's balance, profit and loss). However, I wonder if there's a better way to track this sort of account?

john8...@gmail.com

unread,
Sep 29, 2017, 6:13:03 PM9/29/17
to Beancount
After some further thinking about the example above, fluctuations in value are probably better defined as unrealized gains/losses rather than income. Perhaps an "Unrealized" subaccount is a better fit (like the plugin adds). Still, I wonder whether that is the right direction at all.

Martin Blais

unread,
Sep 29, 2017, 8:41:14 PM9/29/17
to Beancount
On Fri, Sep 29, 2017 at 10:31 AM, <john8...@gmail.com> wrote:
First of all, thank you for this excellent project.

Thanks John.
I wouldn't do it this way, as this realizes the P/L.

I think the way I'd handle this situation is by using a fake commodity for shares.  In order to compute the price of this synthetic commodity, I'd just work back the price of this commodity by looking at your reported account balance against how much cash you put in it (the cost basis). At any point in time, Beancount allows you to compute the cost basis and the broker provides the current market value. The price of those "shares", at that time, is market value / cost basis, and you would input that in when you want data points. When you make a contribution, ideally you would compute the price at that point in time and divide the cash by that price, in order to adjust the number of shares.  It's a little bit backwards, but at least it would allow you to compute returns.

john8...@gmail.com

unread,
Sep 30, 2017, 7:01:23 AM9/30/17
to Beancount
Hi Martin, thank you very much for your response.

Although I'm familiar with the individual terms & concepts (read the vast majority of the
project's documentation), I haven't been able to put the pieces of the method you described together.
Would you be able to provide a brief example of how it might work?

Metin Akat

unread,
Sep 30, 2017, 5:14:29 PM9/30/17
to bean...@googlegroups.com
Hi,

I think Martin means something like this (or at least I'd do something like this, though I haven't given it a lot of thought):

2017-09-01 * "Retirement account"
    Assets:Investments:Retirement     10 RETIREMENT @ 1 USD
    Income:Salary:Retirement            -10 USD

By this point you'll see that the balance is 11 Dollars so you input this directive:
2017-09-30 price RETIREMENT  1.1 USD

2017-10-01 * "Retirement account"
    Assets:Investments:Retirement      10 RETIREMENT @ 1 USD
    Income:Salary:Retirement             -10 RETIREMENT @ 1 USD

By this point you see that the balance is 21.50, so you input this:

2017-10-30 price RETIREMENT 1.075 USD

By this method, in reports you'll be able to see both "book value" (how much you have invested) and "market value" (how much it's worth at any point of time) of the account.


I hope this helps,
Metin



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/bbd1dc6f-5618-4ac9-8b20-1eacaf3ff2fb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Metin Akat

unread,
Sep 30, 2017, 5:15:41 PM9/30/17
to bean...@googlegroups.com
Sorry the transaction on 2017-10-01 should be:

2017-10-01 * "Retirement account"
    Assets:Investments:Retirement      10 RETIREMENT @ 1 USD
    Income:Salary:Retirement             -10 USD

Martin Blais

unread,
Sep 30, 2017, 6:14:29 PM9/30/17
to Beancount
Here's one example in attachment.
It requires you to look at 
(a) the total account value, by logging in to your broker, and 
(b) to compute the total number of "shares" you've accounted to that account.
Then you can enter transactions with a current synthetic price for this new "fund".

See attachment for a working example.
There may be other ways to do this, I just came up with this.



synthcurrency.beancount

Martin Blais

unread,
Sep 30, 2017, 6:17:23 PM9/30/17
to Martin Blais, Beancount
Note: You'll need to update your code, I just fixed a bug that prevented doing this.

Martin Blais

unread,
Sep 30, 2017, 6:22:00 PM9/30/17
to Beancount
Here's (in attachment) another way, more similar to what Metin did, whereby the number of shares of FUND match the cost basis (they're always added at 1.00 USD).
The price adjusts for the market value.
I think it's more appropriate to use the cost basis over currency transactions.

Both ways can work I think.




synthcurrency2.beancount

john8...@gmail.com

unread,
Oct 4, 2017, 4:22:08 PM10/4/17
to Beancount
Your examples made it clear, thanks to the both of you!

For the sake of completeness, here is an example inspired by synthcurrency2.beancount, including an attempt to track fees: https://gist.github.com/anonymous/ff6d859bbf614cdbfeea970b2862f8c3 (unfortunately could not attach a file replying from the groups.google.com interface).

Shares are sold at market price to cover the fees, like the example in this thread:

2017-04-30 price FUND                            1.0575 USD

;; Sell 3.00 USD worth of FUND shares (at market price)
;; 2.836879432624113475177304965 * 1.0575 = 3.00
2017-04-30 * "Fees"
 
Assets:Bank:IRA:FUND   -2.836879432624113475177304965 FUND {1.0575 USD}
 
Expenses:Fees                                    3.00 USD

As mentioned in the thread, the account's booking method has to be set to "NONE".
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email 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 post to this group, send email to bean...@googlegroups.com.

Justus Pendleton

unread,
Oct 7, 2017, 11:28:35 AM10/7/17
to Beancount
On Thursday, October 5, 2017 at 3:22:08 AM UTC+7, john8...@gmail.com wrote:

;; Sell 3.00 USD worth of FUND shares (at market price)
;; 2.836879432624113475177304965 * 1.0575 = 3.00
2017-04-30 * "Fees"
 
Assets:Bank:IRA:FUND   -2.836879432624113475177304965 FUND {1.0575 USD}
 
Expenses:Fees                                    3.00 USD

Somewhat offtopic but...I believe that beancount lets you "do math". So you don't need to write out -2.83blahblahblah. You can just write:

3.0/1.0575 FUND {1.0575 USD}
Reply all
Reply to author
Forward
0 new messages