Best way to handle stock exchanges

83 views
Skip to first unread message

Alex Johnstone

unread,
Dec 15, 2016, 1:30:48 PM12/15/16
to Beancount
Hello,

I have purchased an index fund and for some reason that fund has close and converted to a different one. What's the best way to handle this conversion?

Currently I have the following:


2014-10-30 * "Fund Purchase"
Assets:Invest:FIAAGY 972.9149 FIAAGY {1.02 GBP}
Assets:Invest:VVUILG 14.1509 VVUILG {140.98 GBP}
Assets:Invest:VVUKEQ 13.0067 VVUKEQ {191.06 GBP}
Assets:Invest:VVDVWE 22.1538 VVDVWE {202.90 GBP}
Expenses:Invest:Fees   29.94 GBP
Assets:Bank

2014-11-01 * "Fund Swap"
Assets:Invest:VVUKEQ -13.0067 VVUKEQ {191.06 GBP}
Assets:Invest:VVFUSI 16.6505 VVFUSI {149.25 GBP}


However, this fails due to the fund swap transaction not balancing. I calculated the 149.25 myself to try and make it match. If I leave off the lot price it doesn't work as it says the transaction doesn't balance.

Other than adding more decimal places to my calculated lot value is there are smarter way to do this?

Thanks,
Alex

Martin Blais

unread,
Dec 15, 2016, 9:41:52 PM12/15/16
to Beancount
Your residual is 2.7c, which is why Beancount finds it unacceptably large:



bean-doctor context best-way-to-handle-stock-exchanges.beancount 14
Hash:e7762575b71b638616255705e251b851
Location: /home/blais/r/q/beancount-data/user/alexjohnstone/best-way-to-handle-stock-exchanges.beancount:12

------------ Balances before transaction

  Assets:Invest:VVUKEQ            13.0067 VVUKEQ {191.06 GBP, 2014-10-30}

  Assets:Invest:VVFUSI


------------ Transaction

2014-11-01 * "Fund Swap"
  Assets:Invest:VVUKEQ  -13.0067 VVUKEQ {191.06 GBP, 2014-10-30}  ; -2485.060102 GBP
  Assets:Invest:VVFUSI   16.6505 VVFUSI {149.25 GBP, 2014-11-01}  ;  2485.087125 GBP


Residual: (0.027023 GBP)
Tolerances: VVFUSI=0.00005, VVUKEQ=0.00005
Basis: (0.027023 GBP)

------------ Balances after transaction

  Assets:Invest:VVUKEQ

* Assets:Invest:VVFUSI            16.6505 VVFUSI {149.25 GBP, 2014-11-01}



You can account for the rounding error explicitly:

2014-11-01 * "Fund Swap"
        Assets:Invest:VVUKEQ                    -13.0067 VVUKEQ {191.06 GBP}
        Assets:Invest:VVFUSI                     16.6505 VVFUSI {149.25 GBP}
        Equity:Rounding                         -0.027 GBP





Stefano Zacchiroli

unread,
Dec 16, 2016, 2:21:21 AM12/16/16
to bean...@googlegroups.com
On Thu, Dec 15, 2016 at 09:41:28PM -0500, Martin Blais wrote:
> You can account for the rounding error explicitly:
>
> 2014-11-01 * "Fund Swap"
> Assets:Invest:VVUKEQ -13.0067 VVUKEQ {191.06 GBP}
> Assets:Invest:VVFUSI 16.6505 VVFUSI {149.25 GBP}
> Equity:Rounding -0.027 GBP

this is more a general accounting question than a beancount-specific
one, but is it more common to use Equity:* for rounding errors than
appropriate Income/Expenses subcategories? What bothers me about using
Equity is that then you won't see the "impact" of the rounding error
when you just look at income/expenses over a given period of time (which
I often do). But maybe I'm missing something about why Equity is better
in these cases...

Cheers
--
Stefano Zacchiroli . za...@upsilon.cc . upsilon.cc/zack . . o . . . o . o
Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
Former Debian Project Leader . OSI Board Director . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

Martin Blais

unread,
Dec 16, 2016, 11:55:44 PM12/16/16
to Beancount
On Fri, Dec 16, 2016 at 2:21 AM, Stefano Zacchiroli <za...@upsilon.cc> wrote:
On Thu, Dec 15, 2016 at 09:41:28PM -0500, Martin Blais wrote:
> You can account for the rounding error explicitly:
>
> 2014-11-01 * "Fund Swap"
>         Assets:Invest:VVUKEQ                    -13.0067 VVUKEQ {191.06 GBP}
>         Assets:Invest:VVFUSI                     16.6505 VVFUSI {149.25 GBP}
>         Equity:Rounding                         -0.027 GBP

this is more a general accounting question than a beancount-specific
one, but is it more common to use Equity:* for rounding errors than
appropriate Income/Expenses subcategories? What bothers me about using
Equity is that then you won't see the "impact" of the rounding error
when you just look at income/expenses over a given period of time (which
I often do). But maybe I'm missing something about why Equity is better
in these cases...

Nope. Just a choice.
One might argue that using Expenses or even Assets may be a better choice.
Beancount treats all accounts equally the same, irrespective of category, so feel free to use whatever you want for this odd account, depending on where you'd like to view those crumbs.





Cheers
--
Stefano Zacchiroli . za...@upsilon.cc . upsilon.cc/zack . . o . . . o . o
Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
Former Debian Project Leader . OSI Board Director  . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

--
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/20161216072119.5r2gweu6zwnqy7vf%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages