Stock amortization

75 views
Skip to first unread message

Leo Melo

unread,
Jul 25, 2021, 9:29:57 PM7/25/21
to Beancount
Hi!

I'm trying to input a fund amortization on beancount.
I tryed this:

2019-12-31 * "Buy 208 SPTW11"
  Assets:Investiments:Broker:SPTW11   208 SPTW11 {{14301.32 USD}}
  Assets:Investiments:Broker:accout
  
2020-07-01 * "Amortization SPTW11"
  Assets:Investiments:Boker:SPTW11  -0.0 SPTW11 {{669.76 USD}}
  Assets:Investiments:Broker:account

But beancount does not like the zero amount for the units. I also tried "0 SPTW11 {{-669.76 USD}} and it does not work. I need to decrease the USD balance without altering the units amount. How can I do it in a proper way? I use fava to see my balances.

Thank you all in advance!

Ben Blount

unread,
Jul 25, 2021, 10:45:39 PM7/25/21
to Beancount
Hey Leo,
I'm not familiar with why a fund would so alter its cost basis, so I can't comment on whether adjusting the basis makes sense. But to do what you asked to:

Postings are adding or subtracting from an existing position. So adding or removing 0 units doesn't make sense.
Try a transaction which removes the old lot, and adds the new one like so:

2020-07-01 * "Amortization SPTW11"
  Assets:Investiments:Broker:SPTW11  -208 SPTW11 {2019-12-31}  # select the lot however you want (by cost, by date, or by label)
  Assets:Investiments:Broker:SPTW11  208 SPTW11 {{669.76 USD}}
  Income:Investment:RealizedPnL:Broker:SPTW11   # note that all transactions must balance to 0. This posting would contain the 14301.32 - 669.76 difference in value. Post it to a different account if Income:PnL is wrong.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/beancount/bd14b633-19fd-4e64-bd02-27a456d1d0f2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages