Matthias Beyer
unread,Nov 18, 2023, 6:58:03 AM11/18/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bean...@googlegroups.com, bl...@furius.ca
Hi Blais,
Hi beancount list,
I am a long term beancount user but only lately got into how to work with
beancount and stock trading.
I moved my stock trades from "normal syntax", like:
2023-11-18 * "Buy some"
Assets:Stock +10 COOLSTOCK @ 10 EUR
Assets:Bank:Account -105 EUR
Expenses:Commissions
to the appropriate one
2023-11-18 * "Buy some"
Assets:Stock +10 COOLSTOCK {10 EUR}
Assets:Bank:Account -105 EUR
Expenses:Commissions
because I just recently learned about how to actually use beancount for stock
trading.
Now, my issue is that I buy ETF for a rather long time now, recurringly (each
months 1st). That means that there are a lot of postings for ETFs. I know
about the (experimental) "recurring" plugin, but I assume that this won't work
here because of the everchanging prices.
Either way, I wouldn't actually use that plugin, because I auto-import
transactions from my bank account and would need to filter out transactions
that are already done by a recurring order.
But that aside, my question is about something different actually: Do I move my
ETF postings from the first syntax (from above) to the second? It is not that
this is quite some effort (vim scripting ftw) but rather that it becomes quite
complex once I sell ETF again, right? Because I would essentially "match" my
ETF against the buying orders, although I probably do not sell the exact same
amount that I bought order-by-order!
E.G.
* buy 100 EUR worth of ETF at 10
* buy 100 EUR worth of ETF at 11
* buy 100 EUR worth of ETF at 12
* buy 100 EUR worth of ETF at 13
* buy 100 EUR worth of ETF at 14
* buy 100 EUR worth of ETF at 15
* buy 100 EUR worth of ETF at 16
... years pass
Now I have to sell. ETF is at 50 now and I want to have 100 out of it every
transaction.
So what I do now is
* sell 100 EUR worth of ETF that I bought at 10
The first 5 transactions of this work perfectly well... because the amount I
bought at 10 is now worth 500 of my currency. But after that I have to sell
<some fraction> of what I bought at 11 to get out 100 and for the last bit of
what I bought at 11 I also have to sell some fraction of what I bought at 12
to get out 100 of my currency. And this gets even more complex in real-life
because the ETF of course does not stay at 50 during my time that I am
selling, but is still moving in price and also because/if I do not want to get
out 100 but, say, 550 of my currency...
Does my logic check out?
Is there any "simple" solution to that? I can totally see the benefit of
actually doing that calculation! It's just that I am looking for a less
complex alternative to not burden my future self with work that might be
unnecessary! :-)
I am really looking forward to your answer!
Thank you very much for beancount!
Have a great weekend,
best from Germany
Matthias