I am also in the UK and have come up with the following for using STRICT booking with rebalancing and labels for lots:
2020-12-07 * "Buy Asset" Assets:Fnord:Cash -6.86 GBP Assets:Fnord:Foo 5.5555 FOO {1.2345 GBP, "buy1"} 2021-04-07 * "Buy more asset" Assets:Fnord:Cash -30.80 GBP Assets:Fnord:Foo 13.1313 FOO {2.3456 GBP, "buy2"} 2021-04-11 * "Average cost re-base" ; Re-base to current average cost basis Assets:Fnord:Foo -5.5555 FOO {"buy1"} Assets:Fnord:Foo -13.1313 FOO {"buy2"} ; We let beancount handle the averaging for us Assets:Fnord:Foo (5.5555+13.1313) FOO {"balance1"} 2021-04-07 * "Sell from holding" Assets:Fnord:Cash 50 GBP Assets:Fnord:Foo -10 FOO {"balance1"} Any sale I make that matches the S104 holding will always be against one of the "balance" labels. I don't need to worry about rounding etc, but I still have to manually track the exact units of the commodity I'm buying/selling On Sunday 11 February 2024 at 16:15:41 UTC ceri....@gmail.com wrote: > Hi folks, > > I'm in the UK, so we get to deal with the inconvenience that is average > cost booking when it comes to figuring out capital gains taxes. I'm > currently using the average cost plugin, which works fine, but that > approach it means that the inventory never gets reduced, so you end up with > holdings never really going away. > > So I was planning on using a cost-basis adjustment approach ( > https://beancount.github.io/docs/trading_with_beancount.html#cost-basis-adjustment-and-return-of-capital) > > to "re-base" the assets to have a single average cost basis. In this case, > the asset is purchasable on a fractional basis. > > So I've tried something like this: > > 2020-12-07 open Assets:Fnord:Foo > FOO > 2020-12-07 open Assets:Fnord:Cash > GBP > > 2020-12-07 * "Buy Asset" > Assets:Fnord:Cash > -6.86 GBP > Assets:Fnord:Foo > 5.5555 FOO {1.2345 GBP} > > 2021-04-07 * "Buy more asset" > Assets:Fnord:Cash > -30.80 GBP > Assets:Fnord:Foo > 13.1313 FOO {2.3456 GBP} > > 2021-04-11 * "Average cost re-base" > ; Re-base to current average cost basis > Assets:Fnord:Foo > -5.5555 FOO {1.2345 GBP} > Assets:Fnord:Foo > -13.1313 FOO {2.3456 GBP} > ; Actual average is 2.015275062075903846565490079, according to > python's decimal module. > Assets:Fnord:Foo > 5.5555 FOO {2.0152 GBP} > Assets:Fnord:Foo > 13.1313 FOO {2.0152 GBP} > > No matter how much precision I specify for the average, it always seems to > be off by some small amount: > > /Users/cez/Documents/beancount/ledger/cost-basis-simple.beancount:12: > Transaction does not balance: (-0.00140267 GBP) > > If I use an average of 2.015, -0.0051. Even with the 20 decimal places of > precision for the average price, the transaction is off by > -0.000000000000000000102592 GBP. > > So I'm clearly missing something about the precision, and/or how to handle > these cost basis adjustments. Can anyone offer any suggesiton as to what I > might be missing? Is this one of those cases where I should post an > adjustment to a hack account of some kind? > > Thanks, > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/e8336dfa-9499-4173-a028-ba371fe63777n%40googlegroups.com.