You can do groups in beangrow and if the accounts are used exclusively for the same group I think you can specify them both and compute the returns over the joint set. I'd have to look at it again it's been forever.
I do something like irr, it's just a little newton search or something. Check out the source code for detail, it's just a few lines of code. All the complexity in that project is over defining and extracting the right cash flows from a beancount stream of directives. On Thu, Sep 2, 2021, 17:59 Ben Blount <b...@bben.us> wrote: > Depends on how you are computing IRR - it's not a beancount feature. Are > you talking about Martin's experimental returns calculator > <https://beancount.github.io/docs/calculating_portolio_returns.html>? I > haven't tried that out myself yet and I don't know if IRR is a feature it > has. > > Based on the IRR <https://www.investopedia.com/terms/i/irr.asp>formula > <https://www.investopedia.com/terms/i/irr.asp> seems like you'd want to > extract basis and cash flows for the investment under analysis, > disregarding what account it's being held in. Or maybe you want to > bucketize - treating tax-advantaged holdings differently from normal > holdings, discounting taxes from the normal asset's IRR. > > On Thu, Sep 2, 2021 at 1:10 PM jrgo...@gmail.com <jrgold...@gmail.com> > wrote: > >> Thanks @Ben. >> >> It's not terribly common but I just encountered 5 of them so I think I >> handling them manually for now is fine. >> >> Follow-up question: If you want to compute the IRR how will this work? In >> my specific case I have an investment in a partnership that generated 5 >> stock distributions which I then moved to my trading account and then I >> later sold. I'm not clear on all accounting steps I need to record in >> beancount to make this work. In order to get the cost basis in the new >> account I have to transfer some cash over I think and then if I want to >> compute the IRR for the partnership I'm not sure yet how I would do that. >> >> >> On Friday, September 3, 2021 at 1:45:29 AM UTC+12 bl...@furius.ca wrote: >> >>> +1 re. Ben's answer. >>> How many of these do you really do? >>> >>> >>> On Thu, Sep 2, 2021 at 2:30 AM Ben Blount <b...@bben.us> wrote: >>> >>>> Yeah this is high on my wishlist too. This came up a bunch for crypto >>>> users as well - you should find some examples if you search for crypto on >>>> the mailing list. >>>> >>>> The workaround is you have to transfer the lots manually, e.g make two >>>> postings per lot - one to reduce the lot on the old account, then recreate >>>> it with the original date and cost in the new account. >>>> direction >>>> bean-doctor can help you easily get all the lots, you can then copy >>>> paste to make this a little less fussy. >>>> >>>> I'm on mobile or I'd give you examples. >>>> >>>> On Wed, Sep 1, 2021, 22:37 jrgo...@gmail.com <jrgo...@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> I tried searching a bit in the documentation and this forum but not >>>>> sure how to handle this case and carry forward cost-basis information. >>>>> Imagine you buy some stock at institution 1 and transfer it to institution >>>>> 2 and then sell. How should one record all this? I tried the following but >>>>> I'm getting an error related to no positions found. >>>>> >>>>> Thanks, >>>>> Jonathan >>>>> >>>>> 2015-02-01 open Assets:Invest:ATrade >>>>> >>>>> 2015-02-01 open Assets:Invest:ATrade:Cash >>>>> >>>>> >>>>> 2015-04-01 * "Buy some shares of Hooli in April 2015" >>>>> >>>>> Assets:Invest:ATrade 25 HOOL >>>>> {10.00 USD, "first-lot"} >>>>> >>>>> Assets:Invest:ATrade:Cash -250 USD >>>>> >>>>> >>>>> >>>>> 2017-03-01 open Assets:Invest:ZTrade >>>>> >>>>> 2017-03-01 open Assets:Invest:ZTrade:Cash >>>>> >>>>> >>>>> 2017-04-01 * "Transfer from ATrade to ZTrade" >>>>> >>>>> Assets:Invest:ATrade -25 HOOL >>>>> >>>>> Assets:Invest:ZTrade 25 HOOL >>>>> >>>>> >>>>> >>>>> 2017-05-01 close Assets:Invest:ATrade >>>>> >>>>> >>>>> 2018-05-03 * "Sell some shares of Hooli in May 2018" >>>>> >>>>> Assets:Invest:ZTrade -25 HOOL {} @ >>>>> 22.00 USD >>>>> >>>>> Assets:Invest:ZTrade:Cash >>>>> >>>>> No position matches "Posting(account='Assets:Invest:ZTrade', units=-25 >>>>> HOOL, cost=CostSpec(number_per=<class 'beancount.core.number.MISSING'>, >>>>> number_total=None, currency='USD', date=None, label=None, merge=False), >>>>> price=22.00 USD, flag=None, meta={'filename': >>>>> '/Users/jonathan/Documents/Finances/beandata/test.beancount', 'lineno': >>>>> 22})" against balance (25 HOOL) >>>>> >>>>> -- >>>>> 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/b3efe67c-a858-4c2c-af6b-26e7444dd9e1n%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/beancount/b3efe67c-a858-4c2c-af6b-26e7444dd9e1n%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 beancount+...@googlegroups.com. >>>> >>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/beancount/CACGEkZtewt_iundhaTt8HZ654SJmNWJYyUHhgEPXx0gk2SfRkQ%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/beancount/CACGEkZtewt_iundhaTt8HZ654SJmNWJYyUHhgEPXx0gk2SfRkQ%40mail.gmail.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 beancount+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/beancount/f27d07a7-d27b-4f5b-82c5-5a296578bcb3n%40googlegroups.com >> <https://groups.google.com/d/msgid/beancount/f27d07a7-d27b-4f5b-82c5-5a296578bcb3n%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 beancount+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/CACGEkZvgsNhEE3CP9LhoFXwUZXV8_2otWcNT9EwvkCxCDMTk4w%40mail.gmail.com > <https://groups.google.com/d/msgid/beancount/CACGEkZvgsNhEE3CP9LhoFXwUZXV8_2otWcNT9EwvkCxCDMTk4w%40mail.gmail.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 beancount+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhMaa71n6yCcAvEQNWNm8vjvppdxy4wd5h88NyxSaGKstQ%40mail.gmail.com.