On Sat, Oct 31, 2020 at 4:09 PM Aaron Lindsay <[email protected]> wrote:

> Hello!
>
> I have a scary accounting question for Halloween...
>

oooOOOoOOoOoOoOOoO


>
> I have 8 years of GnuCash data I'd like to convert to beancount. The
> problem is that, as far as I can tell, GnuCash doesn't track cost basis for
> trades. Because of that, I'm having difficulty replicating the suggested
> approach from https://beancount.github.io/docs/trading_with_beancount.html.
> I am using https://github.com/falsifian/gnucash-to-beancount and can
> 'successfully' convert my data to beancount, but instead of specifying the
> cost basis, purchases of investments end up looking like:
>
> 2014-10-31 * "BUY 1 SPY @ 200"
>   Assets:Current-Assets:Brokerage:SPY 1 SPY @ 200 USD
>   Assets:Trading:CURRENCY:USD 200 USD
>   Assets:Current-Assets:Brokerage -200 USD
>   Assets:Trading:NYSE:SPY -1 SPY @ 200 USD
>

Urg...
This should be an improvement (despite the absence of cost basis):

2014-10-31 * "BUY 1 SPY @ 200"
>   Assets:Current-Assets:Brokerage:SPY 1 SPY @ 200 USD
>   Assets:Current-Assets:Brokerage -200 USD
>

Also, I'd create a cash sub-account for the cash portin.



> Sales are in essentially the same form, just in reverse. In this way, my 
> Assets:Trading:CURRENCY:USD
> account ends up being a weird combination
>

It's the aggregate P/L (without discounting commissions).


of the total cost basis of all my current investments and the gains or
> losses from previous investments. Obviously I have enough data here to
> calculate the cost basis for *purchases* of investments,
>

Yes, something like this:

2014-10-31 * "BUY 1 SPY @ 200"
>   Assets:Current-Assets:Brokerage:SPY 1 SPY {200 USD}
>   Assets:Current-Assets:Brokerage:Cash               -200 USD
>




> so that ought to be do-able with some modification of the
> gnucash-to-beancount scripts, but I'm not sure how best to handle the
> sales. I've been reading the beancount documentation and have found the
> "FIFO" booking method - is that pretty much my only option at this point?
> Are there any gotchas to using it in my case?
>

You could use that, but it's not necessarily going to match the P/L you
declared in the past for each period (though the total P/L should be
right). Personally I would gather my history and then try to manually match
each of the sales, but I'm a maniac. bean-doctor context can help, by
printing the available lots just before a transaction.

How many sales do you have?



As a bonus - if I end up using the "FIFO" booking method, is it possible to
> get beancount re-write my .beancount file with the cost basis it calculated
> internally for the sales?
>
My goal there would be to make the implicit cost basis on sales explicit -
> and allow me to use STRICT moving forward without having to manually fix up
> 8 years of transactions.
>

Yes. Just "bean-query print" your ledger and it will print out everything
explicitly.

I hope this helps,


>
> Thanks for any pointers!
>
> -Aaron
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/01dd4feb-9b9a-423b-bbee-d7a9d2613035n%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/01dd4feb-9b9a-423b-bbee-d7a9d2613035n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhPf4%2BwJ-E%2Bzcjvdv2Z2c99nN%3DQMO0Zdx_YD0q-DOuPaKg%40mail.gmail.com.

Reply via email to