Skip to content

Improvements to ACB tracking on "Calculate unrealized gain" page #138

@lfos

Description

@lfos

Not sure if this is the right spot for website content feedback, but feel free to point me elsewhere if needed.

I just went over https://hledger.org/gain.html#different-cost-base-calculations and it's great to see examples of different cost basis methods there. That said, I found the use of "lot tracking" subaccounts in the ACB example slightly surprising for two reasons:

  1. Mental model: ACB is all about treating your shares as one big homogeneous pool, but lot tracking forces you to pick arbitrary shares from specific lots when selling (pretending the sale maps to a specific lot when that's not really how ACB works conceptually).
  2. Complexity: Every time you buy more shares, you have to update the cost basis across all your lots. This scales badly.

I would have instead expected the example to look more like this:

2021-01-04 opening balances
    assets:cash                      $100.00
    equity:opening/closing balances

P 2021-01-04 ABC $2
P 2021-01-11 ABC $3
P 2021-01-18 ABC $4

2021-01-19 buying stock
    assets:stocks:ABC           5 ABC @ $4.40
    assets:cash               $-22.00

P 2021-01-25 ABC $5
P 2021-02-01 ABC $6

2021-02-02 buying more stock
    assets:stocks:ABC           4 ABC @ $6.50
    assets:cash               $-26.00
    ; optional: explicitly capture new cost basis
    assets:stocks:ABC          -5 ABC @ $4.40
    assets:stocks:ABC          -4 ABC @ $6.50
    assets:stocks:ABC           9 ABC @ $5.33
    equity:rounding

P 2021-02-08 ABC $5
P 2021-02-15 ABC $6
P 2021-02-22 ABC $7

2021-02-23 sell some stock
    assets:cash                $12.00
    assets:stocks:ABC          -2 ABC @ $5.33
    income:capital gains

P 2021-03-01 ABC $8

2021-03-02 sell remaining stock
    assets:cash                $54.00
    assets:stocks:ABC          -7 ABC @ $5.33
    income:capital gains

This feels way more natural for ACB; actually working with that pooled share concept. Unless I am missing anything, this also makes cost basis updates both optional and simpler (at most three entriest per transaction).

Am I missing anything? Are there any downsides to this approach?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions